BATCH-1582: remove restrictio non step execution aggregator

This commit is contained in:
dsyer
2010-06-24 09:32:04 +00:00
parent c34efd470d
commit d794a62ac2
2 changed files with 4 additions and 4 deletions

View File

@@ -45,8 +45,8 @@ public class DefaultStepExecutionAggregator implements StepExecutionAggregator {
*/
public void aggregate(StepExecution result, Collection<StepExecution> executions) {
Assert.notNull(result, "To aggregate into a result it must be non-null.");
if (executions == null || executions.isEmpty()) {
throw new IllegalArgumentException("Cannot aggregate empty or null executions: " + executions);
if (executions == null) {
return;
}
for (StepExecution stepExecution : executions) {
BatchStatus status = stepExecution.getStatus();

View File

@@ -24,12 +24,12 @@ public class DefaultStepExecutionAggregatorTests {
private StepExecution stepExecution2 = jobExecution.createStepExecution("foo:2");
@Test(expected = IllegalArgumentException.class)
@Test
public void testAggregateEmpty() {
aggregator.aggregate(result, Collections.<StepExecution> emptySet());
}
@Test(expected = IllegalArgumentException.class)
@Test
public void testAggregateNull() {
aggregator.aggregate(result, null);
}