Search in sources :

Example 1 with TestEnvironment

use of org.apache.flink.test.util.TestEnvironment in project flink by apache.

the class CassandraConnectorITCase method initializeExecutionEnvironment.

// ------------------------------------------------------------------------
//  Test preparation & cleanup
// ------------------------------------------------------------------------
@Before
public void initializeExecutionEnvironment() {
    TestStreamEnvironment.setAsContext(flinkCluster, 4);
    new TestEnvironment(flinkCluster, 4, false).setAsContext();
}
Also used : TestEnvironment(org.apache.flink.test.util.TestEnvironment) Before(org.junit.Before)

Example 2 with TestEnvironment

use of org.apache.flink.test.util.TestEnvironment in project flink by apache.

the class MiniClusterExtension method registerEnv.

// Implementation
private void registerEnv(InternalMiniClusterExtension internalMiniClusterExtension) {
    TestEnvironment executionEnvironment = new TestEnvironment(internalMiniClusterExtension.getMiniCluster(), internalMiniClusterExtension.getNumberSlots(), false);
    executionEnvironment.setAsContext();
    TestStreamEnvironment.setAsContext(internalMiniClusterExtension.getMiniCluster(), internalMiniClusterExtension.getNumberSlots());
}
Also used : TestEnvironment(org.apache.flink.test.util.TestEnvironment)

Example 3 with TestEnvironment

use of org.apache.flink.test.util.TestEnvironment in project flink by apache.

the class CustomDistributionITCase method prepare.

@Before
public void prepare() {
    TestEnvironment clusterEnv = new TestEnvironment(cluster, 1);
    clusterEnv.setAsContext();
}
Also used : TestEnvironment(org.apache.flink.test.util.TestEnvironment) Before(org.junit.Before)

Example 4 with TestEnvironment

use of org.apache.flink.test.util.TestEnvironment in project flink by apache.

the class BatchFineGrainedRecoveryITCase method createExecutionEnvironment.

private static ExecutionEnvironment createExecutionEnvironment() {
    @SuppressWarnings("StaticVariableUsedBeforeInitialization") ExecutionEnvironment env = new TestEnvironment(miniCluster, 1, true);
    env.setRestartStrategy(RestartStrategies.fixedDelayRestart(MAX_JOB_RESTART_ATTEMPTS, Time.milliseconds(10)));
    env.getConfig().setExecutionMode(// forces all partitions to be blocking
    ExecutionMode.BATCH_FORCED);
    return env;
}
Also used : ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) TestEnvironment(org.apache.flink.test.util.TestEnvironment)

Aggregations

TestEnvironment (org.apache.flink.test.util.TestEnvironment)4 Before (org.junit.Before)2 ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)1