flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CompletedCheckpointTest.java
/**
	 * Tests that the stats callbacks happen if the callback is registered.
	 */
Tests that the stats callbacks happen if the callback is registered.
Tests that the stats callbacks happen if the callback is registered .
@Test
	public void testCompletedCheckpointStatsCallbacks() throws Exception {
		OperatorState state = mock(OperatorState.class);
		Map<OperatorID, OperatorState> operatorStates = new HashMap<>();
		operatorStates.put(new OperatorID(), state);
		CompletedCheckpoint completed = new CompletedCheckpoint(
			new JobID(),
			0,
			0,
			1,
			new HashMap<>(operatorStates),
			Collections.<MasterState>emptyList(),
			CheckpointProperties.forStandardCheckpoint(),
			null,
			null);
		CompletedCheckpointStats.DiscardCallback callback = mock(CompletedCheckpointStats.DiscardCallback.class);
		completed.setDiscardCallback(callback);
		completed.discardOnShutdown(JobStatus.FINISHED);
		verify(callback, times(1)).notifyDiscardedCheckpoint();
	}
@ Test public void testCompletedCheckpointStatsCallbacks ( ) throws Exception { OperatorState state = mock ( OperatorState . class ) ; Map < OperatorID , OperatorState > operatorStates = new HashMap < > ( ) ; operatorStates . put ( new OperatorID ( ) , state ) ; CompletedCheckpoint completed = new CompletedCheckpoint ( new JobID ( ) , 0 , 0 , 1 , new HashMap < > ( operatorStates ) , Collections . < MasterState > emptyList ( ) , CheckpointProperties . forStandardCheckpoint ( ) , null , null ) ; CompletedCheckpointStats . DiscardCallback callback = mock ( CompletedCheckpointStats . DiscardCallback . class ) ; completed . setDiscardCallback ( callback ) ; completed . discardOnShutdown ( JobStatus . FINISHED ) ; verify ( callback , times ( 1 ) ) . notifyDiscardedCheckpoint ( ) ; }
Tests that the stats callbacks happen if the callback is registered.
Tests that the stats callbacks happen if the callback is registered .