Package org.apache.derbyTesting.functionTests.harness

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


   */

  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

   */

  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

     * @exception Exception
     */
    public static void execCmdDumpResults(String[] args, Vector vCmd,
            BufferedOutputStream bos) 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 = 0;
        for (i = 0; i < vCmd.size(); i++)
            serverCmd[i] = (String) vCmd.elementAt(i);

        for (int j = 0; i < totalSize; i++)
            serverCmd[i] = args[j++];

        System.out.flush();
        bos.flush();

        // 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.
View Full Code Here

   */

  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

   */

  private static void execCmdDumpResults (String[] args, BufferedOutputStream buf) 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(), buf, null);
        prerr = new ProcessStreamResult(pr.getErrorStream(), buf, null);

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

  }
View Full Code Here

  private static void execCmdDumpResults (String[] args, int expectedExitCode)
        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();
       
        // wait until the process exits
        pr.waitFor();
       
        // DERBY-214
View Full Code Here

   */

  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

   */

  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

   */

  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

TOP

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

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.