use of org.springframework.batch.core.launch.support.SimpleJobLauncher in project hub-alert by blackducksoftware.
the class CommonConfigTest method testRun.
@Test
public void testRun() throws Exception {
final SimpleJobLauncher simpleJobLauncher = Mockito.mock(SimpleJobLauncher.class);
C config = getConfigWithSimpleJobLauncher(simpleJobLauncher);
final JobExecution jobExecution = Mockito.mock(JobExecution.class);
final ExitStatus exitStatus = Mockito.mock(ExitStatus.class);
Mockito.when(exitStatus.getExitCode()).thenReturn("exit");
Mockito.when(exitStatus.getExitDescription()).thenReturn("description");
Mockito.when(jobExecution.getExitStatus()).thenReturn(exitStatus);
Mockito.when(simpleJobLauncher.run(Mockito.any(), Mockito.any())).thenReturn(jobExecution);
config = Mockito.spy(config);
final Job job = Mockito.mock(Job.class);
Mockito.doReturn(job).when(config).createJob(Mockito.any(), Mockito.any(), Mockito.any());
config.run();
final boolean successfulRun = outputLogger.isLineContainingText("Job finished with status");
assertTrue(successfulRun);
}
use of org.springframework.batch.core.launch.support.SimpleJobLauncher in project hub-alert by blackducksoftware.
the class Application method jobLauncher.
@Bean
public SimpleJobLauncher jobLauncher() throws Exception {
final SimpleJobLauncher launcher = new SimpleJobLauncher();
launcher.setJobRepository(jobRepository());
return launcher;
}
use of org.springframework.batch.core.launch.support.SimpleJobLauncher in project RecordManager2 by moravianlibrary.
the class AppConfig method jobLauncher.
@Bean
public JobLauncher jobLauncher() throws Exception {
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
jobLauncher.setJobRepository(jobRepository());
jobLauncher.afterPropertiesSet();
return jobLauncher;
}
use of org.springframework.batch.core.launch.support.SimpleJobLauncher in project tutorials by eugenp.
the class SpringConfig method getJobLauncher.
public JobLauncher getJobLauncher() throws Exception {
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
// SimpleJobLauncher's methods Throws Generic Exception,
// it would have been better to have a specific one
jobLauncher.setJobRepository(getJobRepository());
jobLauncher.afterPropertiesSet();
return jobLauncher;
}
use of org.springframework.batch.core.launch.support.SimpleJobLauncher in project tutorials by eugenp.
the class ChunksConfig method jobLauncher.
@Bean
public JobLauncher jobLauncher() throws Exception {
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
jobLauncher.setJobRepository(jobRepository());
return jobLauncher;
}
Aggregations