Search in sources :

Example 6 with ProcessThread

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);
    }
}
Also used : ProcessThread(jdk.testlibrary.ProcessThread)

Example 7 with 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;
}
Also used : ProcessThread(jdk.testlibrary.ProcessThread)

Aggregations

ProcessThread (jdk.testlibrary.ProcessThread)7 LocateRegistry (java.rmi.registry.LocateRegistry)1 Registry (java.rmi.registry.Registry)1 OutputAnalyzer (jdk.testlibrary.OutputAnalyzer)1