/** * Convenient method for subclasses to grab a {@link StepRunner} for running * steps by name. * * @return a {@link StepRunner} */ protected StepRunner getStepRunner() { if (this.stepRunner == null) { this.stepRunner = new StepRunner(getJobLauncher(), getJobRepository()); } return this.stepRunner; }
/** * Launch the entire job, including all steps. * * @return JobExecution, so that the test can validate the exit status * * @throws Exception is thrown if error occurs. */ protected JobExecution launchJob() throws Exception { return this.launchJob(this.getUniqueJobParameters()); }
/** * Launch just the specified step in the job. A unique set of JobParameters * will automatically be generated. An IllegalStateException is thrown if * there is no Step with the given name. * * @param stepName The name of the step to launch * @return JobExecution */ public JobExecution launchStep(String stepName) { return this.launchStep(stepName, this.getUniqueJobParameters(), null); }
/** * Launch just the specified step in the job. An IllegalStateException is * thrown if there is no Step with the given name. * * @param stepName The name of the step to launch * @param jobParameters The JobParameters to use during the launch * @param jobExecutionContext An ExecutionContext whose values will be * loaded into the Job ExecutionContext prior to launching the step. * @return JobExecution */ public JobExecution launchStep(String stepName, JobParameters jobParameters, ExecutionContext jobExecutionContext) { Step step = this.job.getStep(stepName); if (step == null) { step = this.job.getStep(this.job.getName() + "." + stepName); } if (step == null) { throw new IllegalStateException("No Step found with name: [" + stepName + "]"); } return getStepRunner().launchStep(step, jobParameters, jobExecutionContext); } }
/** * Launch the entire job, including all steps * * @param jobParameters parameters for the job * @return JobExecution, so that the test can validate the exit status * * @throws Exception is thrown if error occurs. */ protected JobExecution launchJob(JobParameters jobParameters) throws Exception { return getJobLauncher().run(this.job, jobParameters); }
/** * Launch just the specified step in the job. An IllegalStateException is * thrown if there is no Step with the given name. * * @param stepName The name of the step to launch * @param jobParameters The JobParameters to use during the launch * @return JobExecution */ public JobExecution launchStep(String stepName, JobParameters jobParameters) { return this.launchStep(stepName, jobParameters, null); }
/** * Launch just the specified step in the job. An IllegalStateException is * thrown if there is no Step with the given name. * * @param stepName * @return JobExecution */ public JobExecution launchStep(String stepName) { Step step = this.job.getStep(stepName); if (step == null) { throw new IllegalStateException("No Step found with name: [" + stepName + "]"); } return getStepRunner().launchStep(step); }
/** * Launch the entire job, including all steps * * @param jobParameters * @return JobExecution, so that the test can validate the exit status * @throws Exception */ protected JobExecution launchJob(JobParameters jobParameters) throws Exception { return getJobLauncher().run(this.job, jobParameters); }
/** * Launch the entire job, including all steps. * * @return JobExecution, so that the test can validate the exit status * @throws Exception */ protected JobExecution launchJob() throws Exception { return this.launchJob(this.getUniqueJobParameters()); }
/** * Convenient method for subclasses to grab a {@link StepRunner} for running * steps by name. * * @return a {@link StepRunner} */ protected StepRunner getStepRunner() { if (this.stepRunner == null) { this.stepRunner = new StepRunner(getJobLauncher(), getJobRepository()); } return this.stepRunner; }
/** * Launch just the specified step in the job. A unique set of JobParameters * will automatically be generated. An IllegalStateException is thrown if * there is no Step with the given name. * * @param stepName The name of the step to launch * @param jobExecutionContext An ExecutionContext whose values will be * loaded into the Job ExecutionContext prior to launching the step. * @return JobExecution */ public JobExecution launchStep(String stepName, ExecutionContext jobExecutionContext) { return this.launchStep(stepName, this.getUniqueJobParameters(), jobExecutionContext); }
/** * Launch just the specified step in the job. * * @param stepName * @param jobParameters */ public JobExecution launchStep(String stepName, JobParameters jobParameters) { return getStepRunner().launchStep(this.job.getStep(stepName), jobParameters); } }