Examples of afterJob()


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

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

  /**
   * Call the registered listeners in order, respecting and prioritising those
View Full Code Here

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

  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);
    assertEquals(BatchStatus.STOPPED, jobExecution.getStatus());
View Full Code Here

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

    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);
  }

  @Test
View Full Code Here

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

    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);
  }

  @Test
View Full Code Here

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

        executed = true;
      }
    };
    factoryBean.setDelegate(delegate);
    JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
    listener.afterJob(new JobExecution(1L));
    assertTrue(delegate.isExecuted());
  }

  @Test
  public void testRightSignatureAnnotation() {
View Full Code Here

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

        assertEquals(new Long(25), jobExecution.getId());
      }
    };
    factoryBean.setDelegate(delegate);
    JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
    listener.afterJob(new JobExecution(25L));
    assertTrue(delegate.isExecuted());
  }

  @Test(expected = IllegalArgumentException.class)
  public void testWrongSignatureAnnotation() {
View Full Code Here

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

    factoryBean.setDelegate(delegate);
    Map<String, String> metaDataMap = new HashMap<String, String>();
    metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
    factoryBean.setMetaDataMap(metaDataMap);
    JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
    listener.afterJob(new JobExecution(1L));
    assertTrue(delegate.isExecuted());
  }

  @Test
  public void testRightSignatureNamedMethod() {
View Full Code Here

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

    factoryBean.setDelegate(delegate);
    Map<String, String> metaDataMap = new HashMap<String, String>();
    metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
    factoryBean.setMetaDataMap(metaDataMap);
    JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
    listener.afterJob(new JobExecution(25L));
    assertTrue(delegate.isExecuted());
  }

  @Test(expected = IllegalArgumentException.class)
  public void testWrongSignatureNamedMethod() {
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.