Prevent NPE when checking for a re-runnable continued flow, remove usage of
state transition comparator in FlowParser, ensure custom exit code is set at job level. Fixes TCK test testDeciderExitStatusIsSetOnJobContext, contributes but does not fix decider transition tests that include restart.
This commit is contained in:
@@ -86,6 +86,19 @@ public class DecisionStepTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecisionCustomExitStatus() throws Exception {
|
||||
ApplicationContext context = new GenericXmlApplicationContext("classpath:/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionCustomExitStatus-context.xml");
|
||||
|
||||
JobLauncher launcher = context.getBean(JobLauncher.class);
|
||||
Job job = context.getBean(Job.class);
|
||||
|
||||
JobExecution execution = launcher.run(job, new JobParameters());
|
||||
assertEquals(BatchStatus.FAILED, execution.getStatus());
|
||||
assertEquals(2, execution.getStepExecutions().size());
|
||||
assertEquals("CustomFail", execution.getExitStatus().getExitCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Flows as first steps are not supported yet")
|
||||
public void testDecisionAfterFlow() throws Exception {
|
||||
@@ -108,6 +121,12 @@ public class DecisionStepTests {
|
||||
|
||||
@Override
|
||||
public String decide(StepExecution[] executions) throws Exception {
|
||||
for(StepExecution stepExecution : executions) {
|
||||
if ("customFailTest".equals(stepExecution.getStepName())) {
|
||||
return "CustomFail";
|
||||
}
|
||||
}
|
||||
|
||||
return "next";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user