Package org.springframework.batch.core

Examples of org.springframework.batch.core.JobParametersValidator


  private Job job3;

  @Test(expected=JobParametersInvalidException.class)
  public void testValidatorAttribute() throws Exception {
    assertNotNull(job1);
    JobParametersValidator validator = (JobParametersValidator) ReflectionTestUtils.getField(job1,
        "jobParametersValidator");
    assertNotNull(validator);
    validator.validate(new JobParameters());
  }
View Full Code Here


  }

  @Test(expected=JobParametersInvalidException.class)
  public void testValidatorRef() throws Exception {
    assertNotNull(job2);
    JobParametersValidator validator = (JobParametersValidator) ReflectionTestUtils.getField(job2,
        "jobParametersValidator");
    assertNotNull(validator);
    validator.validate(new JobParameters());
  }
View Full Code Here

  }

  @Test(expected=JobParametersInvalidException.class)
  public void testValidatorBean() throws Exception {
    assertNotNull(job3);
    JobParametersValidator validator = (JobParametersValidator) ReflectionTestUtils.getField(job3,
        "jobParametersValidator");
    assertNotNull(validator);
    validator.validate(new JobParameters());
  }
View Full Code Here

      JobParametersIncrementer jobParametersIncrementer = properties.getJobParametersIncrementer();
      if (jobParametersIncrementer != null) {
        job.setJobParametersIncrementer(jobParametersIncrementer);
      }
      JobParametersValidator jobParametersValidator = properties.getJobParametersValidator();
      if (jobParametersValidator != null) {
        job.setJobParametersValidator(jobParametersValidator);
      }

      Boolean restartable = properties.getRestartable();
View Full Code Here

    String jobName = "test_job";
    JobRepository jobRepository = mock(JobRepository.class);
    JobParameters parameters = new JobParametersBuilder().addLong("runtime", System.currentTimeMillis()).toJobParameters();
    JobExecution jobExecution = mock(JobExecution.class);
    Job job = mock(Job.class);
    JobParametersValidator validator = mock(JobParametersValidator.class);
    StepExecution stepExecution = mock(StepExecution.class);

    when(job.getName()).thenReturn(jobName);
    when(job.isRestartable()).thenReturn(true);
    when(job.getJobParametersValidator()).thenReturn(validator);
View Full Code Here

    compositeJobParametersValidator.afterPropertiesSet();
  }
 
  @Test
  public void testDelegateIsInvoked() throws JobParametersInvalidException{
    JobParametersValidator validator = mock(JobParametersValidator.class);
    validator.validate(parameters);
    compositeJobParametersValidator.setValidators(Arrays.asList(validator));
    compositeJobParametersValidator.validate(parameters);
  }
View Full Code Here

    compositeJobParametersValidator.validate(parameters);
  }
 
  @Test
  public void testDelegatesAreInvoked() throws JobParametersInvalidException{
    JobParametersValidator validator = mock(JobParametersValidator.class);
    validator.validate(parameters);
    validator.validate(parameters);
    compositeJobParametersValidator.setValidators(Arrays.asList(validator, validator));
    compositeJobParametersValidator.validate(parameters);
  }
View Full Code Here

TOP

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

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.