Examples of JobRepository


Examples of org.springframework.batch.core.repository.JobRepository

  public void testStepExecutionUpdateFailure() throws Exception {

    JobExecution jobExecution = new JobExecution(jobInstance, jobParameters);
    StepExecution stepExecution = new StepExecution(step.getName(), jobExecution);

    JobRepository repository = new JobRepositoryFailedUpdateStub();

    step.setJobRepository(repository);
    step.afterPropertiesSet();

    step.execute(stepExecution);
View Full Code Here

Examples of org.springframework.batch.core.repository.JobRepository

  private JobExecution execution;

  @Before
  public void init() throws Exception {
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
    job.setJobRepository(jobRepository);
    execution = jobRepository.createJobExecution("job", new JobParameters());
  }
View Full Code Here

Examples of org.springframework.batch.core.repository.JobRepository

      }
    }

    MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean();
    factory.afterPropertiesSet();
    JobRepository repository = factory.getObject();
    job.setJobRepository(repository);
    job.setRestartable(true);

    JobExecution execution = repository.createJobExecution("testHandleStepJob", new JobParameters());
    job.handleStep(new StubStep(), execution);

    assertEquals(StubStep.value, execution.getExecutionContext().get(StubStep.key));

    // simulate restart and check the job execution context's content survives
    execution.setEndTime(new Date());
    execution.setStatus(BatchStatus.FAILED);
    repository.update(execution);

    JobExecution restarted = repository.createJobExecution("testHandleStepJob", new JobParameters());
    assertEquals(StubStep.value, restarted.getExecutionContext().get(StubStep.key));
  }
View Full Code Here

Examples of org.springframework.batch.core.repository.JobRepository

public class FlowBuilderTests {

  @Test
  public void test() throws Exception {
    FlowBuilder<Flow> builder = new FlowBuilder<Flow>("flow");
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
    JobExecution execution = jobRepository.createJobExecution("foo", new JobParameters());
    builder.start(new StepSupport("step") {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException,
          UnexpectedJobExecutionException {
      }
View Full Code Here

Examples of org.springframework.batch.core.repository.JobRepository

  private JobExecution execution;

  @Before
  public void init() throws Exception {
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
    job.setJobRepository(jobRepository);
    execution = jobRepository.createJobExecution("job", new JobParameters());
  }
View Full Code Here

Examples of org.springframework.batch.core.repository.JobRepository

  @Before
  public void init() throws Exception {
    this.context.register(BatchConfiguration.class);
    this.context.refresh();
    JobRepository jobRepository = this.context.getBean(JobRepository.class);
    this.jobLauncher = this.context.getBean(JobLauncher.class);
    this.jobs = new JobBuilderFactory(jobRepository);
    PlatformTransactionManager transactionManager = this.context
        .getBean(PlatformTransactionManager.class);
    this.steps = new StepBuilderFactory(jobRepository, transactionManager);
View Full Code Here

Examples of org.springframework.batch.core.repository.JobRepository

        "spring.batch.job.names:discreteRegisteredJob");
    this.context.register(NamedJobConfigurationWithRegisteredJob.class,
        EmbeddedDataSourceConfiguration.class, BatchAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    JobRepository repository = this.context.getBean(JobRepository.class);
    assertNotNull(this.context.getBean(JobLauncher.class));
    this.context.getBean(JobLauncherCommandLineRunner.class).run();
    assertNotNull(repository.getLastJobExecution("discreteRegisteredJob",
        new JobParameters()));
  }
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.