RESOLVED - issue BATCH-1210: AbstractStep overwrites custom exit status for STOPPED steps
Tweaked exit status handling again in AbstractStep
This commit is contained in:
@@ -85,6 +85,19 @@ public class TaskletStepExceptionTests {
|
||||
assertEquals(STOPPED.toString(), stepExecution.getExitStatus().getExitCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterruptedWithCustomStatus() throws Exception {
|
||||
taskletStep.setTasklet(new Tasklet() {
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
contribution.setExitStatus(new ExitStatus("FUNNY"));
|
||||
throw new JobInterruptedException("Planned");
|
||||
}
|
||||
});
|
||||
taskletStep.execute(stepExecution);
|
||||
assertEquals(STOPPED, stepExecution.getStatus());
|
||||
assertEquals("FUNNY", stepExecution.getExitStatus().getExitCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpenFailure() throws Exception {
|
||||
final RuntimeException exception = new RuntimeException();
|
||||
|
||||
Reference in New Issue
Block a user