BATCH-2229 & BATCH-2218: Removed OSGi related metadata and Maven POMs
This commit is contained in:
@@ -30,7 +30,7 @@ public class OutputFileListener {
|
||||
|
||||
private String inputKeyName = "fileName";
|
||||
|
||||
private String path = "file:./target/output/";
|
||||
private String path = "file:./build/output/";
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.batch.item.ItemReader;
|
||||
* {@link ItemReader} that can identify the record boundaries. The custom reader
|
||||
* should mark the beginning and end of records by returning an
|
||||
* {@link AggregateItem} which responds true to its query methods
|
||||
* <code>is*()</code>.<br/><br/>
|
||||
* <code>is*()</code>.<br><br>
|
||||
*
|
||||
* This class is thread-safe (it can be used concurrently by multiple threads)
|
||||
* as long as the {@link ItemReader} is also thread-safe.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Placeholders batch.*
|
||||
# for H2:
|
||||
batch.jdbc.driver=org.h2.Driver
|
||||
batch.jdbc.url=jdbc:h2:file:target/data/h2
|
||||
batch.jdbc.url=jdbc:h2:file:build/data/h2
|
||||
batch.jdbc.user=sa
|
||||
batch.jdbc.password=
|
||||
batch.jdbc.testWhileIdle=false
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
<bean id="fileItemWriter1" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="name" value="fw1" />
|
||||
<property name="resource" value="file:target/test-outputs/CustomerReport1.txt" />
|
||||
<property name="resource" value="file:build/test-outputs/CustomerReport1.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
</property>
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
<bean id="fileItemWriter2" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="name" value="fw2" />
|
||||
<property name="resource" value="file:target/test-outputs/CustomerReport2.txt" />
|
||||
<property name="resource" value="file:build/test-outputs/CustomerReport2.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
</property>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
void execute() {
|
||||
def ant = new AntBuilder()
|
||||
ant.unzip(src:"src/main/resources/data/groovyJob/input/files.zip",
|
||||
dest:"target/groovyJob/staging")
|
||||
dest:"build/groovyJob/staging")
|
||||
}
|
||||
}
|
||||
</lang:inline-script>
|
||||
@@ -46,9 +46,9 @@
|
||||
class ZipTasklet {
|
||||
void execute() {
|
||||
def ant = new AntBuilder()
|
||||
ant.mkdir(dir:"target/groovyJob/output")
|
||||
ant.zip(destfile:"target/groovyJob/output/files.zip",
|
||||
basedir:"target/groovyJob/staging", includes:"**")
|
||||
ant.mkdir(dir:"build/groovyJob/output")
|
||||
ant.zip(destfile:"build/groovyJob/output/files.zip",
|
||||
basedir:"build/groovyJob/staging", includes:"**")
|
||||
}
|
||||
}
|
||||
</lang:inline-script>
|
||||
|
||||
@@ -61,6 +61,6 @@
|
||||
</bean>
|
||||
<bean id="outputResource" class="org.springframework.core.io.FileSystemResource">
|
||||
<constructor-arg type="java.lang.String"
|
||||
value="target/test-outputs/headerFooterOutput.txt" />
|
||||
value="build/test-outputs/headerFooterOutput.txt" />
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -35,7 +35,7 @@
|
||||
<bean id="itemWriter" class="org.springframework.batch.sample.iosample.internal.MultiLineTradeItemWriter">
|
||||
<property name="delegate">
|
||||
<bean class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource" value="file:target/test-outputs/multiLineOutput.txt" />
|
||||
<property name="resource" value="file:build/test-outputs/multiLineOutput.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
</property>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
|
||||
<bean id="itemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource" value="file:target/test-outputs/multiRecordTypeOutput.txt" />
|
||||
<property name="resource" value="file:build/test-outputs/multiRecordTypeOutput.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.sample.iosample.internal.DelegatingTradeLineAggregator">
|
||||
<property name="tradeLineAggregator" ref="tradeLineAggregator" />
|
||||
|
||||
@@ -31,6 +31,6 @@
|
||||
</bean>
|
||||
|
||||
<bean id="outputResource" class="org.springframework.core.io.FileSystemResource">
|
||||
<constructor-arg value="target/test-outputs/output.xml" />
|
||||
<constructor-arg value="build/test-outputs/output.xml" />
|
||||
</bean>
|
||||
</beans>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<bean id="writer" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource"
|
||||
value="file:target/test-outputs/20070122.testStream.multilineStep.txt" />
|
||||
value="file:build/test-outputs/20070122.testStream.multilineStep.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean
|
||||
class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="fileItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource" value="file:target/test-outputs/multilineOrderOutput.txt" />
|
||||
<property name="resource" value="file:build/test-outputs/multilineOrderOutput.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.sample.domain.order.internal.OrderLineAggregator">
|
||||
<property name="aggregators" ref="outputAggregators"/>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</step>
|
||||
|
||||
<bean id="fileNameListener" class="org.springframework.batch.sample.common.OutputFileListener" scope="step">
|
||||
<property name="path" value="file:./target/output/file/" />
|
||||
<property name="path" value="file:./build/output/file/" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="outputTestReader" class="org.springframework.batch.item.file.MultiResourceItemReader" scope="prototype">
|
||||
<property name="resources" value="file:target/output/file/delimited*.csv" />
|
||||
<property name="resources" value="file:build/output/file/delimited*.csv" />
|
||||
<property name="delegate" ref="testItemReader" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</step>
|
||||
|
||||
<bean id="fileNameListener" class="org.springframework.batch.sample.common.OutputFileListener" scope="step">
|
||||
<property name="path" value="file:./target/output/jdbc/" />
|
||||
<property name="path" value="file:./build/output/jdbc/" />
|
||||
</bean>
|
||||
|
||||
<bean id="itemReader" scope="step" autowire-candidate="false" class="org.springframework.batch.item.database.JdbcPagingItemReader">
|
||||
@@ -60,7 +60,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="outputTestReader" class="org.springframework.batch.item.file.MultiResourceItemReader" scope="prototype">
|
||||
<property name="resources" value="file:target/output/jdbc/*.csv" />
|
||||
<property name="resources" value="file:build/output/jdbc/*.csv" />
|
||||
<property name="delegate" ref="testItemReader" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -61,6 +61,6 @@
|
||||
</bean>
|
||||
|
||||
<bean id="outputResource" class="org.springframework.core.io.FileSystemResource">
|
||||
<constructor-arg value="target/test-outputs/restartFileOutput.csv" />
|
||||
<constructor-arg value="build/test-outputs/restartFileOutput.csv" />
|
||||
</bean>
|
||||
</beans>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<bean id="customerReportItemWriter" class="org.springframework.batch.sample.domain.trade.internal.FlatFileCustomerCreditDao">
|
||||
<property name="itemWriter">
|
||||
<bean class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource" value="file:target/test-outputs/20070122.testStream.CustomerReportStep.TEMP.txt" />
|
||||
<property name="resource" value="file:build/test-outputs/20070122.testStream.CustomerReportStep.TEMP.txt" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
</property>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project name="Spring Batch: ${project.name}">
|
||||
|
||||
<body>
|
||||
|
||||
<links>
|
||||
<item name="${project.name}" href="index.html"/>
|
||||
</links>
|
||||
|
||||
<menu name="Reference Material">
|
||||
<item name="${project.name}" href="index.html"/>
|
||||
</menu>
|
||||
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
|
||||
</project>
|
||||
@@ -66,8 +66,8 @@ public class CompositeItemWriterSampleFunctionalTests {
|
||||
|
||||
jobLauncherTestUtils.launchJob();
|
||||
|
||||
checkOutputFile("target/test-outputs/CustomerReport1.txt");
|
||||
checkOutputFile("target/test-outputs/CustomerReport2.txt");
|
||||
checkOutputFile("build/test-outputs/CustomerReport1.txt");
|
||||
checkOutputFile("build/test-outputs/CustomerReport2.txt");
|
||||
checkOutputTable(before);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,14 +41,14 @@ public class GroovyJobFunctionalTests {
|
||||
|
||||
@Before
|
||||
public void removeOldData() throws IOException {
|
||||
FileUtils.deleteDirectory(new File("target/groovyJob"));
|
||||
FileUtils.deleteDirectory(new File("build/groovyJob"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLaunchJob() throws Exception {
|
||||
assertFalse(new File("target/groovyJob/output/files.zip").exists());
|
||||
assertFalse(new File("build/groovyJob/output/files.zip").exists());
|
||||
jobLauncherTestUtils.launchJob();
|
||||
assertTrue(new File("target/groovyJob/output/files.zip").exists());
|
||||
assertTrue(new File("build/groovyJob/output/files.zip").exists());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class MultilineJobFunctionalTests {
|
||||
private static final String EXPECTED_RESULT = "[Trade: [isin=UK21341EAH45,quantity=978,price=98.34,customer=customer1], Trade: [isin=UK21341EAH46,quantity=112,price=18.12,customer=customer2]]"
|
||||
+ "[Trade: [isin=UK21341EAH47,quantity=245,price=12.78,customer=customer2], Trade: [isin=UK21341EAH48,quantity=108,price=9.25,customer=customer3], Trade: [isin=UK21341EAH49,quantity=854,price=23.39,customer=customer4]]";
|
||||
|
||||
private Resource output = new FileSystemResource("target/test-outputs/20070122.testStream.multilineStep.txt");
|
||||
private Resource output = new FileSystemResource("build/test-outputs/20070122.testStream.multilineStep.txt");
|
||||
|
||||
@Test
|
||||
public void testJobLaunch() throws Exception {
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
"/job-runner-context.xml" })
|
||||
public class MultilineOrderJobFunctionalTests {
|
||||
|
||||
private static final String ACTUAL = "target/test-outputs/multilineOrderOutput.txt";
|
||||
private static final String ACTUAL = "build/test-outputs/multilineOrderOutput.txt";
|
||||
private static final String EXPECTED = "data/multilineOrderJob/result/multilineOrderOutput.txt";
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class OutputFileListenerTests {
|
||||
private OutputFileListener listener = new OutputFileListener();
|
||||
private StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 1L);
|
||||
@@ -28,7 +28,7 @@ public class OutputFileListenerTests {
|
||||
@Test
|
||||
public void testCreateOutputNameFromInput() {
|
||||
listener.createOutputNameFromInput(stepExecution);
|
||||
assertEquals("{outputFile=file:./target/output/foo.csv}", stepExecution.getExecutionContext().toString());
|
||||
assertEquals("{outputFile=file:./build/output/foo.csv}", stepExecution.getExecutionContext().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DelimitedFunctionalTests extends AbstractIoSampleTests {
|
||||
@Override
|
||||
protected void pointReaderToOutput(ItemReader<CustomerCredit> reader) {
|
||||
JobParameters jobParameters = new JobParametersBuilder(super.getUniqueJobParameters()).addString("inputFile",
|
||||
"file:./target/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
"file:./build/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(jobParameters);
|
||||
StepSynchronizationManager.close();
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
@@ -49,7 +49,7 @@ public class DelimitedFunctionalTests extends AbstractIoSampleTests {
|
||||
protected JobParameters getUniqueJobParameters() {
|
||||
return new JobParametersBuilder(super.getUniqueJobParameters()).addString("inputFile",
|
||||
"data/iosample/input/delimited.csv").addString("outputFile",
|
||||
"file:./target/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
"file:./build/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class FixedLengthFunctionalTests extends AbstractIoSampleTests {
|
||||
@Override
|
||||
protected void pointReaderToOutput(ItemReader<CustomerCredit> reader) {
|
||||
JobParameters jobParameters = new JobParametersBuilder(super.getUniqueJobParameters()).addString("inputFile",
|
||||
"file:./target/test-outputs/fixedLengthOutput.txt").toJobParameters();
|
||||
"file:./build/test-outputs/fixedLengthOutput.txt").toJobParameters();
|
||||
StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(jobParameters);
|
||||
StepSynchronizationManager.close();
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
@@ -44,7 +44,7 @@ public class FixedLengthFunctionalTests extends AbstractIoSampleTests {
|
||||
protected JobParameters getUniqueJobParameters() {
|
||||
return new JobParametersBuilder(super.getUniqueJobParameters()).addString("inputFile",
|
||||
"data/iosample/input/fixedLength.txt").addString("outputFile",
|
||||
"file:./target/test-outputs/fixedLengthOutput.txt").toJobParameters();
|
||||
"file:./build/test-outputs/fixedLengthOutput.txt").toJobParameters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
"/job-runner-context.xml" })
|
||||
public class MultiLineFunctionalTests {
|
||||
|
||||
private static final String OUTPUT_FILE = "target/test-outputs/multiLineOutput.txt";
|
||||
private static final String OUTPUT_FILE = "build/test-outputs/multiLineOutput.txt";
|
||||
|
||||
private static final String INPUT_FILE = "src/main/resources/data/iosample/input/multiLine.txt";
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
"/job-runner-context.xml" })
|
||||
public class MultiRecordTypeFunctionalTests {
|
||||
|
||||
private static final String OUTPUT_FILE = "target/test-outputs/multiRecordTypeOutput.txt";
|
||||
private static final String OUTPUT_FILE = "build/test-outputs/multiRecordTypeOutput.txt";
|
||||
|
||||
private static final String INPUT_FILE = "src/main/resources/data/iosample/input/multiRecordType.txt";
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class MultiResourceFunctionalTests extends AbstractIoSampleTests {
|
||||
@Override
|
||||
protected void pointReaderToOutput(ItemReader<CustomerCredit> reader) {
|
||||
JobParameters jobParameters = new JobParametersBuilder(super.getUniqueJobParameters()).addString(
|
||||
"input.file.path", "file:target/test-outputs/multiResourceOutput.csv.*").toJobParameters();
|
||||
"input.file.path", "file:build/test-outputs/multiResourceOutput.csv.*").toJobParameters();
|
||||
StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(jobParameters);
|
||||
StepSynchronizationManager.close();
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
@@ -48,7 +48,7 @@ public class MultiResourceFunctionalTests extends AbstractIoSampleTests {
|
||||
protected JobParameters getUniqueJobParameters() {
|
||||
JobParametersBuilder builder = new JobParametersBuilder(super.getUniqueJobParameters());
|
||||
return builder.addString("input.file.path", "classpath:data/iosample/input/delimited*.csv").addString(
|
||||
"output.file.path", "file:target/test-outputs/multiResourceOutput.csv").toJobParameters();
|
||||
"output.file.path", "file:build/test-outputs/multiResourceOutput.csv").toJobParameters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TwoJobInstancesDelimitedFunctionalTests {
|
||||
|
||||
private void verifyOutput(int expected) throws Exception {
|
||||
JobParameters jobParameters = new JobParametersBuilder().addString("inputFile",
|
||||
"file:./target/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
"file:./build/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(jobParameters);
|
||||
|
||||
int count = StepScopeTestUtils.doInStepScope(stepExecution, new Callable<Integer>() {
|
||||
@@ -101,6 +101,6 @@ public class TwoJobInstancesDelimitedFunctionalTests {
|
||||
|
||||
protected JobParameters getJobParameters(String fileName) {
|
||||
return new JobParametersBuilder().addLong("timestamp", new Date().getTime()).addString("inputFile", fileName)
|
||||
.addString("outputFile", "file:./target/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
.addString("outputFile", "file:./build/test-outputs/delimitedOutput.csv").toJobParameters();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user