|
17 | 17 |
|
18 | 18 | import java.util.List;
|
19 | 19 | import java.util.Properties;
|
| 20 | + |
20 | 21 | import javax.batch.api.Decider;
|
21 | 22 | import javax.batch.runtime.BatchRuntime;
|
22 | 23 | import javax.batch.runtime.BatchStatus;
|
23 | 24 | import javax.batch.runtime.JobExecution;
|
24 | 25 | import javax.batch.runtime.StepExecution;
|
25 | 26 |
|
26 |
| -import org.junit.Before; |
27 | 27 | import org.junit.Test;
|
28 | 28 |
|
29 |
| -import org.springframework.batch.core.explore.JobExplorer; |
30 | 29 | import org.springframework.batch.core.jsr.AbstractJsrTestCase;
|
31 |
| -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; |
32 |
| -import org.springframework.context.ApplicationContext; |
33 |
| -import org.springframework.context.support.GenericXmlApplicationContext; |
34 | 30 | import org.springframework.test.util.ReflectionTestUtils;
|
35 | 31 | import org.springframework.util.Assert;
|
36 | 32 |
|
37 | 33 | import static org.junit.Assert.assertEquals;
|
38 | 34 |
|
39 | 35 | public class DecisionStepTests extends AbstractJsrTestCase {
|
40 | 36 |
|
41 |
| - private static ApplicationContext baseContext; |
42 |
| - |
43 |
| - private JobExplorer jobExplorer; |
44 |
| - |
45 |
| - @Before |
46 |
| - public void setUp() { |
47 |
| - StepExecutionCountingDecider.previousStepCount = 0; |
48 |
| - |
49 |
| - if(jobExplorer == null) { |
50 |
| - baseContext = new GenericXmlApplicationContext("jsrBaseContext.xml"); |
51 |
| - |
52 |
| - baseContext.getAutowireCapableBeanFactory().autowireBeanProperties(this, |
53 |
| - AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false); |
54 |
| - } |
55 |
| - } |
56 |
| - |
57 |
| - public void setJobExplorer(JobExplorer jobExplorer) { |
58 |
| - this.jobExplorer = jobExplorer; |
59 |
| - } |
60 |
| - |
61 | 37 | @Test
|
62 | 38 | public void testDecisionAsFirstStepOfJob() throws Exception {
|
63 | 39 | JobExecution execution = runJob("DecisionStepTests-decisionAsFirstStep-context", new Properties(), 10000L);
|
|
0 commit comments