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