diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/callback/ItemReaderRepeatCallbackTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/callback/ItemReaderRepeatCallbackTests.java index 8906fb889..36e2ce856 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/callback/ItemReaderRepeatCallbackTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/callback/ItemReaderRepeatCallbackTests.java @@ -27,12 +27,12 @@ import org.springframework.batch.item.support.ListItemReader; public class ItemReaderRepeatCallbackTests extends TestCase { - ItemReaderRepeatCallback callback; + ItemReaderRepeatCallback callback; List list = new ArrayList(); public void testDoWithRepeat() throws Exception { - callback = new ItemReaderRepeatCallback(new ListItemReader(Arrays.asList(new String[] { "foo", "bar" })), + callback = new ItemReaderRepeatCallback(new ListItemReader(Arrays.asList(new String[] { "foo", "bar" })), new AbstractItemWriter() { public void write(Object data) { list.add(data); @@ -44,8 +44,8 @@ public class ItemReaderRepeatCallbackTests extends TestCase { } public void testDoWithRepeatNullProcessor() throws Exception { - ListItemReader provider = new ListItemReader(Arrays.asList(new String[] { "foo", "bar" })); - callback = new ItemReaderRepeatCallback(provider); + ListItemReader provider = new ListItemReader(Arrays.asList(new String[] { "foo", "bar" })); + callback = new ItemReaderRepeatCallback(provider); callback.doInIteration(null); assertEquals(0, list.size()); assertEquals("bar", provider.read()); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AbstractTradeBatchTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AbstractTradeBatchTests.java index d2248d110..19ff4f4de 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AbstractTradeBatchTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AbstractTradeBatchTests.java @@ -48,7 +48,7 @@ public abstract class AbstractTradeBatchTests extends TestCase { provider.open(new ExecutionContext()); } - protected static class TradeItemReader extends FlatFileItemReader { + protected static class TradeItemReader extends FlatFileItemReader { protected TradeItemReader(Resource resource) throws Exception { super(); @@ -59,8 +59,8 @@ public abstract class AbstractTradeBatchTests extends TestCase { } - protected static class TradeMapper implements FieldSetMapper{ - public Object mapLine(FieldSet fs, int lineNum) { + protected static class TradeMapper implements FieldSetMapper { + public Trade mapLine(FieldSet fs, int lineNum) { return new Trade(fs); } } diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java index eb3927409..085e94fee 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java @@ -77,7 +77,7 @@ public class AsynchronousRepeatTests extends AbstractTradeBatchTests { final String threadName = Thread.currentThread().getName(); final Set threadNames = new HashSet(); - final RepeatCallback stepCallback = new ItemReaderRepeatCallback(provider, processor) { + final RepeatCallback stepCallback = new ItemReaderRepeatCallback(provider, processor) { public ExitStatus doInIteration(RepeatContext context) throws Exception { assertNotSame(threadName, Thread.currentThread().getName()); threadNames.add(Thread.currentThread().getName()); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ChunkedRepeatTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ChunkedRepeatTests.java index a692c9903..923064dd8 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ChunkedRepeatTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ChunkedRepeatTests.java @@ -46,7 +46,7 @@ public class ChunkedRepeatTests extends AbstractTradeBatchTests { public void testChunkedBatchWithTerminationPolicy() throws Exception { RepeatTemplate repeatTemplate = new RepeatTemplate(); - final RepeatCallback callback = new ItemReaderRepeatCallback(provider, processor); + final RepeatCallback callback = new ItemReaderRepeatCallback(provider, processor); final RepeatTemplate chunkTemplate = new RepeatTemplate(); // The policy is resettable so we only have to resolve this dependency @@ -80,7 +80,7 @@ public class ChunkedRepeatTests extends AbstractTradeBatchTests { public void testAsynchronousChunkedBatchWithCompletionPolicy() throws Exception { RepeatTemplate repeatTemplate = new RepeatTemplate(); - final RepeatCallback callback = new ItemReaderRepeatCallback(provider, processor); + final RepeatCallback callback = new ItemReaderRepeatCallback(provider, processor); final TaskExecutorRepeatTemplate chunkTemplate = new TaskExecutorRepeatTemplate(); // The policy is resettable so we only have to resolve this dependency @@ -148,17 +148,17 @@ public class ChunkedRepeatTests extends AbstractTradeBatchTests { while (!chunker.ready()) { - ItemReader truncated = new AbstractItemReader() { + ItemReader truncated = new AbstractItemReader() { int count = 0; - public Object read() throws Exception { + public Trade read() throws Exception { if (count++ < 2) return provider.read(); return null; } }; chunker.reset(); - template.iterate(new ItemReaderRepeatCallback(truncated, processor) { + template.iterate(new ItemReaderRepeatCallback(truncated, processor) { public ExitStatus doInIteration(RepeatContext context) throws Exception { ExitStatus result = super.doInIteration(context); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java index 2154e7ffe..72c970d0a 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java @@ -46,7 +46,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { } public void testExecute() throws Exception { - template.iterate(new ItemReaderRepeatCallback(provider, processor)); + template.iterate(new ItemReaderRepeatCallback(provider, processor)); assertEquals(NUMBER_OF_ITEMS, processor.count); } @@ -59,7 +59,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { template.setCompletionPolicy(new SimpleCompletionPolicy(2)); - template.iterate(new ItemReaderRepeatCallback(provider, processor)); + template.iterate(new ItemReaderRepeatCallback(provider, processor)); assertEquals(2, processor.count); @@ -199,7 +199,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { */ public void testEarlyCompletionWithContext() throws Exception { - ExitStatus result = template.iterate(new ItemReaderRepeatCallback(provider, processor) { + ExitStatus result = template.iterate(new ItemReaderRepeatCallback(provider, processor) { public ExitStatus doInIteration(RepeatContext context) throws Exception { ExitStatus result = super.doInIteration(context); @@ -227,7 +227,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { */ public void testEarlyCompletionWithContextTerminated() throws Exception { - ExitStatus result = template.iterate(new ItemReaderRepeatCallback(provider, processor) { + ExitStatus result = template.iterate(new ItemReaderRepeatCallback(provider, processor) { public ExitStatus doInIteration(RepeatContext context) throws Exception { ExitStatus result = super.doInIteration(context); @@ -317,7 +317,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { * @throws Exception */ public void testResult() throws Exception { - ExitStatus result = template.iterate(new ItemReaderRepeatCallback(provider, processor)); + ExitStatus result = template.iterate(new ItemReaderRepeatCallback(provider, processor)); assertEquals(NUMBER_OF_ITEMS, processor.count); // We are complete - do not expect to be called again assertFalse(result.isContinuable()); @@ -356,7 +356,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { ExitStatus result = ExitStatus.FINISHED; try { - result = template.iterate(new ItemReaderRepeatCallback(provider, processor) { + result = template.iterate(new ItemReaderRepeatCallback(provider, processor) { public ExitStatus doInIteration(RepeatContext context) throws Exception { ExitStatus result = super.doInIteration(context); @@ -419,7 +419,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { called = true; assertSame(exception, throwable); throw throwable; // re-throw so that repeat template - // terminates iteration + // terminates iteration } } ExceptionHandlerStub exHandler = new ExceptionHandlerStub();