Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.SUCCEEDED, start, end, false,
false, 3);
final JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
coordJob.setAppNamespace(SchemaService.COORDINATOR_NAMESPACE_URI_1);
jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob));
CoordinatorActionBean action1 = addRecordToCoordActionTable(coordJob.getId(), 1,
CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
CoordinatorActionBean action2 = addRecordToCoordActionTable(coordJob.getId(), 2,
CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
CoordinatorActionBean action3 = addRecordToCoordActionTable(coordJob.getId(), 3,
CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
String rerunScope = Integer.toString(1) + "-" + Integer.toString(2);
final OozieClient coordClient = LocalOozie.getCoordClient();
coordClient.reRunCoord(coordJob.getId(), RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);
CoordJobGetJPAExecutor coordJobGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
coordJob = jpaService.execute(coordJobGetCmd);
assertEquals(CoordinatorJob.Status.SUCCEEDED, coordJob.getStatus());
CoordActionGetJPAExecutor coordActionGetCmd = new CoordActionGetJPAExecutor(action1.getId());
action1 = jpaService.execute(coordActionGetCmd);
assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);
coordActionGetCmd = new CoordActionGetJPAExecutor(action2.getId());
action2 = jpaService.execute(coordActionGetCmd);
assertNotSame(action2.getStatus(), CoordinatorAction.Status.SUCCEEDED);
}