@Test(groups = "pc.itest.native", priority = 30)
public void testProcessInfoAccurateAfterProcessStarted() throws Exception {
Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
ConfigurationFacet component = components.iterator().next();
Configuration config = component.loadResourceConfiguration();
int beforeDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
stopTestProcess();
config = component.loadResourceConfiguration();
int afterDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
int afterPid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount, "No discovery call should have been made to refresh the process info if the process no longer exists");
Assert.assertEquals(afterPid, 0, "The process info should have been nulled out");
startTestProcess();
config = component.loadResourceConfiguration();
afterDiscoveryCallCount = config.getSimple(TestComponent.DISCOVERY_CALL_COUNT_PROP).getIntegerValue();
afterPid = config.getSimple(TestComponent.CURRENT_PID_PROP).getIntegerValue();
Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount + 1, "Exactly 1 discovery call should have been made to refresh the process info after the process started again.");