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:
dsyer
2007-11-05 12:51:08 +00:00
parent 9810bf7223
commit 90196b9bfe
3 changed files with 23 additions and 0 deletions

View File

@@ -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+"]";
}
}

View File

@@ -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+"]";
}
}

View File

@@ -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);
}
}