OPEN - issue BATCH-364: StepScope responsibilities can be assumed by Step (not ApplicationContext)

http://jira.springframework.org/browse/BATCH-364

Make StreamManager responsible for calling open() and close().
This commit is contained in:
dsyer
2008-02-15 13:44:36 +00:00
parent 66ddfa81f0
commit ec5379ebac
26 changed files with 460 additions and 420 deletions

View File

@@ -16,11 +16,14 @@
package org.springframework.batch.core.domain;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import junit.framework.TestCase;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.support.PropertiesConverter;
/**
* @author Dave Syer
@@ -260,6 +263,14 @@ public class StepExecutionTests extends TestCase {
.hashCode());
}
public void testHashCodeViaHashSet() throws Exception {
Set set = new HashSet();
set.add(execution);
assertTrue(set.contains(execution));
execution.setExecutionContext(new ExecutionContext(PropertiesConverter.stringToProperties("foo=bar")));
assertTrue(set.contains(execution));
}
private StepExecution newStepExecution(Long long1, Long long2) {
JobInstance job = new JobInstance(new Long(3), new JobParameters());
StepInstance step = new StepInstance(job, "foo", long1);