public void testCoordChangePauseTime() throws Exception {
Date start = new Date();
Date end = new Date(start.getTime() + (20 * 60 * 1000));
Date pauseTime = new Date(start.getTime() + (10 * 60 * 1000));
String pauseTimeChangeStr = "pausetime=" + DateUtils.convertDateToString(pauseTime);
final CoordinatorJobBean job = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.RUNNING, start,
end, end, true, false, 4);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
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) {