@Bean public Job remotePartitioningJob() { return this.jobBuilderFactory.get("remotePartitioningJob") .start(masterStep()) .build(); }
@Bean public Job remoteChunkingJob() { return this.jobBuilderFactory.get("remoteChunkingJob") .start(masterStep()) .build(); }
@Bean public Job remotePartitioningJob() { return this.jobBuilderFactory.get("remotePartitioningJob") .start(masterStep()) .build(); }
@Bean public Job job() throws Exception { return this.jobs.get("job") .start(step()) .build(); }
@Bean public Job anotherJob() throws Exception { SimpleJobBuilder builder = jobs.get("another").start(step3()); return builder.build(); }
@Bean public Job jobUnderTest() { return jobBuilder.get("job-under-test") .start(stepUnderTest()) .build(); }
@Bean Job job() { return jobFactory.get("job").start(step1()).build(); } }
@Bean public Job beansConfigurerJob() throws Exception { SimpleJobBuilder builder = jobs.get("beans").start(step1()); return builder.build(); }
@Bean public Job job() { return jobs.get("job") .start(step()) .build(); } }
@Bean public Job testJob(){ return jobBuilders.get("testJob") .start(step()) .build(); }
@Bean public Job testConfigurerJob() throws Exception { SimpleJobBuilder builder = jobs.jobBuilders().get("configurer").start(step1()); return builder.build(); }
@Bean public Job testJob(JobBuilderFactory jobs, Step testStep) { return jobs.get("testJob") .incrementer(new RunIdIncrementer()) .start(testStep) .build(); }
@Bean public Job job() { return this.jobBuilderFactory.get("job") .start(this.stepBuilderFactory.get("step") .tasklet((contribution, chunkContext) -> RepeatStatus.FINISHED) .build()) .build(); } }
@Bean public Job testJob() throws Exception { SimpleJobBuilder builder = jobs.get("test").start(step1()).next(step2()); return builder.build(); }
@Bean public Job testJob() throws Exception { SimpleJobBuilder builder = jobs.get("test").start(step1()).next(step2()); return builder.build(); }
@Test public void testBuildWithIntermediateSimpleJobTwoSteps() throws Exception { SimpleJobBuilder builder = new JobBuilder("flow").repository(jobRepository).start(step1).next(step2); builder.on("FAILED").to(step3).end(); builder.build().execute(execution); assertEquals(BatchStatus.COMPLETED, execution.getStatus()); assertEquals(2, execution.getStepExecutions().size()); }
@Test public void testBuildWithIntermediateSimpleJob() throws Exception { SimpleJobBuilder builder = new JobBuilder("flow").repository(jobRepository).start(step1); builder.on("COMPLETED").to(step2).end(); builder.preventRestart(); builder.build().execute(execution); assertEquals(BatchStatus.COMPLETED, execution.getStatus()); assertEquals(2, execution.getStepExecutions().size()); }
@Test public void testBuildWithStop() throws Exception { SimpleJobBuilder builder = new JobBuilder("flow").repository(jobRepository).start(step1); builder.on("COMPLETED").stop(); builder.preventRestart(); builder.build().execute(execution); assertEquals(BatchStatus.STOPPED, execution.getStatus()); assertEquals("STOPPED", execution.getExitStatus().getExitCode()); assertEquals(1, execution.getStepExecutions().size()); }
@Test public void testBuildWithCustomEndState() throws Exception { SimpleJobBuilder builder = new JobBuilder("flow").repository(jobRepository).start(step1); builder.on("COMPLETED").end("FOO"); builder.preventRestart(); builder.build().execute(execution); assertEquals(BatchStatus.COMPLETED, execution.getStatus()); assertEquals("FOO", execution.getExitStatus().getExitCode()); assertEquals(1, execution.getStepExecutions().size()); }
@Bean public Job concurrentJob() { Flow splitFlow = new FlowBuilder<Flow>("splitflow").split(new SimpleAsyncTaskExecutor()).add(flow(), flow(), flow(), flow(), flow(), flow(), flow()).build(); return jobBuilderFactory.get("concurrentJob") .start(firstStep()) .next(stepBuilderFactory.get("splitFlowStep") .flow(splitFlow) .build()) .next(lastStep()) .build(); }