IN PROGRESS - BATCH-858: Pause / resume of Job

used same tx isolation for getLastJobExecution(..) as for createJobExecution(..)

added simple functional test with JobOperator (same id returned after pause and resume)
This commit is contained in:
robokaso
2008-10-21 14:06:37 +00:00
parent b11be9d19d
commit 2d3c928fa3
2 changed files with 33 additions and 9 deletions

View File

@@ -83,6 +83,31 @@ public class RemoteLauncherTests {
assertTrue(launcher.getJobNames().contains("loopJob"));
}
@Test
public void testPauseJob() throws Exception {
final int SLEEP_INTERVAL = 500;
assertTrue(isConnected());
assertTrue(launcher.getJobNames().contains("loopJob"));
long executionId = launcher.start("loopJob", "");
// sleep long enough to avoid race conditions (serializable tx isolation
// doesn't work with HSQL)
Thread.sleep(SLEEP_INTERVAL);
launcher.pause(executionId);
Thread.sleep(SLEEP_INTERVAL);
long resumedId = launcher.resume(executionId);
assertEquals("Picked up the same execution after pause and resume", executionId, resumedId);
// launcher.pause(executionId);
// Thread.sleep(SLEEP_INTERVAL);
// long resumeId2 = launcher.resume(executionId);
// assertEquals("Picked up the same execution after pause and resume", executionId, resumeId2);
launcher.stop(executionId);
}
/*
* (non-Javadoc)
*