Package org.apache.derbyTesting.functionTests.harness

Examples of org.apache.derbyTesting.functionTests.harness.TimedProcess


        // Start a process to run the command
        Process pr = Runtime.getRuntime().exec(serverCmd);

        // TimedProcess, kill process if process doesnt finish in a certain
        // amount of time
        TimedProcess tp = new TimedProcess(pr);
        prout = new ProcessStreamResult(pr.getInputStream(), bos,
                timeoutMinutes);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos,
                timeoutMinutes);

        // wait until all the results have been processed
        boolean outTimedOut = prout.Wait();
        boolean errTimedOut = prerr.Wait();
       
        // wait for this process to terminate, upto a wait period
        // of 'timeoutSecondsForProcess'
        // if process has already been terminated, this call will
        // return immediately.
        tp.waitFor(timeoutSecondsForProcess);
        pr = null;
       
        if (outTimedOut || errTimedOut)
            System.out.println(" Reading from process streams timed out.. ");
View Full Code Here

TOP

Related Classes of org.apache.derbyTesting.functionTests.harness.TimedProcess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.