RESOLVED - issue BATCH-241: Support for JobLauncher.stop() on job that hasn't started yet (delayed execution)

http://jira.springframework.org/browse/BATCH-241

Since SimpleJobLauncher no longer has a stop method, we have to do the check on execution, lower down the stack.  Added explicit check for STOPPED status in SimpleJob and JoBExecution.
This commit is contained in:
dsyer
2008-02-11 19:54:21 +00:00
parent 2ce3013ac1
commit 2b87124b85
25 changed files with 140 additions and 116 deletions

View File

@@ -57,6 +57,16 @@ public class JobExecutionTests extends TestCase {
assertFalse(execution.isRunning());
}
/**
* Test method for
* {@link org.springframework.batch.core.domain.JobExecution#getEndTime()}.
*/
public void testIsRunningWithStoppedExecution() {
assertTrue(execution.isRunning());
execution.stop();
assertFalse(execution.isRunning());
}
/**
* Test method for
* {@link org.springframework.batch.core.domain.JobExecution#getStartTime()}.

View File

@@ -16,19 +16,19 @@
package org.springframework.batch.core.domain;
import org.springframework.batch.core.AbstractExceptionTests;
import org.springframework.batch.core.domain.StepInterruptedException;
import org.springframework.batch.core.domain.JobInterruptedException;
/**
* @author Dave Syer
*
*/
public class StepInterruptedExceptionTests extends AbstractExceptionTests {
public class JobInterruptedExceptionTests extends AbstractExceptionTests {
/* (non-Javadoc)
* @see org.springframework.batch.io.exception.AbstractExceptionTests#getException(java.lang.String)
*/
public Exception getException(String msg) throws Exception {
return new StepInterruptedException(msg);
return new JobInterruptedException(msg);
}
/* (non-Javadoc)