Package org.springframework.batch.core

Examples of org.springframework.batch.core.JobParameters


    public JobExecution getLastJobExecution(String jobName, JobParameters jobParameters) {
        return execsMap.get(jobName);
    }

    static JobExecution createJobExecutionInstance(String jobName) {
        return createJobExecutionInstance(jobName, new JobParameters());
    }
View Full Code Here


        SimpleJobLauncher launcher = new SimpleJobLauncher();
        launcher.setJobRepository(new TestDummyJobRepository());
        launcher.afterPropertiesSet();

        Job job = new TestDummyJob("testRunJob");
        JobExecution execution = launcher.run(job, new JobParameters());
        assertNotNull("No job exectuion instance", execution);

        String jobName = job.getName();
        Operation op = assertOperationDetails(getFirstEntered(), "run", job.getName());
        assertOperationPath(op, jobName, null);
View Full Code Here

        log.info("Batch Tweet Influencers Hive Job Running");
        context.registerShutdownHook();

        JobLauncher jobLauncher = context.getBean(JobLauncher.class);
        Job job = context.getBean(Job.class);
        jobLauncher.run(job, new JobParameters());

    }
View Full Code Here

   * current timestamp, to ensure that the job instance will be unique
   */
  private JobParameters makeUniqueJobParameters() {
    Map<String, JobParameter> parameters = new HashMap<String, JobParameter>();
    parameters.put("timestamp", new JobParameter(new Date().getTime()));
    return new JobParameters(parameters);
  }
View Full Code Here

  }

  @Before
  public void onSetUpBeforeTransaction() throws Exception {
    StepExecution stepExecution = new StepExecution("stepName", new JobExecution(new JobInstance(12L,
        "testJob"), new JobParameters()));
    writer.beforeStep(stepExecution);
  }
View Full Code Here

   * current timestamp, to ensure that the job instance will be unique.
   */
  protected JobParameters getUniqueJobParameters() {
    Map<String, JobParameter> parameters = new HashMap<String, JobParameter>();
    parameters.put("timestamp", new JobParameter(new Date().getTime()));
    return new JobParameters(parameters);
  }
View Full Code Here

  private JobLauncherTestUtils jobLauncherTestUtils;

  @Test
  public void testLaunchJob() throws Exception {

    final JobParameters jobParameters = new JobParametersBuilder().addLong("timestamp", System.currentTimeMillis())
        .toJobParameters();

    JobExecution jobExecution = jobLauncherTestUtils.launchJob(jobParameters);

    Thread.sleep(1000);
View Full Code Here

  }

  @BeforeTransaction
  public void onSetUpBeforeTransaction() throws Exception {
    StepExecution stepExecution = new StepExecution("stepName", new JobExecution(new JobInstance(jobId,
        "testJob"), new JobParameters()));
    writer.beforeStep(stepExecution);
    writer.write(Arrays.asList("FOO", "BAR", "SPAM", "BUCKET"));
    reader.beforeStep(stepExecution);
  }
View Full Code Here

   * @return a collection of {@link JobExecution}
   */
  public List<JobExecution> createJobExecutions(String jobName, String[] stepNames, int count)
      throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException {
    List<JobExecution> list = new ArrayList<JobExecution>();
    JobParameters jobParameters = new JobParameters();
    for (int i = 0; i < count; i++) {
      JobExecution jobExecution = jobRepository.createJobExecution(jobName, jobParametersIncrementer
          .getNext(jobParameters));
      list.add(jobExecution);
      for (String stepName : stepNames) {
View Full Code Here

   */
  @Test
  public void integrationTest() throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException {
   
    // Run the batch job
    JobParameters jobParameters = new JobParametersBuilder().addDate("startTime", new Date()).toJobParameters();
    JobExecution jobEx = jobLauncher.run(simpleJob, jobParameters);
   
    // Validate we have created 20 new records with the new predicate
    // this uses the basic functionality in SnarlTemplate
    List<String> results = snarlTemplate.doWithGetter(null, "urn:test:propertyUpdate", new GetterCallback<String>() {
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.JobParameters

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.