IN PROGRESS - issue BATCH-159: JobExecutor should return a JobExecution (which itself contains the ExitStatus)
http://opensource.atlassian.com/projects/spring/browse/BATCH-159 Change JobExecutorFacade interface - it makes more sense to stop an execution.
This commit is contained in:
@@ -227,4 +227,11 @@ public class JobExecution extends Entity {
|
||||
public void registerStepExecution(StepExecution stepExecution) {
|
||||
this.stepExecutions.add(stepExecution);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.core.domain.Entity#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return super.toString()+", job=["+job+"]";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,5 +100,12 @@ public class JobInstance extends Entity {
|
||||
public String getName() {
|
||||
return identifier==null ? null : identifier.getName();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.core.domain.Entity#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return super.toString()+", identifier=["+identifier+"]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -138,4 +138,13 @@ public class JobExecutionTests extends TestCase {
|
||||
assertEquals(0, context.getChunkContexts().size());
|
||||
}
|
||||
|
||||
public void testToString() throws Exception {
|
||||
assertTrue("JobExecution string does not contain id", context.toString().indexOf("id=")>=0);
|
||||
assertTrue("JobExecution string does not contain name: "+context, context.toString().indexOf("foo")>=0);
|
||||
}
|
||||
|
||||
public void testToStringWithNullJob() throws Exception {
|
||||
context = new JobExecution();
|
||||
assertTrue("JobExecution string does not contain id", context.toString().indexOf("id=")>=0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user