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:
dsyer
2007-09-30 12:02:02 +00:00
parent 33e63bc5dd
commit 3dced4edc8
2 changed files with 7 additions and 3 deletions

View File

@@ -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" />

View File

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