use of org.apache.flink.api.common.operators.util.TestNonRichInputFormat in project flink by apache.
the class RemoteEnvironmentITCase method testInvalidAkkaConfiguration.
/**
* Ensure that that Akka configuration parameters can be set.
*/
@Test(expected = IllegalArgumentException.class)
public void testInvalidAkkaConfiguration() throws Throwable {
Configuration config = new Configuration();
config.setString(ConfigConstants.AKKA_STARTUP_TIMEOUT, INVALID_STARTUP_TIMEOUT);
final ExecutionEnvironment env = ExecutionEnvironment.createRemoteEnvironment(cluster.hostname(), cluster.getLeaderRPCPort(), config);
env.getConfig().disableSysoutLogging();
DataSet<String> result = env.createInput(new TestNonRichInputFormat());
result.output(new LocalCollectionOutputFormat<String>(new ArrayList<String>()));
try {
env.execute();
Assert.fail("Program should not run successfully, cause of invalid akka settings.");
} catch (IOException ex) {
throw ex.getCause();
}
}
use of org.apache.flink.api.common.operators.util.TestNonRichInputFormat in project flink by apache.
the class GenericDataSourceBaseTest method testDataSourcePlain.
@Test
public void testDataSourcePlain() {
try {
TestNonRichInputFormat in = new TestNonRichInputFormat();
GenericDataSourceBase<String, TestNonRichInputFormat> source = new GenericDataSourceBase<String, TestNonRichInputFormat>(in, new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO), "testSource");
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.disableObjectReuse();
List<String> resultMutableSafe = source.executeOnCollections(null, executionConfig);
in.reset();
executionConfig.enableObjectReuse();
List<String> resultRegular = source.executeOnCollections(null, executionConfig);
assertEquals(asList(TestIOData.NAMES), resultMutableSafe);
assertEquals(asList(TestIOData.NAMES), resultRegular);
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of org.apache.flink.api.common.operators.util.TestNonRichInputFormat in project flink by apache.
the class InputOutputITCase method testProgram.
@Override
protected void testProgram() throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
TestNonRichOutputFormat output = new TestNonRichOutputFormat();
env.createInput(new TestNonRichInputFormat()).output(output);
try {
env.execute();
} catch (Exception e) {
// we didn't break anything by making everything rich.
e.printStackTrace();
fail(e.getMessage());
}
}
Aggregations