BATCH-2146: Renamed JSR specific artifacts to be prefixed so they are easily identifiable
This commit is contained in:
committed by
Chris Schaefer
parent
f093dc01de
commit
7eabb5e040
@@ -39,15 +39,15 @@ import org.springframework.beans.factory.FactoryBeanNotInitializedException;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
|
||||
public class JobContextFactoryBeanTests {
|
||||
public class JsrJobContextFactoryBeanTests {
|
||||
|
||||
private JobContextFactoryBean factoryBean;
|
||||
private JsrJobContextFactoryBean factoryBean;
|
||||
private BatchPropertyContext propertyContext;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
propertyContext = new BatchPropertyContext();
|
||||
factoryBean = new JobContextFactoryBean();
|
||||
factoryBean = new JsrJobContextFactoryBean();
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -32,9 +32,9 @@ import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.JobParametersBuilder;
|
||||
|
||||
public class JobContextTests {
|
||||
public class JsrJobContextTests {
|
||||
|
||||
private JobContext context;
|
||||
private JsrJobContext context;
|
||||
@Mock
|
||||
private JobExecution execution;
|
||||
@Mock
|
||||
@@ -47,7 +47,7 @@ public class JobContextTests {
|
||||
Properties properties = new Properties();
|
||||
properties.put("jobLevelProperty1", "jobLevelValue1");
|
||||
|
||||
context = new JobContext();
|
||||
context = new JsrJobContext();
|
||||
context.setProperties(properties);
|
||||
context.setJobExecution(execution);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class JobContextTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testCreateWithNull() {
|
||||
context = new JobContext();
|
||||
context = new JsrJobContext();
|
||||
context.setJobExecution(null);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.JobParametersBuilder;
|
||||
import org.springframework.batch.core.converter.JobParametersConverterSupport;
|
||||
|
||||
public class JobExecutionTests {
|
||||
public class JsrJobExecutionTests {
|
||||
|
||||
private JobExecution adapter;
|
||||
private JsrJobExecution adapter;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
@@ -36,12 +36,12 @@ public class JobExecutionTests {
|
||||
execution.setStatus(BatchStatus.FAILED);
|
||||
execution.setVersion(21);
|
||||
|
||||
adapter = new JobExecution(execution, new JobParametersConverterSupport());
|
||||
adapter = new JsrJobExecution(execution, new JobParametersConverterSupport());
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testCreateWithNull() {
|
||||
adapter = new JobExecution(null, new JobParametersConverterSupport());
|
||||
adapter = new JsrJobExecution(null, new JobParametersConverterSupport());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -28,9 +28,9 @@ import org.springframework.beans.factory.FactoryBeanNotInitializedException;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
|
||||
public class StepContextFactoryBeanTests {
|
||||
public class JsrStepContextFactoryBeanTests {
|
||||
|
||||
private StepContextFactoryBean factory;
|
||||
private JsrStepContextFactoryBean factory;
|
||||
@Mock
|
||||
private BatchPropertyContext propertyContext;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class StepContextFactoryBeanTests {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
factory = new StepContextFactoryBean();
|
||||
factory = new JsrStepContextFactoryBean();
|
||||
factory.setBatchPropertyContext(propertyContext);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import static org.junit.Assert.fail;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.batch.runtime.Metric;
|
||||
import javax.batch.runtime.context.StepContext;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -35,12 +36,12 @@ import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.util.ExecutionContextUserSupport;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
public class StepContextTests {
|
||||
public class JsrStepContextTests {
|
||||
|
||||
private StepExecution stepExecution;
|
||||
private StepContext stepContext;
|
||||
private ExecutionContext executionContext;
|
||||
private ExecutionContextUserSupport executionContextUserSupport = new ExecutionContextUserSupport(ClassUtils.getShortName(StepContext.class));
|
||||
private ExecutionContextUserSupport executionContextUserSupport = new ExecutionContextUserSupport(ClassUtils.getShortName(JsrStepContext.class));
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
@@ -64,7 +65,7 @@ public class StepContextTests {
|
||||
Properties properties = new Properties();
|
||||
properties.put("key", "value");
|
||||
|
||||
stepContext = new StepContext(stepExecution, properties);
|
||||
stepContext = new JsrStepContext(stepExecution, properties);
|
||||
stepContext.setTransientUserData("This is my transient data");
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.item.util.ExecutionContextUserSupport;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
public class StepExecutionTests {
|
||||
public class JsrStepExecutionTests {
|
||||
|
||||
private StepExecution stepExecution;
|
||||
private javax.batch.runtime.StepExecution jsrStepExecution;
|
||||
//The API that sets the persisted user data is on the StepContext so the key within the ExecutionContext is StepContext
|
||||
private ExecutionContextUserSupport executionContextUserSupport = new ExecutionContextUserSupport(ClassUtils.getShortName(StepContext.class));
|
||||
//The API that sets the persisted user data is on the JsrStepContext so the key within the ExecutionContext is JsrStepContext
|
||||
private ExecutionContextUserSupport executionContextUserSupport = new ExecutionContextUserSupport(ClassUtils.getShortName(JsrStepContext.class));
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
@@ -45,12 +45,12 @@ public class StepExecutionTests {
|
||||
stepExecution.setEndTime(new Date(10000000));
|
||||
stepExecution.getExecutionContext().put(executionContextUserSupport.getKey("batch_jsr_persistentUserData"), "persisted data");
|
||||
|
||||
jsrStepExecution = new org.springframework.batch.core.jsr.StepExecution(stepExecution);
|
||||
jsrStepExecution = new JsrStepExecution(stepExecution);
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testWithNullStepExecution() {
|
||||
new org.springframework.batch.core.jsr.StepExecution(null);
|
||||
new JsrStepExecution(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class DecisionParsingTests {
|
||||
public class JsrDecisionParsingTests {
|
||||
|
||||
@Autowired
|
||||
public Job job;
|
||||
@@ -39,14 +39,14 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
|
||||
public class SplitParsingTests {
|
||||
public class JsrSplitParsingTests {
|
||||
|
||||
@Rule
|
||||
public ExpectedException expectedException = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
javax.batch.runtime.JobExecution execution = runJob("SplitParsingTests-context", null, 10000l);
|
||||
javax.batch.runtime.JobExecution execution = runJob("JsrSplitParsingTests-context", null, 10000l);
|
||||
assertEquals(javax.batch.runtime.BatchStatus.COMPLETED, execution.getBatchStatus());
|
||||
assertEquals("COMPLETED", execution.getExitStatus());
|
||||
|
||||
@@ -70,7 +70,7 @@ public class SplitParsingTests {
|
||||
public void testUserSpecifiedTaskExecutor() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/org/springframework/batch/core/jsr/configuration/xml/user-specified-split-task-executor-context.xml");
|
||||
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) context.getBeanFactory();
|
||||
PropertyValue propertyValue = new SplitParser(null).getSplitTaskExecutorPropertyValue(registry);
|
||||
PropertyValue propertyValue = new JsrSplitParser(null).getSplitTaskExecutorPropertyValue(registry);
|
||||
|
||||
RuntimeBeanReference runtimeBeanReferenceValue = (RuntimeBeanReference) propertyValue.getValue();
|
||||
|
||||
@@ -82,7 +82,7 @@ public class SplitParsingTests {
|
||||
public void testDefaultTaskExecutor() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/org/springframework/batch/core/jsr/configuration/xml/default-split-task-executor-context.xml");
|
||||
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) context.getBeanFactory();
|
||||
PropertyValue propertyValue = new SplitParser(null).getSplitTaskExecutorPropertyValue(registry);
|
||||
PropertyValue propertyValue = new JsrSplitParser(null).getSplitTaskExecutorPropertyValue(registry);
|
||||
Assert.assertTrue("Task executor not an instance of SimpleAsyncTaskExecutor" , (propertyValue.getValue() instanceof SimpleAsyncTaskExecutor));
|
||||
context.close();
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class ListenerParserTests {
|
||||
|
||||
applicationContext.registerBeanDefinition("jobListener", newBeanDefinition);
|
||||
|
||||
ListenerParser listenerParser = new ListenerParser(JobListenerFactoryBean.class, "jobExecutionListeners");
|
||||
ListenerParser listenerParser = new ListenerParser(JsrJobListenerFactoryBean.class, "jobExecutionListeners");
|
||||
listenerParser.applyListenerScope("jobListener", applicationContext);
|
||||
|
||||
BeanDefinition beanDefinition = applicationContext.getBeanDefinition("jobListener");
|
||||
|
||||
@@ -52,7 +52,8 @@ import org.springframework.batch.core.job.flow.support.state.EndState;
|
||||
import org.springframework.batch.core.job.flow.support.state.FlowState;
|
||||
import org.springframework.batch.core.job.flow.support.state.SplitState;
|
||||
import org.springframework.batch.core.job.flow.support.state.StepState;
|
||||
import org.springframework.batch.core.jsr.job.flow.support.DefaultFlow;
|
||||
import org.springframework.batch.core.jsr.JsrStepExecution;
|
||||
import org.springframework.batch.core.jsr.job.flow.support.JsrFlow;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.dao.JobExecutionDao;
|
||||
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
|
||||
@@ -94,7 +95,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetSteps() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0"));
|
||||
@@ -108,7 +109,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testTwoSteps() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
StepState step2 = new StepState(new StubStep("step2"));
|
||||
@@ -127,7 +128,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testFailedStep() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StateSupport("step1", FlowExecutionStatus.FAILED),
|
||||
"step2"));
|
||||
@@ -148,7 +149,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testFailedStepRestarted() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
State step2State = new StateSupport("step2") {
|
||||
@@ -186,7 +187,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testStoppingStep() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
State state2 = new StateSupport("step2", FlowExecutionStatus.FAILED);
|
||||
@@ -207,7 +208,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testInterrupted() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
|
||||
@Override
|
||||
@@ -230,7 +231,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testUnknownStatusStopsJob() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
|
||||
@Override
|
||||
@@ -255,9 +256,9 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testInterruptedSplit() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow1 = new DefaultFlow("flow1");
|
||||
SimpleFlow flow2 = new DefaultFlow("flow2");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
SimpleFlow flow1 = new JsrFlow("flow1");
|
||||
SimpleFlow flow2 = new JsrFlow("flow2");
|
||||
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
|
||||
@@ -301,7 +302,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testInterruptedException() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
|
||||
@Override
|
||||
@@ -323,9 +324,9 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testInterruptedSplitException() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow1 = new DefaultFlow("flow1");
|
||||
SimpleFlow flow2 = new DefaultFlow("flow2");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
SimpleFlow flow1 = new JsrFlow("flow1");
|
||||
SimpleFlow flow2 = new JsrFlow("flow2");
|
||||
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
|
||||
@@ -358,7 +359,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testEndStateStopped() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end"));
|
||||
transitions.add(StateTransition
|
||||
@@ -377,7 +378,7 @@ public class JsrFlowJobTests {
|
||||
}
|
||||
|
||||
public void testEndStateFailed() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end"));
|
||||
transitions
|
||||
@@ -398,7 +399,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testEndStateStoppedWithRestart() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end"));
|
||||
transitions.add(StateTransition
|
||||
@@ -426,7 +427,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testBranching() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
StepState step1 = new StepState(new StubStep("step1"));
|
||||
transitions.add(StateTransition.createStateTransition(step1, "step2"));
|
||||
@@ -452,7 +453,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testBasicFlow() throws Throwable {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step")), "end0"));
|
||||
transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
|
||||
@@ -468,7 +469,7 @@ public class JsrFlowJobTests {
|
||||
@Test
|
||||
public void testDecisionFlow() throws Throwable {
|
||||
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
Decider decider = new Decider() {
|
||||
|
||||
@Override
|
||||
@@ -512,7 +513,7 @@ public class JsrFlowJobTests {
|
||||
@Test
|
||||
public void testDecisionFlowWithExceptionInDecider() throws Throwable {
|
||||
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
JobExecutionDecider decider = new JobExecutionDecider() {
|
||||
@Override
|
||||
public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) {
|
||||
@@ -555,7 +556,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepExists() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0"));
|
||||
@@ -572,7 +573,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepExistsWithPrefix() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState("job.step", new StubStep("step")), "end0"));
|
||||
transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
|
||||
@@ -589,7 +590,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepNamesWithPrefix() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState("job.step", new StubStep("step")), "end0"));
|
||||
transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
|
||||
@@ -604,7 +605,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepNotExists() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0"));
|
||||
@@ -620,7 +621,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepNotStepState() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0"));
|
||||
@@ -636,14 +637,14 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepNestedFlow() throws Exception {
|
||||
SimpleFlow nested = new DefaultFlow("nested");
|
||||
SimpleFlow nested = new JsrFlow("nested");
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end1"));
|
||||
transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
|
||||
nested.setStateTransitions(transitions);
|
||||
nested.afterPropertiesSet();
|
||||
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "nested"));
|
||||
transitions.add(StateTransition.createStateTransition(new FlowState(nested, "nested"), "end0"));
|
||||
@@ -660,9 +661,9 @@ public class JsrFlowJobTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepSplitFlow() throws Exception {
|
||||
SimpleFlow flow = new DefaultFlow("job");
|
||||
SimpleFlow flow1 = new DefaultFlow("flow1");
|
||||
SimpleFlow flow2 = new DefaultFlow("flow2");
|
||||
SimpleFlow flow = new JsrFlow("job");
|
||||
SimpleFlow flow1 = new JsrFlow("flow1");
|
||||
SimpleFlow flow2 = new JsrFlow("flow2");
|
||||
|
||||
List<StateTransition> transitions = new ArrayList<StateTransition>();
|
||||
transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end0"));
|
||||
@@ -725,7 +726,7 @@ public class JsrFlowJobTests {
|
||||
public void execute(StepExecution stepExecution) throws JobInterruptedException {
|
||||
stepExecution.setStatus(BatchStatus.COMPLETED);
|
||||
try {
|
||||
stepExecution.setExitStatus(new ExitStatus(decider.decide(new javax.batch.runtime.StepExecution [] {new org.springframework.batch.core.jsr.StepExecution(stepExecution)})));
|
||||
stepExecution.setExitStatus(new ExitStatus(decider.decide(new javax.batch.runtime.StepExecution [] {new JsrStepExecution(stepExecution)})));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -31,12 +31,12 @@ import org.springframework.batch.core.job.flow.support.JobFlowExecutorSupport;
|
||||
import org.springframework.batch.core.job.flow.support.SimpleFlowTests;
|
||||
import org.springframework.batch.core.job.flow.support.StateTransition;
|
||||
|
||||
public class DefaultFlowTests extends SimpleFlowTests {
|
||||
public class JsrFlowTests extends SimpleFlowTests {
|
||||
|
||||
@Override
|
||||
@Before
|
||||
public void setUp() {
|
||||
flow = new DefaultFlow("flow1");
|
||||
flow = new JsrFlow("flow1");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -26,11 +26,11 @@ import org.junit.Test;
|
||||
import org.springframework.batch.core.jsr.JsrTestUtils;
|
||||
|
||||
/**
|
||||
* Tests for the JSR-352 version of {@link EndState}
|
||||
* Tests for the JSR-352 version of {@link JsrEndState}
|
||||
*
|
||||
* @author Michael Minella
|
||||
*/
|
||||
public class EndStateTests {
|
||||
public class JsrEndStateTests {
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
Reference in New Issue
Block a user