@Override public Exception getException(String msg) throws Exception { return new JobExecutionNotFailedException(msg); }
@Override public Exception getException(String msg) throws Exception { return new JobParametersNotFoundException(msg); }
@Override public Exception getException(String msg) throws Exception { return new NoSuchJobException(msg); }
/** * Launch the entire job, including all steps * * @param jobParameters instance of {@link JobParameters}. * @return JobExecution, so that the test can validate the exit status * @throws Exception thrown if error occurs launching the job. */ public JobExecution launchJob(JobParameters jobParameters) throws Exception { return getJobLauncher().run(this.job, jobParameters); }
@Override public Exception getException(String msg) throws Exception { return new NoSuchJobExecutionException(msg); }
@Override public Exception getException(String msg, Throwable t) throws Exception { return new NoSuchJobInstanceException(msg, t); }
@Override public Exception getException(String msg) throws Exception { return new JobInstanceAlreadyExistsException(msg); }
/** * Test to support BATCH-1770 -> throw in parent thread JobRestartException when * a stepExecution is UNKNOWN */ @Test(expected=JobRestartException.class) public void testRunStepStatusUnknown() throws Exception { testRestartStepExecutionInvalidStatus(BatchStatus.UNKNOWN); }
@Test public void testRun() throws Exception { run(ExitStatus.COMPLETED); }
/** * 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); }
@Override public Exception getException(String msg, Throwable t) throws Exception { return new NoSuchJobException(msg, t); }
@Override public Exception getException(String msg, Throwable t) throws Exception { return new NoSuchJobExecutionException(msg, t); }
@Override public Exception getException(String msg) throws Exception { return new NoSuchJobInstanceException(msg); }
@Override public Exception getException(String msg, Throwable t) throws Exception { return new JobExecutionNotFailedException(msg, t); }
@Override public Exception getException(String msg, Throwable t) throws Exception { return new JobParametersNotFoundException(msg, t); }
@Override public Exception getException(String msg, Throwable t) throws Exception { return new JobInstanceAlreadyExistsException(msg, t); }
@Test(expected = JobExecutionAlreadyRunningException.class) public void testRunStepStatusStarting() throws Exception { testRestartStepExecutionInvalidStatus(BatchStatus.STARTING); }
@Override public Job getJob(String name) throws NoSuchJobException { if (name.equals("foo")) { return job; } throw new NoSuchJobException("foo"); }
private JobExecution findExecutionById(long executionId) throws NoSuchJobExecutionException { JobExecution jobExecution = jobExplorer.getJobExecution(executionId); if (jobExecution == null) { throw new NoSuchJobExecutionException("No JobExecution found for id: [" + executionId + "]"); } return jobExecution; } }
@Test(expected = JobExecutionAlreadyRunningException.class) public void testRunStepStatusStopping() throws Exception { testRestartStepExecutionInvalidStatus(BatchStatus.STOPPING); }