RESOLVED - issue BATCH-1171: Interrupted step does not fail job.

Added check for STOPPED status in AbstractJob.
This commit is contained in:
dsyer
2009-03-23 10:52:55 +00:00
parent 6b1e440a67
commit 56de18f884
7 changed files with 213 additions and 27 deletions

View File

@@ -7,6 +7,7 @@
<property name="dataSource" ref="dataSource"/>
<property name="initScripts">
<list>
<value>${batch.drop.script}</value>
<value>${batch.schema.script}</value>
<value>${batch.business.schema.script}</value>
</list>

View File

@@ -16,6 +16,7 @@
package org.springframework.batch.sample.launch;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -83,7 +84,7 @@ public class RemoteLauncherTests {
assertTrue(launcher.getJobNames().contains("loopJob"));
}
//@Test
@Test
public void testPauseJob() throws Exception {
final int SLEEP_INTERVAL = 600;
assertTrue(isConnected());
@@ -100,18 +101,19 @@ public class RemoteLauncherTests {
// assertEquals(0, launcher.getRunningExecutions("loopJob").size());
logger.debug(launcher.getSummary(executionId));
long resumedId = launcher.restart(executionId);
assertEquals("Picked up the same execution after pause and resume", executionId, resumedId);
assertNotSame("Picked up the same execution after pause and resume", executionId, resumedId);
Thread.sleep(SLEEP_INTERVAL);
launcher.stop(executionId);
launcher.stop(resumedId);
Thread.sleep(SLEEP_INTERVAL);
// assertEquals(0, launcher.getRunningExecutions("loopJob").size());
logger.debug(launcher.getSummary(executionId));
long resumeId2 = launcher.restart(executionId);
assertEquals("Picked up the same execution after pause and resume", executionId, resumeId2);
logger.debug(launcher.getSummary(resumedId));
long resumeId2 = launcher.restart(resumedId);
assertNotSame("Picked up the same execution after pause and resume", executionId, resumeId2);
launcher.stop(executionId);
Thread.sleep(SLEEP_INTERVAL);
launcher.stop(resumeId2);
}