diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests.java index b350f9620..bd6874ff6 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests.java @@ -16,7 +16,6 @@ package org.springframework.batch.core.configuration.xml; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,22 +43,21 @@ public class StopRestartOnCompletedStepJobParserTests extends AbstractJobParserT // // First Launch // - launchAndAssert(); + launchAndAssert("[s0, s1]"); // // Second Launch // stepNamesList.clear(); - launchAndAssert(); + launchAndAssert("[s1]"); } - private void launchAndAssert() throws JobInstanceAlreadyCompleteException, JobRestartException, + private void launchAndAssert(String stepNames) throws JobInstanceAlreadyCompleteException, JobRestartException, JobExecutionAlreadyRunningException { JobExecution jobExecution = createJobExecution(); job.execute(jobExecution); - assertEquals(1, stepNamesList.size()); - assertTrue(stepNamesList.contains("s1")); + assertEquals(stepNames, stepNamesList.toString()); assertEquals(BatchStatus.STOPPED, jobExecution.getStatus()); assertEquals(ExitStatus.STOPPED.getExitCode(), jobExecution.getExitStatus().getExitCode()); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests.java index e53b962dd..70fb3d694 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests.java @@ -16,7 +16,6 @@ package org.springframework.batch.core.configuration.xml; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,22 +43,21 @@ public class StopRestartOnFailedStepJobParserTests extends AbstractJobParserTest // // First Launch // - launchAndAssert(); + launchAndAssert("[s0, fail]"); // // Second Launch // stepNamesList.clear(); - launchAndAssert(); + launchAndAssert("[fail]"); } - private void launchAndAssert() throws JobInstanceAlreadyCompleteException, JobRestartException, + private void launchAndAssert(String stepNames) throws JobInstanceAlreadyCompleteException, JobRestartException, JobExecutionAlreadyRunningException { JobExecution jobExecution = createJobExecution(); job.execute(jobExecution); - assertEquals(1, stepNamesList.size()); - assertTrue(stepNamesList.contains("fail")); + assertEquals(stepNames, stepNamesList.toString()); assertEquals(BatchStatus.STOPPED, jobExecution.getStatus()); assertEquals(ExitStatus.STOPPED.getExitCode(), jobExecution.getExitStatus().getExitCode()); diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml index 6082ff81c..0b13bf574 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml @@ -7,6 +7,7 @@ + @@ -14,9 +15,8 @@ - - - - + + + \ No newline at end of file diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml index 3340f9503..faf519718 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml @@ -7,6 +7,7 @@ + @@ -14,9 +15,7 @@ - - - - - + + + \ No newline at end of file