Package org.springframework.batch.core.converter

Examples of org.springframework.batch.core.converter.DefaultJobParametersConverter


  @Test
  public void testJobLaunch() throws Exception {
        jdbcTemplate.update("DELETE FROM TRADE");

    jobLauncherTestUtils.launchJob(new DefaultJobParametersConverter()
        .getJobParameters(PropertiesConverter
            .stringToProperties("run.id(long)=1,parameter=true,run.date=20070122,input.file=classpath:data/fixedLengthImportJob/input/20070122.teststream.ImportTradeDataStep.txt")));

    int after = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM TRADE", Integer.class);
    assertEquals(5, after);
View Full Code Here


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

    jobOperator.setJobExplorer(jobExplorer);

    jobRepository = mock(JobRepository.class);
    jobOperator.setJobRepository(jobRepository);

    jobOperator.setJobParametersConverter(new DefaultJobParametersConverter() {
      @Override
      public JobParameters getJobParameters(Properties props) {
        assertTrue("Wrong properties", props.containsKey("a"));
        return jobParameters;
      }
View Full Code Here

  /**
   * @param parameters
   * @return
   */
  private StepExecution getStepExecution(String parameters) {
    JobParameters jobParameters = new DefaultJobParametersConverter().getJobParameters(PropertiesConverter.stringToProperties(parameters));
    return new StepExecution("step", new JobExecution(new JobInstance(1L, "job"), jobParameters));
  }
View Full Code Here

   * @param jobParameters comma or new line separated name=value pairs
   * @return a {@link JobExecution}
   */
  public static JobExecution createJobExecution(String jobName, Long instanceId, Long executionId,
      String jobParameters) {
    JobParameters params = new DefaultJobParametersConverter().getJobParameters(PropertiesConverter
        .stringToProperties(jobParameters));
    return createJobExecution(jobName, instanceId, executionId, params);
  }
View Full Code Here

  }

  // load the application context and launch the job
  private JobExecution runJobForRestartTest() throws Exception {
    return jobLauncherTestUtils
        .launchJob(new DefaultJobParametersConverter()
            .getJobParameters(PropertiesConverter
                .stringToProperties("run.id(long)=1,parameter=true,run.date=20070122,input.file=classpath:data/fixedLengthImportJob/input/20070122.teststream.ImportTradeDataStep.txt")));
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.converter.DefaultJobParametersConverter

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.