Examples of ProcessStreamResult


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

   */

  private static void execCmdDumpResults (String[] args, boolean wait) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
        System.out.flush();
        bos.flush();
       
        BufferedOutputStream _bos = bos;
        if (!wait) {
            // not interested in the output, don't expect a huge amount.
            // information will just be written to the byte array in
            // memory and never used.
            _bos = new BufferedOutputStream(new ByteArrayOutputStream());
        }
    // Start a process to run the command
    Process pr = execCmd(args);
       
        // Note, the timeout handling will only come into effect when we make
        // the Wait() call on ProcessStreamResult.
        prout = new ProcessStreamResult(pr.getInputStream(), _bos, timeoutMinutes);
        prerr = new ProcessStreamResult(pr.getErrorStream(), _bos, timeoutMinutes);
       
        if (!wait)
            return;

    // wait until all the results have been processed or if we timed out
    prout.Wait();
    prerr.Wait();
        _bos.flush();
        System.out.flush();

  }
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args, boolean wait) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
        System.out.flush();
        bos.flush();
       
        BufferedOutputStream _bos = bos;
        if (!wait) {
            // not interested in the output, don't expect a huge amount.
            // information will just be written to the byte array in
            // memory and never used.
            _bos = new BufferedOutputStream(new ByteArrayOutputStream());
        }
    // Start a process to run the command
    Process pr = execCmd(args);
       
        // Note, the timeout handling will only come into effect when we make
        // the Wait() call on ProcessStreamResult.
        prout = new ProcessStreamResult(pr.getInputStream(), _bos, timeoutMinutes);
        prerr = new ProcessStreamResult(pr.getErrorStream(), _bos, timeoutMinutes);
       
        if (!wait)
            return;

    // wait until all the results have been processed or if we timed out
    prout.Wait();
    prerr.Wait();
        _bos.flush();
        System.out.flush();

  }
View Full Code Here

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

   */
  private static void execCmdDumpResults (String[] args, int expectedExitCode, boolean printcmd)
        throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        if (printcmd)
            System.out.println(sb.toString());
        else
            System.out.println("org.apache.derby.drda.NetworkServerControl ping...");           
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, timeoutMinutes);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, timeoutMinutes);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();
       
        // wait until the process exits
        pr.waitFor();
       
        // DERBY-214
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        System.out.println(sb.toString());
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, null);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();

  }
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
       bos = null;        
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        System.out.println(sb.toString());
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        bos = new BufferedOutputStream(System.out, 1024);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, null);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();

  }
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
    // Start a process to run the command
    Process pr = execCmd(args);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, null);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();

  }
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        System.out.println(sb.toString());
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, null);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();

  }
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
       bos = null;        
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        System.out.println(sb.toString());
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        bos = new BufferedOutputStream(System.out, 1024);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, null);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();

  }
View Full Code Here

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

   */

  private static void execCmdDumpResults (String[] args) throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
        BufferedOutputStream bos = null;
           
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        System.out.println(sb.toString());
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        bos = new BufferedOutputStream(System.out, 1024);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, null);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();

    bos.close();

  }
View Full Code Here

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

   */
  private static void execCmdDumpResults (String[] args, int expectedExitCode, boolean printcmd)
        throws Exception
  {
        // We need the process inputstream and errorstream
        ProcessStreamResult prout = null;
        ProcessStreamResult prerr = null;
           
        StringBuffer sb = new StringBuffer();
           
        for (int i = 0; i < args.length; i++)
        {
            sb.append(args[i] + " ");                   
        }
        if (printcmd)
            System.out.println(sb.toString());
        else
            System.out.println("org.apache.derby.drda.NetworkServerControl ping...");           
    int totalSize = vCmd.size() + args.length;
    String serverCmd[] = new String[totalSize];
    int i;
    for (i = 0; i < vCmd.size(); i++)
    {
      serverCmd[i] = (String)vCmd.elementAt(i);
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    int j = 0;
    for (; i < totalSize; i++)
    {
      serverCmd[i] = args[j++];
    //  System.out.println("serverCmd["+i+"]: "+serverCmd[i]);
    }
    // Start a process to run the command
    Process pr = Runtime.getRuntime().exec(serverCmd);
        prout = new ProcessStreamResult(pr.getInputStream(), bos, timeoutMinutes);
        prerr = new ProcessStreamResult(pr.getErrorStream(), bos, timeoutMinutes);

    // wait until all the results have been processed
    prout.Wait();
    prerr.Wait();
       
        // wait until the process exits
        pr.waitFor();
       
        // DERBY-214
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.