RESOLVED - issue BATCH-789: Remove mark/reset from ItemReader

Remove AbstractItemReader.  All done (with remaining issues moved to BATCH-220).
This commit is contained in:
dsyer
2008-08-21 12:11:22 +00:00
parent 300e726909
commit fcf96a954f
16 changed files with 43 additions and 75 deletions

View File

@@ -27,11 +27,11 @@ import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.NoWorkFoundException;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.batch.item.support.AbstractItemReader;
import org.springframework.batch.item.support.PassthroughItemProcessor;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
import org.springframework.batch.repeat.support.RepeatTemplate;
@@ -114,7 +114,7 @@ public class ItemOrientedStepHandlerTests {
* @author Dave Syer
*
*/
private final class StubItemReader extends AbstractItemReader<String> {
private final class StubItemReader implements ItemReader<String> {
private int count = 0;
public String read() throws Exception, UnexpectedInputException, NoWorkFoundException, ParseException {

View File

@@ -45,7 +45,6 @@ import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.skip.SkipLimitExceededException;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.support.AbstractItemReader;
import org.springframework.batch.item.support.ListItemReader;
import org.springframework.batch.retry.RetryException;
import org.springframework.batch.retry.policy.RetryCacheCapacityExceededException;
@@ -339,7 +338,7 @@ public class StatefulRetryStepFactoryBeanTests {
// set the cache limit lower than the number of unique un-recovered
// errors expected
factory.setCacheCapacity(2);
ItemReader<String> provider = new AbstractItemReader<String>() {
ItemReader<String> provider = new ItemReader<String>() {
public String read() {
String item = ""+count;
provided.add(item);

View File

@@ -33,8 +33,8 @@ import org.springframework.batch.core.repository.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.dao.MapStepExecutionDao;
import org.springframework.batch.core.repository.support.SimpleJobRepository;
import org.springframework.batch.core.step.StepExecutionSynchronizer;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.support.AbstractItemReader;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
import org.springframework.batch.repeat.support.RepeatTemplate;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
@@ -78,7 +78,7 @@ public class StepExecutorInterruptionTests extends TestCase {
RepeatTemplate template = new RepeatTemplate();
// N.B, If we don't set the completion policy it might run forever
template.setCompletionPolicy(new SimpleCompletionPolicy(2));
step.setItemHandler(new SimpleStepHandler<Object>(new AbstractItemReader<Object>() {
step.setItemHandler(new SimpleStepHandler<Object>(new ItemReader<Object>() {
public Object read() throws Exception {
// do something non-trivial (and not Thread.sleep())
double foo = 1;
@@ -115,7 +115,7 @@ public class StepExecutorInterruptionTests extends TestCase {
Thread processingThread = createThread(stepExecution);
step.setItemHandler(new SimpleStepHandler<Object>(new AbstractItemReader<Object>() {
step.setItemHandler(new SimpleStepHandler<Object>(new ItemReader<Object>() {
public Object read() throws Exception {
return null;
}
@@ -152,7 +152,7 @@ public class StepExecutorInterruptionTests extends TestCase {
public void testLockNotReleasedIfChunkFails() throws Exception {
step.setItemHandler(new SimpleStepHandler<Object>(new AbstractItemReader<Object>() {
step.setItemHandler(new SimpleStepHandler<Object>(new ItemReader<Object>() {
public Object read() throws Exception {
throw new RuntimeException("Planned!");
}

View File

@@ -50,7 +50,6 @@ import org.springframework.batch.item.ItemStreamSupport;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.MarkFailedException;
import org.springframework.batch.item.ResetFailedException;
import org.springframework.batch.item.support.AbstractItemReader;
import org.springframework.batch.item.support.ListItemReader;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.repeat.policy.DefaultResultCompletionPolicy;
@@ -192,7 +191,7 @@ public class StepHandlerStepTests extends TestCase {
public void testIncrementRollbackCount() {
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
throw new RuntimeException();
@@ -215,7 +214,7 @@ public class StepHandlerStepTests extends TestCase {
public void testExitCodeDefaultClassification() throws Exception {
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
throw new RuntimeException();
@@ -239,7 +238,7 @@ public class StepHandlerStepTests extends TestCase {
public void testExitCodeCustomClassification() throws Exception {
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
throw new RuntimeException();
@@ -352,7 +351,7 @@ public class StepHandlerStepTests extends TestCase {
* Restartable.
*/
public void testRestartJobOnNonRestartableTasklet() throws Exception {
step.setItemHandler(new SimpleStepHandler<String>(new AbstractItemReader<String>() {
step.setItemHandler(new SimpleStepHandler<String>(new ItemReader<String>() {
public String read() throws Exception {
return "foo";
}
@@ -520,7 +519,7 @@ public class StepHandlerStepTests extends TestCase {
step.setInterruptionPolicy(interruptionPolicy);
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
throw new RuntimeException();
@@ -550,7 +549,7 @@ public class StepHandlerStepTests extends TestCase {
public void testStatusForNormalFailure() throws Exception {
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
// Trigger a rollback
throw new RuntimeException("Foo");
@@ -577,7 +576,7 @@ public class StepHandlerStepTests extends TestCase {
public void testStatusForErrorFailure() throws Exception {
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
// Trigger a rollback
throw new Error("Foo");
@@ -604,7 +603,7 @@ public class StepHandlerStepTests extends TestCase {
public void testStatusForResetFailedException() throws Exception {
ItemReader<String> itemReader = new AbstractItemReader<String>() {
ItemReader<String> itemReader = new ItemReader<String>() {
public String read() throws Exception {
// Trigger a rollback
throw new RuntimeException("Foo");