IN PROGRESS - issue BATCH-340: Refactor JobRepository for greater clarity and consistency.

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

more StepInstance heritage cleaned up - StepExecution refers to Step rather than stepName string
This commit is contained in:
robokaso
2008-02-25 17:21:46 +00:00
parent 59f884b832
commit 7368aa3541
25 changed files with 162 additions and 139 deletions

View File

@@ -5,6 +5,7 @@ import org.springframework.batch.core.domain.JobInstance;
import org.springframework.batch.core.domain.JobParameters;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.domain.StepExecution;
import org.springframework.batch.core.domain.StepSupport;
import org.springframework.batch.execution.scope.SimpleStepContext;
import org.springframework.batch.execution.scope.StepContext;
import org.springframework.batch.execution.scope.StepSynchronizationManager;
@@ -36,7 +37,7 @@ public class StagingItemReaderTests extends AbstractTransactionalDataSourceSprin
}
protected void prepareTestInstance() throws Exception {
StepContext stepScopeContext = new SimpleStepContext(new StepExecution("stepName",
StepContext stepScopeContext = new SimpleStepContext(new StepExecution(new StepSupport("stepName"),
new JobExecution(new JobInstance(jobId, new JobParameters(), new JobSupport("testJob")))));
StepSynchronizationManager.register(stepScopeContext);
RepeatSynchronizationManager.register(new RepeatContextSupport(null));

View File

@@ -5,6 +5,7 @@ import org.springframework.batch.core.domain.JobInstance;
import org.springframework.batch.core.domain.JobParameters;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.domain.StepExecution;
import org.springframework.batch.core.domain.StepSupport;
import org.springframework.batch.execution.scope.SimpleStepContext;
import org.springframework.batch.execution.scope.StepSynchronizationManager;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
@@ -24,7 +25,7 @@ public class StagingItemProcessorTests extends AbstractTransactionalDataSourceSp
}
protected void prepareTestInstance() throws Exception {
SimpleStepContext stepScopeContext = new SimpleStepContext(new StepExecution("stepName",
SimpleStepContext stepScopeContext = new SimpleStepContext(new StepExecution(new StepSupport("stepName"),
new JobExecution(new JobInstance(new Long(12), new JobParameters(), new JobSupport("job")))));
StepSynchronizationManager.register(stepScopeContext);
super.prepareTestInstance();