Examples of beforeJob()


Examples of org.springframework.batch.core.JobExecutionListener.beforeJob()

   */
  @Override
  public void beforeJob(JobExecution jobExecution) {
    for (Iterator<JobExecutionListener> iterator = listeners.iterator(); iterator.hasNext();) {
      JobExecutionListener listener = iterator.next();
      listener.beforeJob(jobExecution);
    }
  }

}
View Full Code Here

Examples of org.springframework.batch.core.JobExecutionListener.beforeJob()

  @Test
  public void testInterruptWithListener() throws Exception {
    step1.setProcessException(new JobInterruptedException("job interrupted!"));

    JobExecutionListener listener = mock(JobExecutionListener.class);
    listener.beforeJob(jobExecution);
    listener.afterJob(jobExecution);

    job.setJobExecutionListeners(new JobExecutionListener[] { listener });

    job.execute(jobExecution);
View Full Code Here

Examples of org.springframework.batch.core.JobExecutionListener.beforeJob()

  public void testWithInterface() throws Exception {
    JobListenerWithInterface delegate = new JobListenerWithInterface();
    factoryBean.setDelegate(delegate);
    JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
    JobExecution jobExecution = new JobExecution(11L);
    listener.beforeJob(jobExecution);
    listener.afterJob(jobExecution);
    assertTrue(delegate.beforeJobCalled);
    assertTrue(delegate.afterJobCalled);
  }
View Full Code Here

Examples of org.springframework.batch.core.JobExecutionListener.beforeJob()

  public void testWithAnnotations() throws Exception {
    AnnotatedTestClass delegate = new AnnotatedTestClass();
    factoryBean.setDelegate(delegate);
    JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
    JobExecution jobExecution = new JobExecution(11L);
    listener.beforeJob(jobExecution);
    listener.afterJob(jobExecution);
    assertTrue(delegate.beforeJobCalled);
    assertTrue(delegate.afterJobCalled);
  }
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.