Package org.springframework.batch.integration

Examples of org.springframework.batch.integration.JobSupport


public class JobRequestConverter {

  @ServiceActivator
  public JobLaunchRequest convert(String jobName) {
    Properties properties = new Properties();
    return new JobLaunchRequest(new JobSupport(jobName), new DefaultJobParametersConverter().getJobParameters(properties));
  }
View Full Code Here


    messageHandler = new JobLaunchingMessageHandler(jobLauncher);
  }

  @Test
  public void testSimpleDelivery() throws Exception{
    messageHandler.launch(new JobLaunchRequest(new JobSupport("testjob"), null));

    assertEquals("Wrong job count", 1, jobLauncher.jobs.size());
    assertEquals("Wrong job name", jobLauncher.jobs.get(0).getName(), "testjob");

  }
View Full Code Here

public class JobLaunchingGatewayTests {

  @Test
  public void testExceptionRaised() throws Exception {

    final Message<JobLaunchRequest> message = MessageBuilder.withPayload(new JobLaunchRequest(new JobSupport("testJob"),
    new JobParameters())).build();

    final JobLauncher jobLauncher = mock(JobLauncher.class);
    when(jobLauncher.run(any(Job.class), any(JobParameters.class)))
      .thenThrow(new JobParametersInvalidException("This is a JobExecutionException."));
View Full Code Here

public class JobLaunchingGatewayTests {

  @Test
  public void testExceptionRaised() throws Exception {

    final Message<JobLaunchRequest> message = MessageBuilder.withPayload(new JobLaunchRequest(new JobSupport("testJob"),
    new JobParameters())).build();

    final JobLauncher jobLauncher = mock(JobLauncher.class);
    when(jobLauncher.run(any(Job.class), any(JobParameters.class)))
      .thenThrow(new JobParametersInvalidException("This is a JobExecutionException."));
View Full Code Here

TOP

Related Classes of org.springframework.batch.integration.JobSupport

Copyright © 2018 www.massapicom. 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.