From 3b1e05c6d00e2e06d34b0ea28b8a4ba398a8b8e1 Mon Sep 17 00:00:00 2001 From: dsyer Date: Tue, 2 Oct 2007 18:07:40 +0000 Subject: [PATCH] RESOLVED - issue BATCH-102: Normalization of domain object dependencies http://opensource.atlassian.com/projects/spring/browse/BATCH-102 Removed StepExecution from StepInstance. --- .../batch/execution/step/simple/SimpleStepExecutor.java | 1 - .../execution/step/simple/DefaultStepExecutorTests.java | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java b/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java index f4ee38938..573eb4bfd 100644 --- a/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java +++ b/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java @@ -157,7 +157,6 @@ public class SimpleStepExecutor implements StepExecutor { Assert.notNull(step); final Tasklet module = configuration.getTasklet(); - step.setStepExecution(stepExecution); ExitStatus status = ExitStatus.FAILED; diff --git a/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java b/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java index 9c8e95185..05c878ad1 100644 --- a/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java +++ b/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java @@ -118,7 +118,6 @@ public class DefaultStepExecutorTests extends TestCase { SimpleJobIdentifier jobIdentifier = new SimpleJobIdentifier("FOO"); JobExecution jobExecution = new JobExecution(new JobInstance( jobIdentifier, new Long(1))); - step.setStepExecution(new StepExecution(step, jobExecution)); StepExecution stepExecution = new StepExecution(step, jobExecution); stepExecutor.processChunk(stepConfiguration, stepExecution); @@ -138,7 +137,6 @@ public class DefaultStepExecutorTests extends TestCase { SimpleJobIdentifier jobIdentifier = new SimpleJobIdentifier("FOO"); final JobExecution jobExecution = new JobExecution(new JobInstance( jobIdentifier, new Long(3))); - step.setStepExecution(new StepExecution(step, jobExecution)); final StepExecution stepExecution = new StepExecution(step, jobExecution); @@ -204,8 +202,7 @@ public class DefaultStepExecutorTests extends TestCase { try { stepExecutor.process(stepConfiguration, stepExecution); } catch (Exception ex) { - assertEquals(step.getStepExecution().getRollbackCount(), - new Integer(1)); + assertEquals(stepExecution.getRollbackCount(), new Integer(1)); } } @@ -240,7 +237,7 @@ public class DefaultStepExecutorTests extends TestCase { } catch (Exception ex) { assertEquals(new ExitStatus(false, ExitCodeExceptionClassifier.FATAL_EXCEPTION, - "java.lang.RuntimeException"), step.getStepExecution() + "java.lang.RuntimeException"), stepExecution .getExitStatus()); } }