Package org.springframework.batch.integration.launch

Examples of org.springframework.batch.integration.launch.JobLaunchRequest


  public void testJobParameterIncrementer() {
    jobParameterIncrementer.setKey("test-param-incrementer");
    when(mockedJob.getJobParametersIncrementer()).thenReturn(jobParameterIncrementer);
    final Message<String> message = MessageBuilder.withPayload("{\"test-param-incrementer(long)\":\"1234\"}").build();

    final JobLaunchRequest jobLaunchRequest = transformer.toJobLaunchRequest(message);

    assertNotNull(jobLaunchRequest.getJobParameters());
    assertTrue(jobLaunchRequest.getJobParameters().getParameters().size() == 2);
    // Now check if the job parameter is incremented
    assertEquals(Long.valueOf(1235), jobLaunchRequest.getJobParameters().getLong("test-param-incrementer"));
  }
View Full Code Here


    @Transformer
    public JobLaunchRequest toRequest(Message<File> message) {
        JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
        jobParametersBuilder.addString(fileParameterName, message.getPayload().getAbsolutePath());
        return new JobLaunchRequest(job, jobParametersBuilder.toJobParameters());
    }
View Full Code Here

TOP

Related Classes of org.springframework.batch.integration.launch.JobLaunchRequest

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.