Java Code Examples for org.apache.flink.client.cli.CliFrontendTestUtils

The following examples show how to use org.apache.flink.client.cli.CliFrontendTestUtils. These examples are extracted from open source projects. 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 Project: Flink-CEPplus   Source File: PackagedProgramTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testGetPreviewPlan() {
	try {
		PackagedProgram prog = new PackagedProgram(new File(CliFrontendTestUtils.getTestJarPath()));

		final PrintStream out = System.out;
		final PrintStream err = System.err;
		try {
			System.setOut(new PrintStream(new NullOutputStream()));
			System.setErr(new PrintStream(new NullOutputStream()));

			Assert.assertNotNull(prog.getPreviewPlan());
		}
		finally {
			System.setOut(out);
			System.setErr(err);
		}
	}
	catch (Exception e) {
		System.err.println(e.getMessage());
		e.printStackTrace();
		Assert.fail("Test is erroneous: " + e.getMessage());
	}
}
 
Example 2
Source Project: flink   Source File: PackagedProgramTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testGetPreviewPlan() {
	try {
		PackagedProgram prog = new PackagedProgram(new File(CliFrontendTestUtils.getTestJarPath()));

		final PrintStream out = System.out;
		final PrintStream err = System.err;
		try {
			System.setOut(new PrintStream(new NullOutputStream()));
			System.setErr(new PrintStream(new NullOutputStream()));

			Assert.assertNotNull(prog.getPreviewPlan());
		}
		finally {
			System.setOut(out);
			System.setErr(err);
		}
	}
	catch (Exception e) {
		System.err.println(e.getMessage());
		e.printStackTrace();
		Assert.fail("Test is erroneous: " + e.getMessage());
	}
}
 
Example 3
Source Project: flink   Source File: ApplicationDispatcherBootstrapTest.java    License: Apache License 2.0 5 votes vote down vote up
private PackagedProgram getProgram(int noOfJobs) throws FlinkException {
	try {
		return PackagedProgram.newBuilder()
				.setUserClassPaths(Collections.singletonList(new File(CliFrontendTestUtils.getTestJarPath()).toURI().toURL()))
				.setEntryPointClassName(MULTI_EXECUTE_JOB_CLASS_NAME)
				.setArguments(String.valueOf(noOfJobs))
				.build();
	} catch (ProgramInvocationException | FileNotFoundException | MalformedURLException e) {
		throw new FlinkException("Could not load the provided entrypoint class.", e);
	}
}
 
Example 4
Source Project: Flink-CEPplus   Source File: CliFrontendRunWithYarnTest.java    License: Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void init() {
	CliFrontendTestUtils.pipeSystemOutToNull();
}
 
Example 5
Source Project: Flink-CEPplus   Source File: CliFrontendRunWithYarnTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void shutdown() {
	CliFrontendTestUtils.restoreSystemOut();
}
 
Example 6
Source Project: flink   Source File: CliFrontendRunWithYarnTest.java    License: Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void init() {
	CliFrontendTestUtils.pipeSystemOutToNull();
}
 
Example 7
Source Project: flink   Source File: CliFrontendRunWithYarnTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void shutdown() {
	CliFrontendTestUtils.restoreSystemOut();
}
 
Example 8
Source Project: flink   Source File: PackagedProgramTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void testNotThrowExceptionWhenJarFileIsNull() throws Exception {
	PackagedProgram.newBuilder()
		.setUserClassPaths(Collections.singletonList(new File(CliFrontendTestUtils.getTestJarPath()).toURI().toURL()))
		.setEntryPointClassName(TEST_JAR_MAIN_CLASS);
}
 
Example 9
Source Project: flink   Source File: CliFrontendRunWithYarnTest.java    License: Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void init() {
	CliFrontendTestUtils.pipeSystemOutToNull();
}
 
Example 10
Source Project: flink   Source File: CliFrontendRunWithYarnTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void shutdown() {
	CliFrontendTestUtils.restoreSystemOut();
}