diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxy.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/item/reader/ExceptionThrowingItemReaderProxy.java similarity index 96% rename from spring-batch-samples/src/main/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxy.java rename to spring-batch-samples/src/main/java/org/springframework/batch/sample/item/reader/ExceptionThrowingItemReaderProxy.java index dfb82ba58..e512ef637 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxy.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/item/reader/ExceptionThrowingItemReaderProxy.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.batch.sample.tasklet; +package org.springframework.batch.sample.item.reader; import org.springframework.batch.core.UnexpectedJobExecutionException; diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/mapping/GameMapper.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/mapping/GameMapper.java deleted file mode 100644 index 532f5b751..000000000 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/mapping/GameMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.springframework.batch.sample.mapping; - -import org.springframework.batch.item.file.mapping.FieldSet; -import org.springframework.batch.item.file.mapping.FieldSetMapper; -import org.springframework.batch.sample.domain.Game; - -public class GameMapper implements FieldSetMapper { - - public Object mapLine(FieldSet fs) { - - if(fs == null){ - return null; - } - - Game game = new Game(); - game.setId(fs.readString("id")); - game.setYear(fs.readInt("year")); - game.setTeam(fs.readString("team")); - game.setWeek(fs.readInt("week")); - game.setOpponent(fs.readString("opponent")); - game.setCompletes(fs.readInt("completes")); - game.setAttempts(fs.readInt("attempts")); - game.setPassingYards(fs.readInt("passingYards")); - game.setPassingTd(fs.readInt("passingTd")); - game.setInterceptions(fs.readInt("interceptions")); - game.setRushes(fs.readInt("rushes")); - game.setRushYards(fs.readInt("rushYards")); - game.setReceptions(fs.readInt("receptions", 0)); - game.setReceptionYards(fs.readInt("receptionYards")); - game.setTotalTd(fs.readInt("totalTd")); - - return game; - } - -} diff --git a/spring-batch-samples/src/main/resources/jobs/footballJob.xml b/spring-batch-samples/src/main/resources/jobs/footballJob.xml index 23204a1ab..a55006c3e 100644 --- a/spring-batch-samples/src/main/resources/jobs/footballJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/footballJob.xml @@ -88,7 +88,7 @@ + class="org.springframework.batch.sample.mapping.GameFieldSetMapper" /> diff --git a/spring-batch-samples/src/main/resources/jobs/restartSample.xml b/spring-batch-samples/src/main/resources/jobs/restartSample.xml index 4117c08e4..399eb48e8 100644 --- a/spring-batch-samples/src/main/resources/jobs/restartSample.xml +++ b/spring-batch-samples/src/main/resources/jobs/restartSample.xml @@ -35,7 +35,7 @@ + class="org.springframework.batch.sample.item.reader.ExceptionThrowingItemReaderProxy"> diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxyTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxyTests.java index 00afd807d..e50c221b4 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxyTests.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/tasklet/ExceptionThrowingItemReaderProxyTests.java @@ -8,6 +8,7 @@ import org.springframework.batch.core.UnexpectedJobExecutionException; import org.springframework.batch.item.support.ListItemReader; import org.springframework.batch.repeat.context.RepeatContextSupport; import org.springframework.batch.repeat.support.RepeatSynchronizationManager; +import org.springframework.batch.sample.item.reader.ExceptionThrowingItemReaderProxy; public class ExceptionThrowingItemReaderProxyTests extends TestCase {