Package org.springframework.batch.core

Examples of org.springframework.batch.core.Job.execute()


    @Test
    public void testExecute() {
        Job job = new TestDummyJob("testExecute");
        String jobName = job.getName();
        job.execute(TestDummyJobRepository.createJobExecutionInstance(jobName));

        Operation op = assertOperationDetails(getLastEntered(), "execute", jobName);
        assertOperationPath(op, jobName, null);
    }
View Full Code Here


            }

            semaphore.release();
            // Initialization of the JobExecution for job level dependencies
            jobRegistry.register(job, jobExecution);
            job.execute(jobExecution);
            jobRegistry.remove(jobExecution);
          }
          catch (Exception e) {
            exceptionHolder.add(e);
          } finally {
View Full Code Here

            factoryBean.setJobExecution(jobExecution);
            final Job job = batchContext.getBean(Job.class);
            semaphore.release();
            // Initialization of the JobExecution for job level dependencies
            jobRegistry.register(job, jobExecution);
            job.execute(jobExecution);
            jobRegistry.remove(jobExecution);
          }
          catch (Exception e) {
            exceptionHolder.add(e);
          } finally {
View Full Code Here

  @Test
  public void testBuildWithStopAndRestart() throws Exception {
    SimpleJobBuilder builder = new JobBuilder("flow").repository(jobRepository).start(fails);
    builder.on("FAILED").stopAndRestart(step2);
    Job job = builder.build();
    job.execute(execution);
    assertEquals(BatchStatus.STOPPED, execution.getStatus());
    assertEquals(1, execution.getStepExecutions().size());
    execution = jobRepository.createJobExecution("flow", new JobParameters());
    job.execute(execution);
    assertEquals(BatchStatus.COMPLETED, execution.getStatus());
View Full Code Here

    Job job = builder.build();
    job.execute(execution);
    assertEquals(BatchStatus.STOPPED, execution.getStatus());
    assertEquals(1, execution.getStepExecutions().size());
    execution = jobRepository.createJobExecution("flow", new JobParameters());
    job.execute(execution);
    assertEquals(BatchStatus.COMPLETED, execution.getStatus());
    assertEquals(1, execution.getStepExecutions().size());
    assertEquals("step2", execution.getStepExecutions().iterator().next().getStepName());
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.