use of org.apache.flink.runtime.shuffle.ShuffleEnvironment in project flink by apache.
the class AbstractUdfStreamOperatorLifecycleTest method testLifeCycleFull.
@Test
public void testLifeCycleFull() throws Exception {
ACTUAL_ORDER_TRACKING.clear();
Configuration taskManagerConfig = new Configuration();
StreamConfig cfg = new StreamConfig(new Configuration());
MockSourceFunction srcFun = new MockSourceFunction();
cfg.setStreamOperator(new LifecycleTrackingStreamSource<>(srcFun, true));
cfg.setOperatorID(new OperatorID());
cfg.setTimeCharacteristic(TimeCharacteristic.ProcessingTime);
try (ShuffleEnvironment shuffleEnvironment = new NettyShuffleEnvironmentBuilder().build()) {
Task task = StreamTaskTest.createTask(SourceStreamTask.class, shuffleEnvironment, cfg, taskManagerConfig);
task.startTaskThread();
LifecycleTrackingStreamSource.runStarted.await();
// wait for clean termination
task.getExecutingThread().join();
assertEquals(ExecutionState.FINISHED, task.getExecutionState());
assertEquals(EXPECTED_CALL_ORDER_FULL, ACTUAL_ORDER_TRACKING);
}
}
Aggregations