Examples of outputUTF8()


Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

  }

  @Test
  public void testJavaVersionOutput() throws Exception {
    ProcessResult result = new ProcessExecutor().command("java", "-version").readOutput(true).execute();
    String str = result.outputUTF8();
    Assert.assertFalse(StringUtils.isEmpty(str));
  }

  @Test
  public void testJavaVersionOutputTwice() throws Exception {
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

  @Test
  public void testJavaVersionOutputTwice() throws Exception {
    ProcessExecutor executor = new ProcessExecutor().command("java", "-version").readOutput(true);
    ProcessResult result = executor.execute();
    String str = result.outputUTF8();
    Assert.assertFalse(StringUtils.isEmpty(str));
    Assert.assertEquals(str, executor.execute().outputUTF8());
  }

  @Test
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

  }

  @Test
  public void testJavaVersionOutputFuture() throws Exception {
    ProcessResult result = new ProcessExecutor().command("java", "-version").readOutput(true).start().getFuture().get();
    String str = result.outputUTF8();
    Assert.assertFalse(StringUtils.isEmpty(str));
  }

  @Test
  public void testJavaVersionLogInfo() throws Exception {
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

  @Test
  public void testJavaVersionLogInfoAndOutput() throws Exception {
    // Just expect no errors - don't check the log file itself
    ProcessResult result = new ProcessExecutor().command("java", "-version").redirectOutput(Slf4jStream.of("testJavaVersionLogInfoAndOutput").asInfo()).readOutput(true).execute();
    String str = result.outputUTF8();
    Assert.assertFalse(StringUtils.isEmpty(str));
  }

  @Test
  public void testJavaVersionLogInfoAndOutputFuture() throws Exception {
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

  @Test
  public void testJavaVersionLogInfoAndOutputFuture() throws Exception {
    // Just expect no errors - don't check the log file itself
    ProcessResult result = new ProcessExecutor().command("java", "-version").redirectOutput(Slf4jStream.of("testJavaVersionLogInfoAndOutputFuture").asInfo()).readOutput(true).start().getFuture().get();
    String str = result.outputUTF8();
    Assert.assertFalse(StringUtils.isEmpty(str));
  }

  @Test
  public void testJavaVersionNoStreams() throws Exception {
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

        add(HelloWorld.class.getName());
      }
    };
    ProcessExecutor exec = new ProcessExecutor(args);
    ProcessResult result = exec.readOutput(true).execute();
    Assert.assertEquals("Hello world!", result.outputUTF8());
  }

  @Test
  public void testProcessExecutorCommand() throws Exception {
    // Use timeout in case we get stuck
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

      }
    };
    ProcessExecutor exec = new ProcessExecutor();
    exec.command(args);
    ProcessResult result = exec.readOutput(true).execute();
    Assert.assertEquals("Hello world!", result.outputUTF8());
  }

  @Test
  public void testProcessExecutorSetDirectory() throws Exception {
    // Use timeout in case we get stuck
View Full Code Here

Examples of org.zeroturnaround.exec.ProcessResult.outputUTF8()

      }
    };
    ProcessExecutor exec = new ProcessExecutor().directory(new File("target"));
    exec.command(args);
    ProcessResult result = exec.readOutput(true).execute();
    Assert.assertEquals("Hello world!", result.outputUTF8());
  }
}
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.