IN PROGRESS - issue BATCH-159: JobExecutor should return a JobExecution (which itself contains the ExitStatus)
http://opensource.atlassian.com/projects/spring/browse/BATCH-159 Merged JobLauncher implementations together and separated out thread interruption and JMX notification responsibilities to separate collaborators.
This commit is contained in:
@@ -149,4 +149,13 @@ public class ExitStatus implements Serializable {
|
||||
return new ExitStatus(continuable, code, exitDescription);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this status represents a running process.
|
||||
*
|
||||
* @return tru eif the exit code is "RUNNING" or "UNKNOWN"
|
||||
*/
|
||||
public boolean isRunning() {
|
||||
return "RUNNING".equals(this.exitCode) || "UNKNOWN".equals(this.exitCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -104,6 +104,15 @@ public class ExitStatusTests extends TestCase {
|
||||
assertEquals("Bar", status.getExitDescription());
|
||||
}
|
||||
|
||||
public void testRunningIsRunning() throws Exception {
|
||||
assertTrue(ExitStatus.RUNNING.isRunning());
|
||||
assertTrue(new ExitStatus(true, "RUNNING").isRunning());
|
||||
}
|
||||
|
||||
public void testUnkownIsRunning() throws Exception {
|
||||
assertTrue(ExitStatus.UNKNOWN.isRunning());
|
||||
}
|
||||
|
||||
public void testSerializable() throws Exception {
|
||||
ExitStatus status = ExitStatus.CONTINUABLE.addExitCode("FOO");
|
||||
byte[] bytes = SerializationUtils.serialize(status);
|
||||
|
||||
Reference in New Issue
Block a user