*
* @throws Exception
*/
public void testActionCheckerServiceCoord() throws Exception {
final int actionNum = 1;
final CoordinatorEngine ce = new CoordinatorEngine(getTestUser(), "UNIT_TESTING");
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
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);
Thread.sleep(3000);
Runnable actionCheckRunnable = new ActionCheckRunnable(1);
actionCheckRunnable.run();
Thread.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()));