BATCH-1547: fix logic

This commit is contained in:
dsyer
2010-04-04 16:06:13 +00:00
parent 1a18a3dd73
commit e38764797b
2 changed files with 4 additions and 2 deletions

View File

@@ -54,11 +54,12 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
if (PatternMatcher.match(statusPattern, exitCode)) {
for (String key : keys) {
if (stepContext.containsKey(key)) {
jobContext.put(key, stepContext.get(key));
} else {
if (strict) {
throw new IllegalArgumentException("The key [" + key
+ "] was not found in the Step's ExecutionContext.");
}
jobContext.put(key, stepContext.get(key));
}
}
}
break;

View File

@@ -66,6 +66,7 @@ public class ExecutionContextPromotionListenerTests {
@Test
public void promoteEntryStatusFound() throws Exception {
ExecutionContextPromotionListener listener = new ExecutionContextPromotionListener();
listener.setStrict(true);
JobExecution jobExecution = new JobExecution(1L);
StepExecution stepExecution = jobExecution.createStepExecution("step1");