use of jdk.testlibrary.ProcessThread in project jdk8u_jdk by JetBrains.
the class StartManagementAgent method main.
public static void main(String[] args) throws Throwable {
final String pidFile = "StartManagementAgent.Application.pid";
ProcessThread processThread = null;
RunnerUtil.ProcessInfo info = null;
try {
processThread = RunnerUtil.startApplication(pidFile);
info = RunnerUtil.readProcessInfo(pidFile);
runTests(info.pid);
} catch (Throwable t) {
System.out.println("StartManagementAgent got unexpected exception: " + t);
t.printStackTrace();
throw t;
} finally {
// Make sure the Application process is stopped.
RunnerUtil.stopApplication(info.shutdownPort, processThread);
}
}
use of jdk.testlibrary.ProcessThread in project jdk8u_jdk by JetBrains.
the class JstatdTest method tryToSetupJstatdProcess.
private ProcessThread tryToSetupJstatdProcess() throws Throwable {
ProcessThread jstatdThread = new ProcessThread("Jstatd-Thread", getJstatdCmd());
try {
jstatdThread.start();
// Make sure jstatd is up and running
jstatdPid = waitOnTool("jstatd", jstatdThread);
if (jstatdPid == null) {
// The port is already in use. Cancel and try with new one.
jstatdThread.stopProcess();
jstatdThread.join();
return null;
}
} catch (Throwable t) {
// Something went wrong in the product - clean up!
cleanUpThread(jstatdThread);
throw t;
}
return jstatdThread;
}
Aggregations