RESOLVED - issue BATCH-1210: AbstractStep overwrites custom exit status for STOPPED steps

Tweaked exit status handling again in AbstractStep
This commit is contained in:
dsyer
2009-04-16 14:08:57 +00:00
parent d41bdbee62
commit 4de51829bb
2 changed files with 14 additions and 0 deletions

View File

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