addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 3, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 4, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);
new CoordChangeXCommand(job.getId(), pauseTimeChangeStr).call();
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
CoordinatorJobBean coordJob = jpaService.execute(coordGetCmd);
assertEquals(DateUtils.convertDateToString(coordJob.getPauseTime()), DateUtils.convertDateToString(pauseTime));
assertEquals(Job.Status.RUNNING, coordJob.getStatus());
assertEquals(2, coordJob.getLastActionNumber());
try {
jpaService.execute(new CoordJobGetActionByActionNumberJPAExecutor(job.getId(), 3));
fail("Expected to fail as action 3 should have been deleted");
}
catch (JPAExecutorException jpae) {
assertEquals(ErrorCode.E0603, jpae.getErrorCode());
jpae.printStackTrace();
}
try {
jpaService.execute(new CoordJobGetActionByActionNumberJPAExecutor(job.getId(), 4));
fail("Expected to fail as action 4 should have been deleted");
}
catch (JPAExecutorException jpae) {
assertEquals(ErrorCode.E0603, jpae.getErrorCode());
jpae.printStackTrace();