Merged MapTaskExecutionTests into TaskExecutionDaoTests
Removes duplicated code. Resolves #427
This commit is contained in:
@@ -71,21 +71,25 @@ public class BatchEventsApplication {
|
||||
|
||||
@Bean
|
||||
public Step step2() {
|
||||
return new StepBuilder("step2").repository(this.jobRepository).<String, String>chunk(DEFAULT_CHUNK_COUNT)
|
||||
.reader(new ListItemReader<>(Arrays.asList("1", "2", "3", "4", "5", "6")))
|
||||
.processor(new ItemProcessor<String, String>() {
|
||||
@Override
|
||||
public String process(String item) throws Exception {
|
||||
return String.valueOf(Integer.parseInt(item) * -1);
|
||||
return new StepBuilder("step2").repository(this.jobRepository)
|
||||
.<String, String>chunk(DEFAULT_CHUNK_COUNT)
|
||||
.reader(new ListItemReader<>(Arrays.asList("1", "2", "3", "4", "5", "6")))
|
||||
.processor(new ItemProcessor<String, String>() {
|
||||
@Override
|
||||
public String process(String item) throws Exception {
|
||||
return String.valueOf(Integer.parseInt(item) * -1);
|
||||
}
|
||||
})
|
||||
.writer(new ItemWriter<String>() {
|
||||
@Override
|
||||
public void write(Chunk<? extends String> items) throws Exception {
|
||||
for (String item : items) {
|
||||
System.out.println(">> " + item);
|
||||
}
|
||||
}).writer(new ItemWriter<String>() {
|
||||
@Override
|
||||
public void write(Chunk<? extends String> items) throws Exception {
|
||||
for (String item : items) {
|
||||
System.out.println(">> " + item);
|
||||
}
|
||||
}
|
||||
}).transactionManager(transactionManager).build();
|
||||
}
|
||||
})
|
||||
.transactionManager(transactionManager)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -84,8 +84,10 @@ public class BatchEventsApplicationTests {
|
||||
private List<Message<byte[]>> testListener(String bindingName, int numberToRead) {
|
||||
List<Message<byte[]>> results = new ArrayList<>();
|
||||
this.applicationContext = new SpringApplicationBuilder()
|
||||
.sources(TestChannelBinderConfiguration.getCompleteConfiguration(BatchEventsTestApplication.class))
|
||||
.web(WebApplicationType.NONE).build().run(getCommandLineParams(true));
|
||||
.sources(TestChannelBinderConfiguration.getCompleteConfiguration(BatchEventsTestApplication.class))
|
||||
.web(WebApplicationType.NONE)
|
||||
.build()
|
||||
.run(getCommandLineParams(true));
|
||||
OutputDestination target = this.applicationContext.getBean(OutputDestination.class);
|
||||
for (int i = 0; i < numberToRead; i++) {
|
||||
results.add(target.receive(10000, bindingName));
|
||||
|
||||
Reference in New Issue
Block a user