Examples of ExternalCommand


Examples of com.linkedin.helix.ExternalCommand

    String testName = className + "_" + methodName;

    System.out.println("START " + testName + " at "
        + new Date(System.currentTimeMillis()));

    ExternalCommand cmd = ScriptTestHelper.runCommandLineTest("helix_random_kill_local_startzk.sh");
    String output = cmd.getStringOutput("UTF8");
    int i = getStateTransitionLatency(0, output);
    int j = output.indexOf("ms", i);
    long latency = Long.parseLong(output.substring(i, j));
    System.out.println("startup latency: " + latency);
View Full Code Here

Examples of com.linkedin.helix.ExternalCommand

    String testName = className + "_" + methodName;
   
    System.out.println("START " + testName + " at "
        + new Date(System.currentTimeMillis()));

    ExternalCommand cmd = ScriptTestHelper.runCommandLineTest("dummy.sh");
    String output = cmd.getStringOutput("UTF8");
    int idx = output.indexOf("this is a dummy test for verify ExternalCommand works");
    Assert.assertNotSame(idx, -1);
   
    System.out.println("END " + testName + " at "
        + new Date(System.currentTimeMillis()));
View Full Code Here

Examples of net.fenyo.gnetwatch.actions.ExternalCommand

  public Capture(final Config config, final CaptureManager manager, final int device, final String filter) {
    this.config = config;
    this.manager = manager;
    // to convert device to a string, we use the following expression : "" + device
//    cmd = new ExternalCommand(new String [] { "tethereal", "-i", "" + device, "-T", "psml" }, true);
    cmd = new ExternalCommand(new String [] { "tethereal", "-i", "" + device, "-T", "pdml", "-R", "\"" + filter + "\"" }, true);
  }
View Full Code Here

Examples of net.fenyo.gnetwatch.actions.ExternalCommand

   * @throws InterruptedException exception.
   */
  // GUI thread
  public static String [] listDevices() throws InterruptedException {
    final String devices =
      new ExternalCommand(new String [] { "tethereal", "-D" }, true).runStdout();
    return devices == null ? null : devices.split("\n");
  }
View Full Code Here

Examples of net.sf.pipet.modules.ExternalCommand

  @Override
  public ModuleInterface getModuleInterface(String uri, Configuration cfg)
    throws ResourceException
  {
    return new ExternalCommand(cfg, uri);
  }
View Full Code Here

Examples of org.apache.helix.ExternalCommand

    String testName = className + "_" + methodName;
   
    System.out.println("START " + testName + " at "
        + new Date(System.currentTimeMillis()));

    ExternalCommand cmd = ScriptTestHelper.runCommandLineTest("helix_random_kill_local_startzk.sh");
    String output = cmd.getStringOutput("UTF8");
    int i = getStateTransitionLatency(0, output);
    int j = output.indexOf("ms", i);
    long latency = Long.parseLong(output.substring(i, j));
    System.out.println("startup latency: " + latency);
   
View Full Code Here

Examples of org.apache.helix.ExternalCommand

    String testName = className + "_" + methodName;
   
    System.out.println("START " + testName + " at "
        + new Date(System.currentTimeMillis()));

    ExternalCommand cmd = ScriptTestHelper.runCommandLineTest("dummy.sh");
    String output = cmd.getStringOutput("UTF8");
    int idx = output.indexOf("this is a dummy test for verify ExternalCommand works");
    Assert.assertNotSame(idx, -1);
   
    System.out.println("END " + testName + " at "
        + new Date(System.currentTimeMillis()));
View Full Code Here

Examples of org.apache.helix.ExternalCommand

    }
  }

  public static ProcessStateCode getProcessState(String processId) throws Exception {
    if (OS_NAME.equals("Mac OS X") || OS_NAME.equals("Linux")) {
      ExternalCommand cmd = ExternalCommand.start("ps", processId);
      cmd.waitFor();

      // split by new lines
      // should return 2 lines for an existing process, or 1 line for a non-existing process
      String lines[] = cmd.getStringOutput().split("[\\r\\n]+");
      if (lines.length != 2) {
        LOG.info("process: " + processId + " not exist");
        return null;
      }
View Full Code Here

Examples of org.apache.helix.ExternalCommand

        timeoutValue = Long.parseLong(timeout);
      } catch (NumberFormatException e) {
        // OK to use 0
      }
    }
    ExternalCommand externalCmd =
        ExternalCommand.executeWithTimeout(new File(workingDir), cmdValue, timeoutValue, args);

    int exitValue = externalCmd.exitValue();

    // debug
    // System.out.println("command: " + cmd + ", exitValue: " + exitValue
    // + " output:\n" + externalCmd.getStringOutput());

    if (_logger.isDebugEnabled()) {
      _logger.debug("command: " + cmd + ", exitValue: " + exitValue + " output:\n"
          + externalCmd.getStringOutput());
    }

    // monitor pid if pidFile exists
    if (pidFile == null) {
      // no pid to monitor
View Full Code Here

Examples of org.apache.helix.ExternalCommand

    String methodName = TestHelper.getTestMethodName();
    String testName = className + "_" + methodName;

    System.out.println("START " + testName + " at " + new Date(System.currentTimeMillis()));

    ExternalCommand cmd = ScriptTestHelper.runCommandLineTest("helix_random_kill_local_startzk.sh");
    String output = cmd.getStringOutput("UTF8");
    int i = getStateTransitionLatency(0, output);
    int j = output.indexOf("ms", i);
    long latency = Long.parseLong(output.substring(i, j));
    System.out.println("startup latency: " + latency);
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.