Examples of JobParameters


Examples of org.springframework.batch.core.JobParameters

        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

Examples of org.springframework.batch.core.JobParameters

   * 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

Examples of org.springframework.batch.core.JobParameters

  }

  @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

Examples of org.springframework.batch.core.JobParameters

   * 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

Examples of org.springframework.batch.core.JobParameters

  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

Examples of org.springframework.batch.core.JobParameters

  }

  @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

Examples of org.springframework.batch.core.JobParameters

   * @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

Examples of org.springframework.batch.core.JobParameters

   */
  @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

Examples of org.springframework.batch.core.JobParameters

        this.jobLauncher = jobLauncher;
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        JobParameters jobParameters = prepareJobParameters(exchange.getIn().getHeaders());
        JobExecution jobExecution = jobLauncher.run(job, jobParameters);
        exchange.getOut().setBody(jobExecution);
    }
View Full Code Here

Examples of org.springframework.batch.core.JobParameters

  @Override
  public long deleteData() {
    try {
      long jobInstanceCount = jobExplorer.getJobInstanceCount(deleteAllDataJob.getName());
      final JobParameters jobParameters = new JobParametersBuilder().addLong(RUN_ID, ++jobInstanceCount).toJobParameters();
      final JobExecution run = jobLauncher.run(deleteAllDataJob, jobParameters);
      assertExitStatus(run.getExitStatus());
      return runtime(run);
    } catch (final Exception e) {
      throw new IllegalStateException(e);
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.