OPEN - issue BATCH-90: StepExecution and StepExecutionContext are parallel domains, and StepExecution is by comparison anaemic
http://opensource.atlassian.com/projects/spring/browse/BATCH-90 Remove setter for job id in JobExecution
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
&job-execution-generator;
|
||||
</id>
|
||||
<version name="version" access="field"/>
|
||||
<property name="jobId" type="long" update="false" column="JOB_ID" />
|
||||
<property name="jobId" type="long" update="false" column="JOB_ID" access="field"/>
|
||||
<property name="startTime" column="START_TIME" />
|
||||
<property name="endTime" column="END_TIME" />
|
||||
<property name="status" type="org.springframework.batch.execution.repository.dao.BatchStatusUserType" column="STATUS" />
|
||||
|
||||
@@ -261,7 +261,7 @@ public class SimpleJobRepositoryTests extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
public void testSaveOrUpdateJobExecution() {
|
||||
public void testSaveOrUpdateInvalidJobExecution() {
|
||||
|
||||
// failure scenario - must have job ID
|
||||
JobExecution jobExecution = new JobExecution(null);
|
||||
@@ -272,9 +272,13 @@ public class SimpleJobRepositoryTests extends TestCase {
|
||||
catch (Exception ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testSaveOrUpdateValidJobExecution() throws Exception {
|
||||
|
||||
JobExecution jobExecution = new JobExecution(new Long(1));
|
||||
|
||||
// new execution - call save on job dao
|
||||
jobExecution.setJobId(new Long(1));
|
||||
jobDao.save(jobExecution);
|
||||
jobDaoControl.replay();
|
||||
jobRepository.saveOrUpdate(jobExecution);
|
||||
|
||||
Reference in New Issue
Block a user