Examples of ProcessExecutor


Examples of org.zeroturnaround.exec.ProcessExecutor

    Assert.assertEquals("Hello ", new String(out.toByteArray()));
    Assert.assertEquals("world!", new String(err.toByteArray()));
  }

  private ProcessExecutor helloWorld() {
    return new ProcessExecutor("java", "-cp", "target/test-classes", HelloWorld.class.getName());
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

public class ProcessExecutorExitValueTest {

  @Test(expected=InvalidExitValueException.class)
  public void testJavaVersionExitValueCheck() throws Exception {
    new ProcessExecutor().command("java", "-version").exitValues(3).execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

    new ProcessExecutor().command("java", "-version").exitValues(3).execute();
  }

  @Test(expected=InvalidExitValueException.class)
  public void testJavaVersionExitValueCheckTimeout() throws Exception {
    new ProcessExecutor().command("java", "-version").exitValues(3).timeout(60, TimeUnit.SECONDS).execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

  public void testJavaVersionExitValueCheckTimeout() throws Exception {
    new ProcessExecutor().command("java", "-version").exitValues(3).timeout(60, TimeUnit.SECONDS).execute();
  }

  public void testNonZeroExitValueByDefault() throws Exception {
    new ProcessExecutor(exitLikeABoss(17)).execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

    new ProcessExecutor(exitLikeABoss(17)).execute();
  }

  @Test
  public void testCustomExitValueValid() throws Exception {
    new ProcessExecutor(exitLikeABoss(17)).exitValues(17).execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

    new ProcessExecutor(exitLikeABoss(17)).exitValues(17).execute();
  }

  @Test(expected=InvalidExitValueException.class)
  public void testCustomExitValueInvalid() throws Exception {
    new ProcessExecutor(exitLikeABoss(17)).exitValues(15).execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

public class ProcessExecutorMainTest {

  @Test(expected=IllegalStateException.class)
  public void testNoCommand() throws Exception {
    new ProcessExecutor().execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

    new ProcessExecutor().execute();
  }

  @Test(expected=IOException.class)
  public void testNoSuchFile() throws Exception {
    new ProcessExecutor().command("unknown command").execute();
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

    new ProcessExecutor().command("unknown command").execute();
  }

  @Test
  public void testJavaVersion() throws Exception {
    int exit = new ProcessExecutor().command("java", "-version").execute().getExitValue();
    Assert.assertEquals(0, exit);
  }
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessExecutor

    Assert.assertEquals(0, exit);
  }

  @Test
  public void testJavaVersionCommandSplit() throws Exception {
    int exit = new ProcessExecutor().commandSplit("java -version").execute().getExitValue();
    Assert.assertEquals(0, exit);
  }
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.