IN PROGRESS - issue BATCH-366: Do we still need StepInstance?

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

Killed StepInstance - test coverage temporarily low due to commenting obsolete tests (but sample jobs work fine).
This commit is contained in:
robokaso
2008-02-19 15:41:26 +00:00
parent d7b9cf9d92
commit 96c48bcbc5
54 changed files with 665 additions and 1321 deletions

View File

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

View File

@@ -1,14 +1,12 @@
package org.springframework.batch.sample.item.writer;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.domain.JobExecution;
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.StepInstance;
import org.springframework.batch.execution.scope.SimpleStepContext;
import org.springframework.batch.execution.scope.StepSynchronizationManager;
import org.springframework.batch.sample.item.writer.StagingItemWriter;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
import org.springframework.util.ClassUtils;
@@ -26,7 +24,7 @@ public class StagingItemProcessorTests extends AbstractTransactionalDataSourceSp
}
protected void prepareTestInstance() throws Exception {
SimpleStepContext stepScopeContext = new SimpleStepContext(new StepExecution(new StepInstance(new Long(11)),
SimpleStepContext stepScopeContext = new SimpleStepContext(new StepExecution("stepName",
new JobExecution(new JobInstance(new Long(12), new JobParameters(), new JobSupport("job")))));
StepSynchronizationManager.register(stepScopeContext);
super.prepareTestInstance();