BATCH-63: added beginning of <chunk-oriented> element and parsing

This commit is contained in:
trisberg
2008-11-06 18:08:20 +00:00
parent 9fc06e577f
commit 8a1eae327c
6 changed files with 217 additions and 92 deletions

View File

@@ -57,6 +57,6 @@ public class StepWithTaskJobParserTests {
JobExecution jobExecution = jobRepository.createJobExecution(job.getName(), new JobParameters());
job.execute(jobExecution);
assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());
assertEquals(2, jobExecution.getStepExecutions().size());
assertEquals(3, jobExecution.getStepExecutions().size());
}
}

View File

@@ -0,0 +1,31 @@
package org.springframework.batch.core.configuration.xml;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
public class TestReader implements ItemReader<String> {
List<String> items = null;
{
List<String> l = new ArrayList<String>();
l.add("Item *** 1 ***");
l.add("Item *** 2 ***");
this.items = Collections.synchronizedList(l);
}
public String read() throws Exception, UnexpectedInputException,
ParseException {
if (items.size() > 0) {
String item = items.remove(0);
return item;
}
return null;
}
}

View File

@@ -0,0 +1,12 @@
package org.springframework.batch.core.configuration.xml;
import java.util.List;
import org.springframework.batch.item.ItemWriter;
public class TestWriter implements ItemWriter<String> {
public void write(List<? extends String> items) throws Exception {
}
}