BATCH-894: wrong import somehow crept into last commit
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user