IN PROGRESS - issue BATCH-340: Refactor JobRepository for greater clarity and consistency.
http://jira.springframework.org/browse/BATCH-340 JobInstance now has not-null Job as required constructor argument - repository no longer requires a separate Job setter
This commit is contained in:
@@ -93,7 +93,7 @@ public class JobExecutionTests extends TestCase {
|
||||
*/
|
||||
public void testGetJobId() {
|
||||
assertEquals(11, execution.getJobId().longValue());
|
||||
execution = new JobExecution(new JobInstance(new Long(23), new JobParameters()), null);
|
||||
execution = new JobExecution(new JobInstance(new Long(23), new JobParameters(), new JobSupport("testJob")), null);
|
||||
assertEquals(23, execution.getJobId().longValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@ public class JobInstanceTests extends TestCase {
|
||||
|
||||
public void testGetJob(){
|
||||
assertEquals("job", instance.getJob().getName());
|
||||
instance.setJob(null);
|
||||
assertEquals(null, instance.getJob());
|
||||
}
|
||||
|
||||
public void testCreateJobExecution(){
|
||||
@@ -62,8 +60,15 @@ public class JobInstanceTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testCreateWithNulls(){
|
||||
instance = new JobInstance(null, null);
|
||||
assertEquals(null, instance.getJobName());
|
||||
try {
|
||||
new JobInstance(null, null, null);
|
||||
fail("job instance can't exist without job specified");
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
// expected
|
||||
}
|
||||
instance = new JobInstance(null, null, new JobSupport("testJob"));
|
||||
assertEquals("testJob", instance.getJobName());
|
||||
assertEquals(0, instance.getJobParameters().getParameters().size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class StepExecutionTests extends TestCase {
|
||||
}
|
||||
|
||||
private StepExecution newStepExecution(String stepName, Long long2) {
|
||||
JobInstance job = new JobInstance(new Long(3), new JobParameters());
|
||||
JobInstance job = new JobInstance(new Long(3), new JobParameters(), new JobSupport("testJob"));
|
||||
StepExecution execution = new StepExecution(stepName, new JobExecution(job, long2), new Long(4));
|
||||
return execution;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user