*
* @throws Exception
*/
public void testActionCheckerServiceCoord() throws Exception {
final int actionNum = 1;
final CoordinatorEngine ce = new CoordinatorEngine(getTestUser());
String currentDatePlusMonth = XDataTestCase.getCurrentDateafterIncrementingInMonths(1);
Date start = DateUtils.parseDateOozieTZ(currentDatePlusMonth);
Date end = DateUtils.parseDateOozieTZ(currentDatePlusMonth);
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, false, false, 0);
final WorkflowJobBean wfJob = addRecordToWfJobTable(WorkflowJob.Status.SUCCEEDED,
WorkflowInstance.Status.SUCCEEDED);
final CoordinatorActionBean action = addRecordToCoordActionTable(job.getId(), actionNum,
CoordinatorAction.Status.RUNNING, "coord-action-get.xml", wfJob.getId(), "RUNNING", 0);
sleep(3000);
Runnable actionCheckRunnable = new ActionCheckRunnable(1);
actionCheckRunnable.run();
sleep(3000);
waitFor(200000, new Predicate() {
public boolean evaluate() throws Exception {
return (ce.getCoordAction(action.getId()).getStatus() == CoordinatorAction.Status.SUCCEEDED);
}
});
JPAService jpaService = Services.get().get(JPAService.class);
CoordinatorActionBean recoveredAction = jpaService.execute(new CoordActionGetJPAExecutor(action.getId()));