action.setExternalId(null);
jpa.execute(new CoordActionUpdateJPAExecutor(action));
services.get(SLAService.class).addRegistrationEvent(
TestSLAService._createSLARegistration(action.getId(), AppType.COORDINATOR_ACTION));
new CoordKillXCommand(job.getId()).call();
assertEquals(1, ehs.getEventQueue().size());
CoordinatorActionEvent jobEvent = (CoordinatorActionEvent) ehs.getEventQueue().peek();
assertEquals(AppType.COORDINATOR_ACTION, jobEvent.getAppType());
assertEquals(JobEvent.EventStatus.FAILURE, jobEvent.getEventStatus());
assertEquals(action.getId(), jobEvent.getId());
ehs.new EventWorker().run();
SLACalcStatus slaEvent = (SLACalcStatus) ehs.getEventQueue().poll();
assertEquals(EventStatus.END_MISS, slaEvent.getEventStatus());
assertEquals(SLAStatus.MISS, slaEvent.getSLAStatus());
assertEquals(CoordinatorAction.Status.KILLED.name(), slaEvent.getJobStatus());
assertEquals(action.getId(), slaEvent.getId());
assertNotNull(slaEvent.getActualEnd());
// CASE 2: Coord Job status - PAUSED - Should not create event via CoordKill
// but via CoordActionUpdate
assertEquals(0, ehs.getEventQueue().size());
job = this.addRecordToCoordJobTable(CoordinatorJob.Status.PAUSED, false, false);
action = addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.RUNNING, "coord-action-sla1.xml",
0);
services.get(SLAService.class).addRegistrationEvent(
TestSLAService._createSLARegistration(action.getId(), AppType.COORDINATOR_ACTION));
new CoordKillXCommand(job.getId()).call();
assertEquals(0, ehs.getEventQueue().size());
WorkflowJobBean wf = new WorkflowJobBean();
wf.setId(action.getExternalId());
wf.setStatus(WorkflowJob.Status.KILLED);