BATCH-295: JobLauncher now only contains one method: run(Job, JobInstanceProperties). Misc. other changes were made to facilitate.
This commit is contained in:
@@ -28,9 +28,9 @@ import org.springframework.batch.repeat.ExitStatus;
|
||||
*/
|
||||
public class JobExecutionTests extends TestCase {
|
||||
|
||||
private JobExecution execution = new JobExecution(new JobInstance(null, new Long(11), null));
|
||||
private JobExecution execution = new JobExecution(new JobInstance(new Long(11), new JobInstanceProperties()), new Long(12));
|
||||
|
||||
private JobExecution context = new JobExecution(new JobInstance(new SimpleJobIdentifier("foo"), new Long(11), null));
|
||||
private JobExecution context = new JobExecution(new JobInstance(new Long(11), new JobInstanceProperties(), new Job("foo")), new Long(12));
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
@@ -86,7 +86,7 @@ public class JobExecutionTests extends TestCase {
|
||||
*/
|
||||
public void testGetJobId() {
|
||||
assertEquals(11, execution.getJobId().longValue());
|
||||
execution = new JobExecution(new JobInstance(null, new Long(23), null));
|
||||
execution = new JobExecution(new JobInstance(new Long(23), new JobInstanceProperties()), null);
|
||||
assertEquals(23, execution.getJobId().longValue());
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class JobExecutionTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testContextContainsInfo() throws Exception {
|
||||
assertEquals("foo", context.getJobInstance().getIdentifier().getName());
|
||||
assertEquals("foo", context.getJobInstance().getJobName());
|
||||
}
|
||||
|
||||
public void testAddAndRemoveStepExecution() throws Exception {
|
||||
|
||||
@@ -28,15 +28,8 @@ import junit.framework.TestCase;
|
||||
*/
|
||||
public class JobInstanceTests extends TestCase {
|
||||
|
||||
private JobInstance instance = new JobInstance(null, new Long(11), new Job("job"));
|
||||
private JobInstance instance = new JobInstance(new Long(11), new JobInstanceProperties(), new Job("job"));
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#JobInstance()}.
|
||||
*/
|
||||
public void testJobInstance() {
|
||||
assertNull(new JobInstance(null, null, null).getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#getStatus()}.
|
||||
*/
|
||||
@@ -71,23 +64,13 @@ public class JobInstanceTests extends TestCase {
|
||||
instance.setJobExecutionCount(22);
|
||||
assertEquals(22, instance.getJobExecutionCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#getIdentifier()}.
|
||||
*/
|
||||
public void testGetIdentifier() {
|
||||
assertEquals(null, instance.getIdentifier());
|
||||
instance = new JobInstance(new SimpleJobIdentifier("foo"), new Long(1));
|
||||
assertEquals("foo", instance.getIdentifier().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#getIdentifier()}.
|
||||
*/
|
||||
public void testGetName() {
|
||||
assertEquals(null, instance.getName());
|
||||
instance = new JobInstance(new SimpleJobIdentifier("foo"), new Long(1));
|
||||
assertEquals("foo", instance.getName());
|
||||
instance = new JobInstance(new Long(1), new JobInstanceProperties(), new Job("foo"));
|
||||
assertEquals("foo", instance.getJobName());
|
||||
}
|
||||
|
||||
public void testGetJob(){
|
||||
|
||||
@@ -212,9 +212,9 @@ public class StepExecutionTests extends TestCase {
|
||||
}
|
||||
|
||||
private StepExecution newStepExecution(Long long1, Long long2) {
|
||||
JobInstance job = new JobInstance(null, null);
|
||||
JobInstance job = new JobInstance(new Long(3), new JobInstanceProperties());
|
||||
StepInstance step = new StepInstance(job, "foo", long1);
|
||||
StepExecution execution = new StepExecution(step, new JobExecution(job, long2));
|
||||
StepExecution execution = new StepExecution(step, new JobExecution(job, long2), new Long(4));
|
||||
return execution;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class StepInstanceTests extends TestCase {
|
||||
*/
|
||||
public void testGetJobInstance() {
|
||||
assertEquals(null, instance.getJobInstance());
|
||||
JobInstance jobInstance = new JobInstance(null, null);
|
||||
JobInstance jobInstance = new JobInstance(new Long(1), new JobInstanceProperties());
|
||||
instance = new StepInstance(jobInstance, null);
|
||||
assertEquals(jobInstance, instance.getJobInstance());
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class StepInstanceTests extends TestCase {
|
||||
public void testGetJob(){
|
||||
|
||||
Job job = new Job("job");
|
||||
JobInstance jobInstance = new JobInstance(null, null, job);
|
||||
JobInstance jobInstance = new JobInstance(new Long(2), new JobInstanceProperties(), job);
|
||||
instance = new StepInstance(jobInstance, null);
|
||||
assertEquals(job, instance.getJobInstance().getJob());
|
||||
}
|
||||
@@ -98,12 +98,12 @@ public class StepInstanceTests extends TestCase {
|
||||
*/
|
||||
public void testGetJobId() {
|
||||
assertEquals(null, instance.getJobId());
|
||||
instance = new StepInstance(new JobInstance(null, new Long(23), null), null);
|
||||
instance = new StepInstance(new JobInstance(new Long(23), new JobInstanceProperties()), null);
|
||||
assertEquals(23, instance.getJobId().longValue());
|
||||
}
|
||||
|
||||
public void testEqualsWithSameIdentifier() throws Exception {
|
||||
JobInstance job = new JobInstance(null, new Long(100), null);
|
||||
JobInstance job = new JobInstance(new Long(100), new JobInstanceProperties());
|
||||
StepInstance step1 = new StepInstance(job, "foo", new Long(0));
|
||||
StepInstance step2 = new StepInstance(job, "foo", new Long(0));
|
||||
assertEquals(step1, step2);
|
||||
|
||||
Reference in New Issue
Block a user