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:
@@ -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()}.
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user