@Test public void runProcess_NotifiesListenerOfOutput() throws IOException { String[] command = new String[] {"java", "-version"}; StringBuilder output = new StringBuilder(); ProcessOutputListener listener = (message, error) -> output.append(message); ProcessRunner.ExecutionResult executionResult = ProcessRunner.run(command).outputListener(listener).runAndWait(); assertEquals(executionResult.getExitCode(), 0); assertTrue(output.toString().startsWith("java version ")); }
public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); } }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }  }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }  static ExecutionBuilder run(String... command); }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }  static ExecutionBuilder run(String... command);  }