/** * Launches a process by using a {@linkplain ProcStarter builder-pattern} to configure * the parameters. */ @Nonnull public final ProcStarter launch() { return new ProcStarter(); }
/** * Copies a {@link ProcStarter}. */ @Nonnull public ProcStarter copy() { ProcStarter rhs = new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs).quiet(quiet); rhs.stdoutListener = stdoutListener; rhs.reverseStdin = this.reverseStdin; rhs.reverseStderr = this.reverseStderr; rhs.reverseStdout = this.reverseStdout; return rhs; } }
/** * Launches a process by using a {@linkplain ProcStarter builder-pattern} to configure * the parameters. */ @Nonnull public final ProcStarter launch() { return new ProcStarter(); }
private ProcReturn execCommand(boolean quiet, String... cmd) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); Launcher launcher = decorator .decorate(new DummyLauncher(new StreamTaskListener(new TeeOutputStream(out, System.out))), null); ContainerExecProc proc = (ContainerExecProc) launcher .launch(launcher.new ProcStarter().pwd("/tmp").cmds(cmd).quiet(quiet)); // wait for proc to finish (shouldn't take long) while (proc.isAlive()) { Thread.sleep(100); } assertFalse("proc is alive", proc.isAlive()); int exitCode = proc.joinWithTimeout(10, TimeUnit.SECONDS, StreamTaskListener.fromStderr()); return new ProcReturn(proc, exitCode, out.toString()); }
/** * Launches a process by using a {@linkplain ProcStarter builder-pattern} to configure * the parameters. */ public final ProcStarter launch() { return new ProcStarter(); }
/** * Copies a {@link ProcStarter}. */ public ProcStarter copy() { return new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs); } }
/** * Copies a {@link ProcStarter}. */ public ProcStarter copy() { return new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs); } }
/** * Copies a {@link ProcStarter}. */ @Nonnull public ProcStarter copy() { ProcStarter rhs = new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs).quiet(quiet); rhs.reverseStdin = this.reverseStdin; rhs.reverseStderr = this.reverseStderr; rhs.reverseStdout = this.reverseStdout; return rhs; } }
/** * Launches a process by using a {@linkplain ProcStarter builder-pattern} to * configure the parameters. */ public final ProcStarter launch() { return new ProcStarter(); }
/** * Launches a process by using a {@linkplain ProcStarter builder-pattern} to configure * the parameters. */ public final ProcStarter launch() { return new ProcStarter(); }
/** * Launches a process by using a {@linkplain ProcStarter builder-pattern} to configure * the parameters. */ public final ProcStarter launch() { return new ProcStarter(); }
/** * Copies a {@link ProcStarter}. */ public ProcStarter copy() { return new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs); } }
/** * Copies a {@link ProcStarter}. */ public ProcStarter copy() { return new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs); } }