From 3dced4edc8d4253e30811f787581b71508493b16 Mon Sep 17 00:00:00 2001 From: dsyer Date: Sun, 30 Sep 2007 12:02:02 +0000 Subject: [PATCH] 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 --- .../batch/execution/repository/dao/JobExecution.hbm.xml | 2 +- .../execution/repository/SimpleJobRepositoryTests.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/execution/src/main/resources/org/springframework/batch/execution/repository/dao/JobExecution.hbm.xml b/execution/src/main/resources/org/springframework/batch/execution/repository/dao/JobExecution.hbm.xml index 823de3ce1..71928d035 100644 --- a/execution/src/main/resources/org/springframework/batch/execution/repository/dao/JobExecution.hbm.xml +++ b/execution/src/main/resources/org/springframework/batch/execution/repository/dao/JobExecution.hbm.xml @@ -12,7 +12,7 @@ &job-execution-generator; - + diff --git a/execution/src/test/java/org/springframework/batch/execution/repository/SimpleJobRepositoryTests.java b/execution/src/test/java/org/springframework/batch/execution/repository/SimpleJobRepositoryTests.java index 2fa825797..3491a6c23 100644 --- a/execution/src/test/java/org/springframework/batch/execution/repository/SimpleJobRepositoryTests.java +++ b/execution/src/test/java/org/springframework/batch/execution/repository/SimpleJobRepositoryTests.java @@ -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);