diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessor.java index aef2a27ab..710332b65 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessor.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessor.java @@ -8,10 +8,10 @@ import java.lang.reflect.Method; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.DefaultIntroductionAdvisor; import org.springframework.aop.support.DelegatingIntroductionInterceptor; +import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.StepExecutionListener; import org.springframework.batch.core.step.AbstractStep; -import org.springframework.batch.repeat.ExitStatus; import org.springframework.beans.BeansException; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.BeanPostProcessor; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java index 649b77337..70723daeb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java @@ -16,7 +16,6 @@ package org.springframework.batch.core.configuration.xml; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.List; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java index a3224aa2e..4ef3daa01 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java @@ -24,13 +24,13 @@ import java.util.SortedSet; import java.util.TreeSet; import org.springframework.batch.core.JobExecutionException; +import org.springframework.batch.core.Step; import org.springframework.batch.core.job.flow.Flow; import org.springframework.batch.core.job.flow.FlowExecution; import org.springframework.batch.core.job.flow.FlowExecutionException; import org.springframework.batch.core.job.flow.FlowExecutor; import org.springframework.beans.factory.InitializingBean; -import com.sun.org.apache.xerces.internal.impl.xpath.XPath.Step; /** * A {@link Flow} that branches conditionally depending on the exit status of diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessorTests.java index 446b9a6e3..115c20d82 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessorTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/annotation/StepComponentBeanPostProcessorTests.java @@ -7,49 +7,48 @@ import static org.easymock.EasyMock.createMock; import static org.junit.Assert.assertTrue; import org.junit.Test; +import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.step.AbstractStep; -import org.springframework.batch.repeat.ExitStatus; - /** * @author Lucas Ward - * + * */ public class StepComponentBeanPostProcessorTests { - + @BatchComponent private class TestComponent { - + boolean afterStepCalled = false; - + @AfterStep - public void testMethod(){ + public void testMethod() { afterStepCalled = true; } } - + @Test - public void testNormalCase() throws Exception{ + public void testNormalCase() throws Exception { AbstractStep step = new StubStep(); step.setJobRepository(createMock(JobRepository.class)); - StepComponentBeanPostProcessor postProcessor = new StepComponentBeanPostProcessor(step, "org.springframework.batch.core.annotation"); + StepComponentBeanPostProcessor postProcessor = new StepComponentBeanPostProcessor( + step, "org.springframework.batch.core.annotation"); TestComponent testComponent = new TestComponent(); - postProcessor.postProcessAfterInitialization(testComponent, "testComponent"); + postProcessor.postProcessAfterInitialization(testComponent, + "testComponent"); step.execute(new StepExecution("teststep", new JobExecution(11L))); assertTrue(testComponent.afterStepCalled); } - - private class StubStep extends AbstractStep{ + + private class StubStep extends AbstractStep { @Override - protected ExitStatus doExecute(StepExecution stepExecution) - throws Exception { - // TODO Auto-generated method stub - return ExitStatus.FINISHED; + protected void doExecute(StepExecution stepExecution) throws Exception { + stepExecution.setExitStatus(ExitStatus.FINISHED); } - + } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestListener.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestListener.java index b762506f8..8c6a2498b 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestListener.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestListener.java @@ -1,8 +1,8 @@ package org.springframework.batch.core.configuration.xml; +import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.StepExecutionListener; -import org.springframework.batch.repeat.ExitStatus; public class TestListener extends AbstractTestComponent implements StepExecutionListener {