diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java index 21a494085..d2cd131c6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java @@ -79,6 +79,13 @@ public class SimpleStepHandler implements StepHandler, InitializingBean { Assert.state(jobRepository != null, "A JobRepository must be provided"); } + /** + * @return the used jobRepository + */ + protected JobRepository getJobRepository() { + return this.jobRepository; + } + /** * @param jobRepository the jobRepository to set */ @@ -116,7 +123,7 @@ public class SimpleStepHandler implements StepHandler, InitializingBean { } StepExecution currentStepExecution = lastStepExecution; - if (shouldStart(lastStepExecution, jobInstance, step)) { + if (shouldStart(lastStepExecution, execution, step)) { currentStepExecution = execution.createStepExecution(step.getName()); @@ -184,7 +191,7 @@ public class SimpleStepHandler implements StepHandler, InitializingBean { * @throws JobRestartException if the job is in an inconsistent state from * an earlier failure */ - private boolean shouldStart(StepExecution lastStepExecution, JobInstance jobInstance, Step step) + protected boolean shouldStart(StepExecution lastStepExecution, JobExecution jobExecution, Step step) throws JobRestartException, StartLimitExceededException { BatchStatus stepStatus; @@ -209,7 +216,7 @@ public class SimpleStepHandler implements StepHandler, InitializingBean { return false; } - if (jobRepository.getStepExecutionCount(jobInstance, step.getName()) < step.getStartLimit()) { + if (jobRepository.getStepExecutionCount(jobExecution.getJobInstance(), step.getName()) < step.getStartLimit()) { // step start count is less than start max, return true return true; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java index f4e5e157f..de878d421 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java @@ -380,11 +380,11 @@ public class FlowBuilder { dirty = true; } - private void stop(String pattern) { + protected void stop(String pattern) { addTransition(pattern, stoppedState); } - private void stop(String pattern, State restart) { + protected void stop(String pattern, State restart) { EndState next = new EndState(FlowExecutionStatus.STOPPED, "STOPPED", prefix + "stop" + (endCounter++), true); addTransition(pattern, next); currentState = next; 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 fcf228e66..9e09595a5 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 @@ -202,6 +202,7 @@ public class SimpleFlow implements Flow, InitializingBean { String next = null; String exitCode = status.getName(); + for (StateTransition stateTransition : set) { if (stateTransition.matches(exitCode) || (exitCode.equals("PENDING") && stateTransition.matches("STOPPED"))) { if (stateTransition.isEnd()) { @@ -224,7 +225,6 @@ public class SimpleFlow implements Flow, InitializingBean { } State state = stateMap.get(next); - return state; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java index e8fd0b94a..375c1d441 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java @@ -67,6 +67,18 @@ public class EndState extends AbstractState { this.abandon = abandon; } + protected FlowExecutionStatus getStatus() { + return this.status; + } + + protected boolean isAbandon() { + return this.abandon; + } + + protected String getCode() { + return this.code; + } + /** * Return the {@link FlowExecutionStatus} stored. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/FlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/FlowParser.java index 3b20f5375..3ba8a4df1 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/FlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/FlowParser.java @@ -203,11 +203,9 @@ public class FlowParser extends AbstractFlowParser { if (!StringUtils.hasText(nextAttribute)) { nextAttribute = restartAttribute; } - - boolean abandon = stateId != null && StringUtils.hasText(restartAttribute) && !restartAttribute.equals(stateId); String exitCodeAttribute = transitionElement.getAttribute(EXIT_STATUS_ATTRIBUTE); - return createTransition(status, onAttribute, nextAttribute, exitCodeAttribute, stateDef, parserContext, abandon); + return createTransition(status, onAttribute, nextAttribute, restartAttribute, exitCodeAttribute, stateDef, parserContext, false); } /** @@ -226,7 +224,7 @@ public class FlowParser extends AbstractFlowParser { * references */ protected static Collection createTransition(FlowExecutionStatus status, String on, String next, - String exitCode, BeanDefinition stateDef, ParserContext parserContext, boolean abandon) { + String restart, String exitCode, BeanDefinition stateDef, ParserContext parserContext, boolean abandon) { BeanDefinition endState = null; @@ -246,8 +244,12 @@ public class FlowParser extends AbstractFlowParser { + (endCounter++); endBuilder.addConstructorArgValue(endName); + endBuilder.addConstructorArgValue(restart); + endBuilder.addConstructorArgValue(abandon); + endBuilder.addConstructorArgReference("jobRepository"); + String nextOnEnd = exitCodeExists ? null : next; endState = getStateTransitionReference(parserContext, endBuilder.getBeanDefinition(), null, nextOnEnd); next = endName; @@ -256,6 +258,11 @@ public class FlowParser extends AbstractFlowParser { Collection list = new ArrayList(); list.add(getStateTransitionReference(parserContext, stateDef, on, next)); + + if(StringUtils.hasText(restart)) { + list.add(getStateTransitionReference(parserContext, stateDef, on + ".RESTART", restart)); + } + if (endState != null) { // // Must be added after the state to ensure that the state is the diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobFactoryBean.java index 82e177482..3f9b13576 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobFactoryBean.java @@ -20,6 +20,7 @@ import javax.batch.api.listener.JobListener; import org.springframework.batch.core.JobExecutionListener; import org.springframework.batch.core.JobParametersIncrementer; import org.springframework.batch.core.JobParametersValidator; +import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.job.flow.Flow; import org.springframework.batch.core.job.flow.FlowJob; import org.springframework.batch.core.jsr.JobListenerAdapter; @@ -54,6 +55,8 @@ public class JobFactoryBean implements SmartFactoryBean { private Flow flow; + private JobExplorer jobExplorer; + public JobFactoryBean(String name) { this.name = name; } @@ -61,7 +64,8 @@ public class JobFactoryBean implements SmartFactoryBean { @Override public final FlowJob getObject() throws Exception { Assert.isTrue(StringUtils.hasText(name), "The job must have an id."); - FlowJob flowJob = new JsrFlowJob(name); + JsrFlowJob flowJob = new JsrFlowJob(name); + flowJob.setJobExplorer(jobExplorer); if (restartable != null) { flowJob.setRestartable(restartable); @@ -91,6 +95,10 @@ public class JobFactoryBean implements SmartFactoryBean { return flowJob; } + public void setJobExplorer(JobExplorer jobExplorer) { + this.jobExplorer = jobExplorer; + } + public void setRestartable(Boolean restartable) { this.restartable = restartable; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobParser.java index f11d378ac..3179aea50 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/configuration/xml/JobParser.java @@ -54,6 +54,8 @@ public class JobParser extends AbstractSingleBeanDefinitionParser { builder.addConstructorArgValue(jobName); + builder.addPropertyReference("jobExplorer", "jobExplorer"); + String restartableAttribute = element.getAttribute(RESTARTABLE_ATTRIBUTE); if (StringUtils.hasText(restartableAttribute)) { builder.addPropertyValue("restartable", restartableAttribute); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/DefaultStepHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/DefaultStepHandler.java new file mode 100644 index 000000000..8ee8822df --- /dev/null +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/DefaultStepHandler.java @@ -0,0 +1,146 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.batch.core.jsr.job; + +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.JobExecution; +import org.springframework.batch.core.StartLimitExceededException; +import org.springframework.batch.core.Step; +import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.explore.JobExplorer; +import org.springframework.batch.core.job.SimpleStepHandler; +import org.springframework.batch.core.repository.JobRepository; +import org.springframework.batch.core.repository.JobRestartException; +import org.springframework.batch.item.ExecutionContext; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; + +/** + * Extends {@link SimpleStepHandler} to apply JSR-352 specific logic for whether to + * start a step. + * + * @author Michael Minella + * @since 3.0 + */ +public class DefaultStepHandler extends SimpleStepHandler { + + private static final Log logger = LogFactory.getLog(DefaultStepHandler.class); + + private JobExplorer jobExplorer; + + /** + * @param jobRepository + */ + public DefaultStepHandler(JobRepository jobRepository, JobExplorer jobExplorer) { + super(jobRepository, new ExecutionContext()); + this.jobExplorer = jobExplorer; + } + + @Override + public void afterPropertiesSet() throws Exception { + super.afterPropertiesSet(); + Assert.state(jobExplorer != null, "A JobExplorer must be provided"); + } + + + /** + * Given a step and configuration, return true if the step should start, + * false if it should not, and throw an exception if the job should finish. + * @param lastStepExecution the last step execution + * @param jobInstance + * @param step + * + * @throws StartLimitExceededException if the start limit has been exceeded + * for this step + * @throws JobRestartException if the job is in an inconsistent state from + * an earlier failure + */ + @Override + protected boolean shouldStart(StepExecution lastStepExecution, JobExecution jobExecution, Step step) + throws JobRestartException, StartLimitExceededException { + + BatchStatus stepStatus; + String restartStep = null; + if (lastStepExecution == null) { + stepStatus = BatchStatus.STARTING; + } + else { + stepStatus = lastStepExecution.getStatus(); + + JobExecution lastJobExecution = getLastJobExecution(jobExecution); + + if(lastJobExecution.getExecutionContext().containsKey("batch.restartStep")) { + restartStep = lastJobExecution.getExecutionContext().getString("batch.restartStep"); + + if(lastJobExecution.getStatus() == BatchStatus.STOPPED && StringUtils.hasText(restartStep) && !restartStep.equals(step.getName())) { + logger.info("Job was stopped and should restart at step " + restartStep + ". The current step is " + step.getName()); + return false; + } + } + } + + if (stepStatus == BatchStatus.UNKNOWN) { + throw new JobRestartException("Cannot restart step from UNKNOWN status. " + + "The last execution ended with a failure that could not be rolled back, " + + "so it may be dangerous to proceed. Manual intervention is probably necessary."); + } + + if ((stepStatus == BatchStatus.COMPLETED && step.isAllowStartIfComplete() == false) + || stepStatus == BatchStatus.ABANDONED) { + // step is complete, false should be returned, indicating that the + // step should not be started + logger.info("Step already complete or not restartable, so no action to execute: " + lastStepExecution); + return false; + } + + if (getJobRepository().getStepExecutionCount(jobExecution.getJobInstance(), step.getName()) < step.getStartLimit()) { + // step start count is less than start max, return true + return true; + } + else { + // start max has been exceeded, throw an exception. + throw new StartLimitExceededException("Maximum start limit exceeded for step: " + step.getName() + + "StartMax: " + step.getStartLimit()); + } + } + + /** + * Since all JSR-352 jobs are run asynchronously, {@link JobRepository#getLastJobExecution(String, org.springframework.batch.core.JobParameters)} + * could return the currently running {@link JobExecution}. To get around this, we use the {@link JobExplorer} + * to get a list of the executions and get the most recent one that is not the currently running + * {@link JobExecution}. + * + * @param jobExecution + * @return the last executed JobExecution. + */ + private JobExecution getLastJobExecution(JobExecution jobExecution) { + List jobExecutions = jobExplorer.getJobExecutions(jobExecution.getJobInstance()); + JobExecution lastJobExecution = null; + + for (JobExecution curJobExecution : jobExecutions) { + if(lastJobExecution == null && curJobExecution.getId() != jobExecution.getId()) { + lastJobExecution = curJobExecution; + } else if(lastJobExecution != null && curJobExecution.getId() > lastJobExecution.getId() && curJobExecution.getId() != jobExecution.getId()) { + lastJobExecution = curJobExecution; + } + } + return lastJobExecution; + } +} diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJob.java index 76e6537ef..0505e56a5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJob.java @@ -19,11 +19,12 @@ import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobExecutionException; import org.springframework.batch.core.JobInterruptedException; +import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.job.AbstractJob; -import org.springframework.batch.core.job.SimpleStepHandler; import org.springframework.batch.core.job.flow.FlowExecutionException; import org.springframework.batch.core.job.flow.FlowJob; import org.springframework.batch.core.job.flow.JobFlowExecutor; +import org.springframework.batch.core.jsr.job.DefaultStepHandler; import org.springframework.batch.core.launch.NoSuchJobException; import org.springframework.batch.core.launch.support.ExitCodeMapper; @@ -35,6 +36,8 @@ import org.springframework.batch.core.launch.support.ExitCodeMapper; */ public class JsrFlowJob extends FlowJob { + private JobExplorer jobExplorer; + /** * No arg constructor (invalid state) */ @@ -51,6 +54,10 @@ public class JsrFlowJob extends FlowJob { super(name); } + public void setJobExplorer(JobExplorer jobExplorer) { + this.jobExplorer = jobExplorer; + } + /** * @see AbstractJob#doExecute(JobExecution) */ @@ -58,7 +65,7 @@ public class JsrFlowJob extends FlowJob { protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JsrFlowExecutor(getJobRepository(), - new SimpleStepHandler(getJobRepository()), execution); + new DefaultStepHandler(getJobRepository(), jobExplorer), execution); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/DefaultFlow.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/DefaultFlow.java index 9683048f9..450b5066e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/DefaultFlow.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/DefaultFlow.java @@ -26,6 +26,8 @@ import org.springframework.batch.core.job.flow.FlowExecutionStatus; import org.springframework.batch.core.job.flow.State; import org.springframework.batch.core.job.flow.support.SimpleFlow; import org.springframework.batch.core.job.flow.support.StateTransition; +import org.springframework.batch.item.ExecutionContext; +import org.springframework.util.StringUtils; /** * Implements JSR-352 specific logic around the execution of a flow. Specifically, this @@ -46,12 +48,31 @@ public class DefaultFlow extends SimpleFlow { super(name); } + @Override + protected State nextState(String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException { + State nextState = findState(stateName, status, stepExecution); + + if(stepExecution != null) { + ExecutionContext executionContext = stepExecution.getJobExecution().getExecutionContext(); + if(executionContext.containsKey("batch.stoppedStep")) { + String stepName = executionContext.getString("batch.stoppedStep"); + + if(stateName.endsWith(stepName)) { + if(nextState != null && executionContext.containsKey("batch.restartStep") && StringUtils.hasText(executionContext.getString("batch.restartStep"))) { + nextState = findState(stateName, new FlowExecutionStatus(status.getName() + ".RESTART"), stepExecution); + } + } + } + } + + return nextState; + } + /** * @return the next {@link Step} (or null if this is the end) * @throws JobExecutionException */ - @Override - protected State nextState(String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException { + private State findState(String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException { Set set = getTransitionMap().get(stateName); if (set == null) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/state/EndState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/state/EndState.java index a863fee2f..c0b25b67d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/state/EndState.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/job/flow/support/state/EndState.java @@ -15,11 +15,15 @@ */ package org.springframework.batch.core.jsr.job.flow.support.state; +import org.springframework.batch.core.BatchStatus; import org.springframework.batch.core.ExitStatus; +import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.job.flow.FlowExecutionStatus; import org.springframework.batch.core.job.flow.FlowExecutor; import org.springframework.batch.core.job.flow.State; +import org.springframework.batch.core.repository.JobRepository; +import org.springframework.batch.item.ExecutionContext; /** * {@link State} implementation for ending a job per JSR-352 rules if it is @@ -30,6 +34,9 @@ import org.springframework.batch.core.job.flow.State; */ public class EndState extends org.springframework.batch.core.job.flow.support.state.EndState { + private JobRepository jobRepository; + private String restart; + /** * @param status The {@link FlowExecutionStatus} to end with * @param name The name of the state @@ -57,6 +64,60 @@ public class EndState extends org.springframework.batch.core.job.flow.support.st super(status, code, name, abandon); } + public EndState(FlowExecutionStatus status, String code, String name, String restart, boolean abandon, JobRepository jobRepository) { + super(status, code, name, abandon); + this.jobRepository = jobRepository; + this.restart = restart; + } + + @Override + public FlowExecutionStatus handle(FlowExecutor executor) + throws Exception { + synchronized (executor) { + + // Special case. If the last step execution could not complete we + // are in an unknown state (possibly unrecoverable). + StepExecution stepExecution = executor.getStepExecution(); + if (stepExecution != null && executor.getStepExecution().getStatus() == BatchStatus.UNKNOWN) { + return FlowExecutionStatus.UNKNOWN; + } + + if (getStatus().isStop()) { + JobExecution jobExecution = stepExecution.getJobExecution(); + ExecutionContext executionContext = jobExecution.getExecutionContext(); + executionContext.put("batch.restartStep", restart); + executionContext.put("batch.stoppedStep", stepExecution.getStepName()); + jobRepository.updateExecutionContext(jobExecution); + + if (!executor.isRestart()) { + /* + * If there are step executions, then we are not at the + * beginning of a restart. + */ + if (isAbandon()) { + /* + * Only if instructed to do so, upgrade the status of + * last step execution so it is not replayed on a + * restart... + */ + executor.abandonStepExecution(); + } + } + else { + /* + * If we are a stop state and we got this far then it must + * be a restart, so return COMPLETED. + */ + return FlowExecutionStatus.COMPLETED; + } + } + + setExitStatus(executor, getCode()); + + return getStatus(); + } + } + /* (non-Javadoc) * @see org.springframework.batch.core.job.flow.support.state.EndState#setExitStatus(org.springframework.batch.core.job.flow.FlowExecutor, java.lang.String) */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java index e76e0c76c..b001ccdf2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java @@ -233,8 +233,10 @@ public class SimpleJobRepository implements JobRepository { } if (latest != null) { - ExecutionContext executionContext = ecDao.getExecutionContext(latest); - latest.setExecutionContext(executionContext); + ExecutionContext stepExecutionContext = ecDao.getExecutionContext(latest); + latest.setExecutionContext(stepExecutionContext); + ExecutionContext jobExecutionContext = ecDao.getExecutionContext(latest.getJobExecution()); + latest.getJobExecution().setExecutionContext(jobExecutionContext); } return latest; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/configuration/xml/SplitParsingTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/configuration/xml/SplitParsingTests.java index b28854735..4d2d2af1d 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/configuration/xml/SplitParsingTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/configuration/xml/SplitParsingTests.java @@ -75,6 +75,7 @@ public class SplitParsingTests { RuntimeBeanReference runtimeBeanReferenceValue = (RuntimeBeanReference) propertyValue.getValue(); Assert.assertTrue("RuntimeBeanReference should have a name of jsr352splitTaskExecutor" , "jsr352splitTaskExecutor".equals(runtimeBeanReferenceValue.getBeanName())); + context.close(); } @Test @@ -83,6 +84,7 @@ public class SplitParsingTests { BeanDefinitionRegistry registry = (BeanDefinitionRegistry) context.getBeanFactory(); PropertyValue propertyValue = new SplitParser(null).getSplitTaskExecutorPropertyValue(registry); Assert.assertTrue("Task executor not an instance of SimpleAsyncTaskExecutor" , (propertyValue.getValue() instanceof SimpleAsyncTaskExecutor)); + context.close(); } public static class ExitStatusSettingBatchlet extends AbstractBatchlet { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJobTests.java index a2cd8415b..9517cb7c9 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/jsr/job/flow/JsrFlowJobTests.java @@ -37,6 +37,8 @@ import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.explore.JobExplorer; +import org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean; import org.springframework.batch.core.job.flow.Flow; import org.springframework.batch.core.job.flow.FlowExecutionStatus; import org.springframework.batch.core.job.flow.FlowExecutor; @@ -50,6 +52,7 @@ import org.springframework.batch.core.job.flow.support.state.EndState; import org.springframework.batch.core.job.flow.support.state.FlowState; import org.springframework.batch.core.job.flow.support.state.SplitState; import org.springframework.batch.core.job.flow.support.state.StepState; +import org.springframework.batch.core.jsr.job.flow.support.DefaultFlow; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.dao.JobExecutionDao; import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean; @@ -67,6 +70,8 @@ public class JsrFlowJobTests { private JobRepository jobRepository; + private JobExplorer jobExplorer; + private boolean fail = false; private JobExecutionDao jobExecutionDao; @@ -74,17 +79,22 @@ public class JsrFlowJobTests { @Before public void setUp() throws Exception { job = new JsrFlowJob(); - MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean(); - factory.afterPropertiesSet(); - jobExecutionDao = factory.getJobExecutionDao(); - jobRepository = (JobRepository) factory.getObject(); + MapJobRepositoryFactoryBean jobRepositoryFactory = new MapJobRepositoryFactoryBean(); + jobRepositoryFactory.afterPropertiesSet(); + jobExecutionDao = jobRepositoryFactory.getJobExecutionDao(); + jobRepository = (JobRepository) jobRepositoryFactory.getObject(); job.setJobRepository(jobRepository); jobExecution = jobRepository.createJobExecution("job", new JobParameters()); + + MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean(jobRepositoryFactory); + jobExplorerFactory.afterPropertiesSet(); + jobExplorer = (JobExplorer) jobExplorerFactory.getObject(); + job.setJobExplorer(jobExplorer); } @Test public void testGetSteps() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0")); @@ -98,7 +108,7 @@ public class JsrFlowJobTests { @Test public void testTwoSteps() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); StepState step2 = new StepState(new StubStep("step2")); @@ -117,7 +127,7 @@ public class JsrFlowJobTests { @Test public void testFailedStep() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StateSupport("step1", FlowExecutionStatus.FAILED), "step2")); @@ -138,14 +148,15 @@ public class JsrFlowJobTests { @Test public void testFailedStepRestarted() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); State step2State = new StateSupport("step2") { @Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { JobExecution jobExecution = executor.getJobExecution(); - jobExecution.createStepExecution(getName()); + StepExecution stepExecution = jobExecution.createStepExecution(getName()); + jobRepository.add(stepExecution); if (fail) { return FlowExecutionStatus.FAILED; } @@ -175,7 +186,7 @@ public class JsrFlowJobTests { @Test public void testStoppingStep() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); State state2 = new StateSupport("step2", FlowExecutionStatus.FAILED); @@ -196,7 +207,7 @@ public class JsrFlowJobTests { @Test public void testInterrupted() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") { @Override @@ -219,7 +230,7 @@ public class JsrFlowJobTests { @Test public void testUnknownStatusStopsJob() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") { @Override @@ -244,9 +255,9 @@ public class JsrFlowJobTests { @Test public void testInterruptedSplit() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); - SimpleFlow flow1 = new SimpleFlow("flow1"); - SimpleFlow flow2 = new SimpleFlow("flow2"); + SimpleFlow flow = new DefaultFlow("job"); + SimpleFlow flow1 = new DefaultFlow("flow1"); + SimpleFlow flow2 = new DefaultFlow("flow2"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") { @@ -290,7 +301,7 @@ public class JsrFlowJobTests { @Test public void testInterruptedException() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") { @Override @@ -312,9 +323,9 @@ public class JsrFlowJobTests { @Test public void testInterruptedSplitException() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); - SimpleFlow flow1 = new SimpleFlow("flow1"); - SimpleFlow flow2 = new SimpleFlow("flow2"); + SimpleFlow flow = new DefaultFlow("job"); + SimpleFlow flow1 = new DefaultFlow("flow1"); + SimpleFlow flow2 = new DefaultFlow("flow2"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") { @@ -347,7 +358,7 @@ public class JsrFlowJobTests { @Test public void testEndStateStopped() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end")); transitions.add(StateTransition @@ -366,7 +377,7 @@ public class JsrFlowJobTests { } public void testEndStateFailed() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end")); transitions @@ -387,7 +398,7 @@ public class JsrFlowJobTests { @Test public void testEndStateStoppedWithRestart() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end")); transitions.add(StateTransition @@ -415,7 +426,7 @@ public class JsrFlowJobTests { @Test public void testBranching() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); StepState step1 = new StepState(new StubStep("step1")); transitions.add(StateTransition.createStateTransition(step1, "step2")); @@ -441,7 +452,7 @@ public class JsrFlowJobTests { @Test public void testBasicFlow() throws Throwable { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step")), "end0")); transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0"))); @@ -457,7 +468,7 @@ public class JsrFlowJobTests { @Test public void testDecisionFlow() throws Throwable { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); Decider decider = new Decider() { @Override @@ -501,7 +512,7 @@ public class JsrFlowJobTests { @Test public void testDecisionFlowWithExceptionInDecider() throws Throwable { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); JobExecutionDecider decider = new JobExecutionDecider() { @Override public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) { @@ -544,7 +555,7 @@ public class JsrFlowJobTests { @Test public void testGetStepExists() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0")); @@ -561,7 +572,7 @@ public class JsrFlowJobTests { @Test public void testGetStepExistsWithPrefix() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState("job.step", new StubStep("step")), "end0")); transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0"))); @@ -578,7 +589,7 @@ public class JsrFlowJobTests { @Test public void testGetStepNamesWithPrefix() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState("job.step", new StubStep("step")), "end0")); transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0"))); @@ -593,7 +604,7 @@ public class JsrFlowJobTests { @Test public void testGetStepNotExists() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0")); @@ -609,7 +620,7 @@ public class JsrFlowJobTests { @Test public void testGetStepNotStepState() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2")); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0")); @@ -625,14 +636,14 @@ public class JsrFlowJobTests { @Test public void testGetStepNestedFlow() throws Exception { - SimpleFlow nested = new SimpleFlow("nested"); + SimpleFlow nested = new DefaultFlow("nested"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end1")); transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1"))); nested.setStateTransitions(transitions); nested.afterPropertiesSet(); - SimpleFlow flow = new SimpleFlow("job"); + SimpleFlow flow = new DefaultFlow("job"); transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "nested")); transitions.add(StateTransition.createStateTransition(new FlowState(nested, "nested"), "end0")); @@ -649,9 +660,9 @@ public class JsrFlowJobTests { @Test public void testGetStepSplitFlow() throws Exception { - SimpleFlow flow = new SimpleFlow("job"); - SimpleFlow flow1 = new SimpleFlow("flow1"); - SimpleFlow flow2 = new SimpleFlow("flow2"); + SimpleFlow flow = new DefaultFlow("job"); + SimpleFlow flow1 = new DefaultFlow("flow1"); + SimpleFlow flow2 = new DefaultFlow("flow2"); List transitions = new ArrayList(); transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end0")); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/RestartInPriorStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/RestartInPriorStepTests.java index 7aa91a73a..e9b5889ae 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/RestartInPriorStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/RestartInPriorStepTests.java @@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals; import java.util.Map; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.batch.core.BatchStatus; @@ -14,7 +13,6 @@ import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.StepExecution; -import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.job.flow.FlowExecutionStatus; import org.springframework.batch.core.job.flow.JobExecutionDecider; import org.springframework.batch.core.launch.JobLauncher; @@ -37,22 +35,12 @@ public class RestartInPriorStepTests { @Autowired private JobRepository jobRepository; - @Autowired - private JobExplorer jobExplorer; - @Autowired private JobLauncher jobLauncher; @Autowired private Job job; - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - @Test public void test() throws Exception { // diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserTests.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserTests.xml index 56c1eefa3..f2c71af80 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserTests.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserTests.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithHardcodedPropertiesTests.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithHardcodedPropertiesTests.xml index 09d5d605e..9c2ff6bd7 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithHardcodedPropertiesTests.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithHardcodedPropertiesTests.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithMapperPropertiesTests.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithMapperPropertiesTests.xml index 6045c7099..b41e97126 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithMapperPropertiesTests.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithMapperPropertiesTests.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithPropertiesTests.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithPropertiesTests.xml index 00136cee0..b1b15de4b 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithPropertiesTests.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/fullPartitionParserWithPropertiesTests.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestBeanCreationException.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestBeanCreationException.xml index 58d9d2b75..806f9ef99 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestBeanCreationException.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestBeanCreationException.xml @@ -1,6 +1,6 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestNonRestartableJob.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestNonRestartableJob.xml index 63b2fa0cd..3ce335123 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestNonRestartableJob.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestNonRestartableJob.xml @@ -1,6 +1,6 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartAbandonJob.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartAbandonJob.xml index bb567eb27..c73264625 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartAbandonJob.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartAbandonJob.xml @@ -1,6 +1,6 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartJob.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartJob.xml index 2c240a046..120dfdcd9 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartJob.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/jsrJobOperatorTestRestartJob.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsBatchlet.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsBatchlet.xml index 3a549ce72..6aef4f36a 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsBatchlet.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsBatchlet.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsChunk.xml b/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsChunk.xml index edfc55e15..6a9cf53a8 100644 --- a/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsChunk.xml +++ b/spring-batch-core/src/test/resources/META-INF/batch-jobs/partitionParserTestsChunk.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ChunkListenerParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ChunkListenerParsingTests-context.xml index 95ad3dcc6..4bfdda695 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ChunkListenerParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ChunkListenerParsingTests-context.xml @@ -47,6 +47,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/DecisionParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/DecisionParsingTests-context.xml index 7f7eaa240..b05a7fe20 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/DecisionParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/DecisionParsingTests-context.xml @@ -25,6 +25,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ItemListenerParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ItemListenerParsingTests-context.xml index af25d3af3..9f02dd604 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ItemListenerParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ItemListenerParsingTests-context.xml @@ -37,15 +37,19 @@ - + - + - + - + + + + + @@ -54,7 +58,7 @@ - + @@ -63,7 +67,7 @@ - + @@ -72,16 +76,16 @@ - + - + - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobListenerParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobListenerParsingTests-context.xml index 5acf018ba..b21fc6b39 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobListenerParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobListenerParsingTests-context.xml @@ -25,6 +25,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobPropertySubstitutionTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobPropertySubstitutionTests-context.xml index 518006d28..033b048f7 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobPropertySubstitutionTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobPropertySubstitutionTests-context.xml @@ -43,6 +43,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryListenerTestBase-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryListenerTestBase-context.xml index d089a61e7..101528177 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryListenerTestBase-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryListenerTestBase-context.xml @@ -29,4 +29,8 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleItemBasedJobParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleItemBasedJobParsingTests-context.xml index 376a06cf9..6bc8b70be 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleItemBasedJobParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleItemBasedJobParsingTests-context.xml @@ -44,6 +44,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleJobParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleJobParsingTests-context.xml index 86f432b94..ab1b414f2 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleJobParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleJobParsingTests-context.xml @@ -25,6 +25,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/StepListenerParsingTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/StepListenerParsingTests-context.xml index cc4c1ac4c..733f29f55 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/StepListenerParsingTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/StepListenerParsingTests-context.xml @@ -34,6 +34,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/default-split-task-executor-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/default-split-task-executor-context.xml index 5f565db86..72dac96ce 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/default-split-task-executor-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/default-split-task-executor-context.xml @@ -57,6 +57,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/user-specified-split-task-executor-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/user-specified-split-task-executor-context.xml index 4d8f9a4e3..f5c9874b1 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/user-specified-split-task-executor-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/configuration/xml/user-specified-split-task-executor-context.xml @@ -57,6 +57,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAfterFlow-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAfterFlow-context.xml index 61771d5d0..26363c6bb 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAfterFlow-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAfterFlow-context.xml @@ -26,6 +26,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAsFirstStep-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAsFirstStep-context.xml index ac38f6448..97c2cca2c 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAsFirstStep-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionAsFirstStep-context.xml @@ -20,6 +20,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionCustomExitStatus-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionCustomExitStatus-context.xml index 3b4a895da..c3adb635e 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionCustomExitStatus-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionCustomExitStatus-context.xml @@ -20,6 +20,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionInvalidExitStatus-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionInvalidExitStatus-context.xml index 91f3469bb..be6637bde 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionInvalidExitStatus-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionInvalidExitStatus-context.xml @@ -23,6 +23,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionThrowsException-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionThrowsException-context.xml index 4ecc16dfa..608aae35f 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionThrowsException-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionThrowsException-context.xml @@ -23,6 +23,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionValidExitStatus-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionValidExitStatus-context.xml index 348f9e60a..ea23dfba4 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionValidExitStatus-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/jsr/step/DecisionStepTests-decisionValidExitStatus-context.xml @@ -24,6 +24,10 @@ + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml index 96f4aa9fa..ec1131aac 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml @@ -1,5 +1,5 @@ - - + @@ -16,9 +16,9 @@ - + - + @@ -27,9 +27,9 @@ - + - + @@ -39,13 +39,13 @@ - + - + - + - + @@ -72,15 +72,11 @@ - + - - - - - + - +