diff --git a/spring-batch-test/.springBeans b/spring-batch-test/.springBeans index 6151e7570..43f05bb98 100644 --- a/spring-batch-test/.springBeans +++ b/spring-batch-test/.springBeans @@ -1,30 +1,28 @@ - - - 1 - - - - - - - src/test/resources/data-source-context-init.xml - src/test/resources/data-source-context.xml - src/test/resources/simple-job-launcher-context.xml - src/test/resources/jobs/sampleJob.xml - src/test/resources/org/springframework/batch/sample/config/common-context.xml - - - - - true - false - - src/test/resources/data-source-context.xml - src/test/resources/data-source-context-init.xml - src/test/resources/jobs/sampleJob.xml - src/test/resources/org/springframework/batch/sample/config/common-context.xml - src/test/resources/simple-job-launcher-context.xml - - - - + + + 1 + + + + + + + src/test/resources/data-source-context.xml + src/test/resources/simple-job-launcher-context.xml + src/test/resources/jobs/sampleJob.xml + src/test/resources/org/springframework/batch/sample/config/common-context.xml + + + + + true + false + + src/test/resources/data-source-context.xml + src/test/resources/jobs/sampleJob.xml + src/test/resources/org/springframework/batch/sample/config/common-context.xml + src/test/resources/simple-job-launcher-context.xml + + + + diff --git a/spring-batch-test/src/test/java/org/springframework/batch/test/SampleJobTests.java b/spring-batch-test/src/test/java/org/springframework/batch/test/SampleJobTests.java index 898f68834..5f8daf1fe 100755 --- a/spring-batch-test/src/test/java/org/springframework/batch/test/SampleJobTests.java +++ b/spring-batch-test/src/test/java/org/springframework/batch/test/SampleJobTests.java @@ -33,16 +33,6 @@ public class SampleJobTests extends AbstractSimpleJobTests { this.jdbcTemplate.update("drop table TESTS"); } - @Test - public void test1() { - assertEquals(BatchStatus.COMPLETED, this.launchStep("step1").getStatus()); - this.verifyTasklet(1); - } - - private void verifyTasklet(int id) { - assertEquals(id, jdbcTemplate.queryForInt("SELECT ID from TESTS where NAME = 'SampleTasklet" + id + "'")); - } - @Test public void testJob() throws Exception { assertEquals(BatchStatus.COMPLETED,this.launchJob().getStatus()); @@ -56,8 +46,19 @@ public class SampleJobTests extends AbstractSimpleJobTests { } @Test - public void test2() { + public void testStep1Execution() { + assertEquals(BatchStatus.COMPLETED, this.launchStep("step1").getStatus()); + this.verifyTasklet(1); + } + + @Test + public void testStep2Execution() { assertEquals(BatchStatus.COMPLETED, this.launchStep("step2").getStatus()); this.verifyTasklet(2); } + + private void verifyTasklet(int id) { + assertEquals(id, jdbcTemplate.queryForInt("SELECT ID from TESTS where NAME = 'SampleTasklet" + id + "'")); + } + } diff --git a/spring-batch-test/src/test/java/org/springframework/batch/test/sample/SampleTasklet.java b/spring-batch-test/src/test/java/org/springframework/batch/test/sample/SampleTasklet.java index 2d7072ff2..d8a290f4b 100755 --- a/spring-batch-test/src/test/java/org/springframework/batch/test/sample/SampleTasklet.java +++ b/spring-batch-test/src/test/java/org/springframework/batch/test/sample/SampleTasklet.java @@ -19,7 +19,6 @@ public class SampleTasklet implements Tasklet { } public RepeatStatus execute(StepContribution contribution, AttributeAccessor attributes) throws Exception { - System.err.println("SampleTasklet1.execute()"); this.jdbcTemplate.update("insert into TESTS(ID, NAME) values (?, 'SampleTasklet" + id + "')", id); return RepeatStatus.FINISHED; } diff --git a/spring-batch-test/src/test/resources/data-source-context-init.xml b/spring-batch-test/src/test/resources/data-source-context-init.xml deleted file mode 100755 index d6103fd9c..000000000 --- a/spring-batch-test/src/test/resources/data-source-context-init.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - ${batch.schema.script} - ${batch.business.schema.script} - - - - - \ No newline at end of file diff --git a/spring-batch-test/src/test/resources/data-source-context.xml b/spring-batch-test/src/test/resources/data-source-context.xml index f4e0730cb..25c7732fd 100755 --- a/spring-batch-test/src/test/resources/data-source-context.xml +++ b/spring-batch-test/src/test/resources/data-source-context.xml @@ -1,22 +1,40 @@ - - + + + + + ${batch.schema.script} + ${batch.business.schema.script} + + + + + - + + - - + + + @@ -36,7 +54,8 @@ - @@ -47,18 +66,14 @@ - - - - - - - \ No newline at end of file diff --git a/spring-batch-test/src/test/resources/simple-job-launcher-context.xml b/spring-batch-test/src/test/resources/simple-job-launcher-context.xml index e9405da86..db5dc6951 100755 --- a/spring-batch-test/src/test/resources/simple-job-launcher-context.xml +++ b/spring-batch-test/src/test/resources/simple-job-launcher-context.xml @@ -1,66 +1,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file