in test-discovery/src/com/intellij/rt/coverage/data/TestDiscoveryProjectData.java [37:66]
private TestDiscoveryProjectData() {
try {
String testDiscoveryDataListener = System.getProperty(TEST_DISCOVERY_DATA_LISTENER_PROP);
if (testDiscoveryDataListener == null) {
throw new RuntimeException("Property \"" + TEST_DISCOVERY_DATA_LISTENER_PROP + "\" should be specified");
}
myDataListener = (TestDiscoveryDataListener) Class.forName(testDiscoveryDataListener).newInstance();
myNameEnumerator = myDataListener.getNameEnumerator();
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
boolean useVeryLateShutDownHook = Boolean.TRUE.toString().equals(System.getProperty(INSTRUMENT_SHUTDOWN_HOOKS));
if (useVeryLateShutDownHook && !tryRegisterHook()) {
useVeryLateShutDownHook = false;
}
final boolean finalUseVeryLateShutDownHook = useVeryLateShutDownHook;
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
public void run() {
testDiscoveryFinished();
if (!finalUseVeryLateShutDownHook) {
logTestInfo();
}
}
}));
}