populateTable(db, table);
String actionId = addInitRecords(newHCatDependency);
CoordinatorAction ca = checkCoordActionDependencies(actionId, newHCatDependency);
assertEquals(CoordinatorAction.Status.WAITING, ca.getStatus());
// Register the missing dependencies to PDMS assuming CoordPushDependencyCheckCommand did this.
pdms.addMissingDependency(new HCatURI(newHCatDependency1), actionId);
pdms.addMissingDependency(new HCatURI(newHCatDependency2), actionId);
sleep(2000);
Runnable recoveryRunnable = new RecoveryRunnable(0, 1, 1);
recoveryRunnable.run();
sleep(2000);
// Recovery service should have discovered newHCatDependency2 and JMS Connection should exist
// and newHCatDependency1 should be in PDMS waiting list
assertTrue(jmsService.isListeningToTopic(hcatService.getJMSConnectionInfo(new URI(newHCatDependency2)), "hcat."
+ db + "." + table));
checkCoordActionDependencies(actionId, newHCatDependency1);
assertNull(pdms.getWaitingActions(new HCatURI(newHCatDependency2)));
Collection<String> waitingActions = pdms.getWaitingActions(new HCatURI(newHCatDependency1));
assertEquals(1, waitingActions.size());
assertTrue(waitingActions.contains(actionId));
}