Search in sources :

Example 6 with StepExecution

use of org.springframework.batch.core.StepExecution in project head by mifos.

the class LoanArrearsAndPortfolioAtRiskIntegrationTest method testLoanArrearsTaskRunSuccessfull.

@Test
@Ignore
public void testLoanArrearsTaskRunSuccessfull() throws Exception {
    mifosScheduler = getMifosScheduler("org/mifos/framework/components/batchjobs/loanArrearsAndPortfolioTask.xml");
    mifosScheduler.runIndividualTask(jobName);
    Thread.sleep(2000);
    JobExplorer explorer = mifosScheduler.getBatchJobExplorer();
    List<JobInstance> jobInstances = explorer.getJobInstances(jobName, 0, 10);
    Assert.assertTrue(jobInstances.size() > 0);
    JobInstance lastInstance = jobInstances.get(0);
    List<JobExecution> jobExecutions = explorer.getJobExecutions(lastInstance);
    Assert.assertEquals(1, jobExecutions.size());
    JobExecution lastExecution = jobExecutions.get(0);
    Assert.assertEquals(BatchStatus.COMPLETED, lastExecution.getStatus());
    Collection<StepExecution> stepExecutions = lastExecution.getStepExecutions();
    Assert.assertEquals(2, stepExecutions.size());
    for (StepExecution stepExecution : stepExecutions) {
        Assert.assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
    }
}
Also used : JobExecution(org.springframework.batch.core.JobExecution) JobInstance(org.springframework.batch.core.JobInstance) JobExplorer(org.springframework.batch.core.explore.JobExplorer) StepExecution(org.springframework.batch.core.StepExecution) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

StepExecution (org.springframework.batch.core.StepExecution)6 Test (org.junit.Test)5 JobExecution (org.springframework.batch.core.JobExecution)3 JobInstance (org.springframework.batch.core.JobInstance)3 JobExplorer (org.springframework.batch.core.explore.JobExplorer)3 ExecutionContext (org.springframework.batch.item.ExecutionContext)3 Ignore (org.junit.Ignore)2 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)1 AlarmServiceImpl (com.navercorp.pinpoint.web.service.AlarmServiceImpl)1 LinkedList (java.util.LinkedList)1