org.springframework.batch.test
Class StepRunner
java.lang.Object
org.springframework.batch.test.StepRunner
public class StepRunner
- extends java.lang.Object
Utility class for executing steps outside of a Job. This is useful
in end to end testing in order to allow for the testing of a step individually
without running every Step in a job.
- launchStep(Step step): Launch the step with new parameters each time. (The current system
time will be used)
- launchStep(Step step, JobParameters jobParameters): Launch the specified step with the provided
JobParameters. This may be useful if your step requires a certain parameter during runtime.
It should be noted that any checked exceptions encountered while running the Step will wrapped with
RuntimeException. Any checked exception thrown will be due to a framework error, not the logic of the
step, and thus requiring a throws declaration in clients of this class is unnecessary.
- Since:
- 2.0
- Author:
- Dan Garrette, Lucas Ward
- See Also:
SimpleJob
|
Field Summary |
protected org.apache.commons.logging.Log |
logger
Logger |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
- Logger
StepRunner
public StepRunner(JobLauncher launcher,
JobRepository jobRepository)
launchStep
public JobExecution launchStep(Step step)
- Launcher
- Parameters:
stepName -
launchStep
public JobExecution launchStep(Step step,
JobParameters jobParameters)
- Launch just the specified step in the job.
- Parameters:
stepName - jobParameters -
Copyright © 2009. All Rights Reserved.