org.apache.flink.runtime.testutils.CommonTestUtils.PipeForwarder Java Examples

The following examples show how to use org.apache.flink.runtime.testutils.CommonTestUtils.PipeForwarder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestProcessBuilder.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public TestProcess start() throws IOException {
	final ArrayList<String> commands = new ArrayList<>();

	commands.add(javaCommand);
	commands.add(String.format("-Xms%dm", jvmMemory.getMebiBytes()));
	commands.add(String.format("-Xmx%dm", jvmMemory.getMebiBytes()));
	commands.addAll(jvmArgs);
	commands.add(mainClass);
	commands.addAll(mainClassArgs);

	StringWriter processOutput = new StringWriter();
	Process process = new ProcessBuilder(commands).start();
	new PipeForwarder(process.getErrorStream(), processOutput);

	return new TestProcess(process, processOutput);
}
 
Example #2
Source File: TestProcessBuilder.java    From flink with Apache License 2.0 6 votes vote down vote up
public TestProcess start() throws IOException {
	final ArrayList<String> commands = new ArrayList<>();

	commands.add(javaCommand);
	commands.add(String.format("-Xms%dm", jvmMemory.getMebiBytes()));
	commands.add(String.format("-Xmx%dm", jvmMemory.getMebiBytes()));
	commands.addAll(jvmArgs);
	commands.add(mainClass);
	commands.addAll(mainClassArgs);

	StringWriter processOutput = new StringWriter();
	Process process = new ProcessBuilder(commands).start();
	new PipeForwarder(process.getErrorStream(), processOutput);

	return new TestProcess(process, processOutput);
}
 
Example #3
Source File: TestProcessBuilder.java    From flink with Apache License 2.0 6 votes vote down vote up
public TestProcess start() throws IOException {
	final ArrayList<String> commands = new ArrayList<>();

	commands.add(javaCommand);
	commands.add(String.format("-Xms%dm", jvmMemory.getMebiBytes()));
	commands.add(String.format("-Xmx%dm", jvmMemory.getMebiBytes()));
	commands.addAll(jvmArgs);
	commands.add(mainClass);
	commands.addAll(mainClassArgs);

	StringWriter processOutput = new StringWriter();
	StringWriter errorOutput = new StringWriter();
	Process process = new ProcessBuilder(commands).start();
	new PipeForwarder(process.getInputStream(), processOutput);
	new PipeForwarder(process.getErrorStream(), errorOutput);

	return new TestProcess(process, processOutput, errorOutput);
}