CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);
WorkflowJobBean extWf = new WorkflowJobBean();
extWf.setId(action1.getExternalId());
extWf.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 1000));
extWf.setStartTime(new Date(System.currentTimeMillis() - 1 * 2100 * 1000));
jpaService.execute(new WorkflowJobInsertJPAExecutor(extWf));
sla = _createSLARegistration(action1.getId(), AppType.COORDINATOR_ACTION);
sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 2000 * 1000)); // past
slas.addRegistrationEvent(sla);
// CASE 4: positive test coord action
CoordinatorActionBean action2 = addRecordToCoordActionTable("coord-action-2", 1,
CoordinatorAction.Status.FAILED, "coord-action-get.xml", 0);
extWf = new WorkflowJobBean();
extWf.setId(action2.getExternalId());
// actual end before expected. but action is failed
extWf.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 1000));
extWf.setStartTime(new Date(System.currentTimeMillis() - 1 * 2000 * 1000));
jpaService.execute(new WorkflowJobInsertJPAExecutor(extWf));
sla = _createSLARegistration(action2.getId(), AppType.COORDINATOR_ACTION);
sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 1500 * 1000));
slas.addRegistrationEvent(sla);
// CASE 5: negative test coord action
CoordinatorActionBean action3 = addRecordToCoordActionTable("coord-action-3", 1,
CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
extWf = new WorkflowJobBean();
extWf.setId(action3.getExternalId());
extWf.setStartTime(new Date(System.currentTimeMillis() - 1 * 2100 * 1000));
extWf.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 1000));
jpaService.execute(new WorkflowJobInsertJPAExecutor(extWf));
sla = _createSLARegistration(action3.getId(), AppType.COORDINATOR_ACTION);
sla.setExpectedStart(new Date(System.currentTimeMillis() - 1 * 3600 * 1000)); // cause start_miss
sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 1500 * 1000)); // in past but > actual end, end_met
sla.setExpectedDuration(0); //cause duration miss
slas.addRegistrationEvent(sla);