BATCH-1344: JobRunnerTestUtils -> JobLauncherTestUtils
This commit is contained in:
@@ -65,7 +65,7 @@ import org.springframework.context.ApplicationContextAware;
|
||||
* @author Dan Garrette
|
||||
* @since 2.0
|
||||
*
|
||||
* @deprecated (from 2.1) use {@link JobRunnerTestUtils} instead
|
||||
* @deprecated (from 2.1) use {@link JobLauncherTestUtils} instead
|
||||
*/
|
||||
public abstract class AbstractJobTests implements ApplicationContextAware {
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ import org.springframework.context.ApplicationContext;
|
||||
* @author Dave Syer
|
||||
* @since 2.1
|
||||
*/
|
||||
public class JobRunnerTestUtils {
|
||||
public class JobLauncherTestUtils {
|
||||
|
||||
/** Logger */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
@@ -27,7 +27,7 @@ public abstract class AbstractSampleJobTests {
|
||||
private SimpleJdbcTemplate jdbcTemplate;
|
||||
|
||||
@Autowired
|
||||
private JobRunnerTestUtils jobRunnerUtils;
|
||||
private JobLauncherTestUtils jobLauncherTestUtils;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("tasklet2")
|
||||
@@ -51,25 +51,25 @@ public abstract class AbstractSampleJobTests {
|
||||
|
||||
@Test
|
||||
public void testJob() throws Exception {
|
||||
assertEquals(BatchStatus.COMPLETED, jobRunnerUtils.launchJob().getStatus());
|
||||
assertEquals(BatchStatus.COMPLETED, jobLauncherTestUtils.launchJob().getStatus());
|
||||
this.verifyTasklet(1);
|
||||
this.verifyTasklet(2);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testNonExistentStep() {
|
||||
jobRunnerUtils.launchStep("nonExistent");
|
||||
jobLauncherTestUtils.launchStep("nonExistent");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStep1Execution() {
|
||||
assertEquals(BatchStatus.COMPLETED, jobRunnerUtils.launchStep("step1").getStatus());
|
||||
assertEquals(BatchStatus.COMPLETED, jobLauncherTestUtils.launchStep("step1").getStatus());
|
||||
this.verifyTasklet(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStep2Execution() {
|
||||
assertEquals(BatchStatus.COMPLETED, jobRunnerUtils.launchStep("step2").getStatus());
|
||||
assertEquals(BatchStatus.COMPLETED, jobLauncherTestUtils.launchStep("step2").getStatus());
|
||||
this.verifyTasklet(2);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractSampleJobTests {
|
||||
public void testStepLaunchJobContextEntry() {
|
||||
ExecutionContext jobContext = new ExecutionContext();
|
||||
jobContext.put("key1", "value1");
|
||||
assertEquals(BatchStatus.COMPLETED, jobRunnerUtils.launchStep("step2", jobContext).getStatus());
|
||||
assertEquals(BatchStatus.COMPLETED, jobLauncherTestUtils.launchStep("step2", jobContext).getStatus());
|
||||
this.verifyTasklet(2);
|
||||
assertTrue(tasklet2.jobContextEntryFound);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
|
||||
|
||||
<context:annotation-config/>
|
||||
<bean class="org.springframework.batch.test.JobRunnerTestUtils"/>
|
||||
<bean class="org.springframework.batch.test.JobLauncherTestUtils"/>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user