RESOLVED - issue BATCH-1541, BATCH-1542: Thread safety for map daos
This commit is contained in:
@@ -136,7 +136,7 @@ public class FlowJobTests {
|
||||
@Override
|
||||
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
|
||||
JobExecution jobExecution = executor.getJobExecution();
|
||||
jobExecution.getStepExecutions().add(new StepExecution(getName(), jobExecution));
|
||||
jobExecution.createStepExecution(getName());
|
||||
if (fail) {
|
||||
return FlowExecutionStatus.FAILED;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package org.springframework.batch.core.job.flow;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.job.flow.support.state.AbstractState;
|
||||
|
||||
/**
|
||||
@@ -42,7 +41,7 @@ public class StateSupport extends AbstractState {
|
||||
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
|
||||
JobExecution jobExecution = executor.getJobExecution();
|
||||
if (jobExecution != null) {
|
||||
jobExecution.getStepExecutions().add(new StepExecution(getName(), jobExecution));
|
||||
jobExecution.createStepExecution(getName());
|
||||
}
|
||||
return this.status;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
@@ -23,13 +23,15 @@ public class SimpleStepExecutionSplitterTests {
|
||||
|
||||
private JobRepository jobRepository;
|
||||
|
||||
private StepExecution stepExecution = new StepExecution("bar", new JobExecution(11L));
|
||||
private StepExecution stepExecution;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
step = new TaskletStep("step");
|
||||
MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean();
|
||||
jobRepository = (JobRepository) factory.getObject();
|
||||
stepExecution = jobRepository.createJobExecution("job", new JobParameters()).createStepExecution("bar");
|
||||
jobRepository.add(stepExecution);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MapExecutionContextDaoTests extends AbstractExecutionContextDaoTest
|
||||
public void testPersistentCopy() throws Exception {
|
||||
MapExecutionContextDao tested = new MapExecutionContextDao();
|
||||
JobExecution jobExecution = new JobExecution((long)1);
|
||||
StepExecution stepExecution = new StepExecution("stepName", jobExecution);
|
||||
StepExecution stepExecution = new StepExecution("stepName", jobExecution, 123L);
|
||||
assertTrue(stepExecution.getExecutionContext().isEmpty());
|
||||
|
||||
tested.updateExecutionContext(stepExecution);
|
||||
|
||||
Reference in New Issue
Block a user