Examples of redirectInput()


Examples of org.zeroturnaround.exec.ProcessExecutor.redirectInput()

    ByteArrayInputStream bais = new ByteArrayInputStream(str.getBytes());
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    ProcessExecutor exec = new ProcessExecutor("java", "-cp", "target/test-classes",
        PrintInputToOutput.class.getName());
    exec.redirectInput(bais).redirectOutput(baos);

    exec.execute();
    Assert.assertEquals(str, baos.toString());
  }
}
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.