IN PROGRESS - issue BATCH-340: Refactor JobRepository for greater clarity and consistency.
http://jira.springframework.org/browse/BATCH-340 removed redundant stepNames property from JobInstance (StepInstance heritage)
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,8 +29,6 @@ import java.util.List;
|
||||
*/
|
||||
public class JobInstance extends Entity {
|
||||
|
||||
private List stepNames = new ArrayList();
|
||||
|
||||
private JobParameters jobParameters;
|
||||
|
||||
private Job job;
|
||||
@@ -58,18 +54,6 @@ public class JobInstance extends Entity {
|
||||
public JobExecution getLastExecution() {
|
||||
return lastExecution;
|
||||
}
|
||||
|
||||
public List getStepNames() {
|
||||
return stepNames;
|
||||
}
|
||||
|
||||
public void setStepNames(List stepInstances) {
|
||||
this.stepNames = stepInstances;
|
||||
}
|
||||
|
||||
public void addStepName(String stepName) {
|
||||
this.stepNames.add(stepName);
|
||||
}
|
||||
|
||||
public int getJobExecutionCount() {
|
||||
return jobExecutionCount;
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
@@ -34,23 +32,6 @@ public class JobInstanceTests extends TestCase {
|
||||
assertEquals(lastExecution, instance.getLastExecution());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#getStepNames()}.
|
||||
*/
|
||||
public void testGetSteps() {
|
||||
assertEquals(0, instance.getStepNames().size());
|
||||
instance.setStepNames(Collections.singletonList(""));
|
||||
assertEquals(1, instance.getStepNames().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#addStepName(org.springframework.batch.core.domain.StepInstance)}.
|
||||
*/
|
||||
public void testAddStep() {
|
||||
instance.addStepName("");
|
||||
assertEquals(1, instance.getStepNames().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.JobInstance#getJobExecutionCount()}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user