updated unit test to use top level <step/> element to define a step

This commit is contained in:
dhgarrette
2009-03-25 14:56:39 +00:00
parent 945c0d91df
commit 94c467e919
4 changed files with 16 additions and 21 deletions

View File

@@ -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());

View File

@@ -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());