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 persistent checkpoints discard their header file.
	 */
Tests that persistent checkpoints discard their header file.
Tests that persistent checkpoints discard their header file .
@Test
	public void testDiscard() throws Exception {
		File file = tmpFolder.newFile();
		assertEquals(true, file.exists());
		OperatorState state = mock(OperatorState.class);
		Map<OperatorID, OperatorState> taskStates = new HashMap<>();
		taskStates.put(new OperatorID(), state);
		CompletedCheckpoint checkpoint = new CompletedCheckpoint(
				new JobID(), 0, 0, 1,
				taskStates,
				Collections.<MasterState>emptyList(),
				CheckpointProperties.forStandardCheckpoint(),
				new FileStateHandle(new Path(file.toURI()), file.length()),
				file.getAbsolutePath());
		checkpoint.discardOnShutdown(JobStatus.FAILED);
		assertEquals(false, file.exists());
	}
@ Test public void testDiscard ( ) throws Exception { File file = tmpFolder . newFile ( ) ; assertEquals ( true , file . exists ( ) ) ; OperatorState state = mock ( OperatorState . class ) ; Map < OperatorID , OperatorState > taskStates = new HashMap < > ( ) ; taskStates . put ( new OperatorID ( ) , state ) ; CompletedCheckpoint checkpoint = new CompletedCheckpoint ( new JobID ( ) , 0 , 0 , 1 , taskStates , Collections . < MasterState > emptyList ( ) , CheckpointProperties . forStandardCheckpoint ( ) , new FileStateHandle ( new Path ( file . toURI ( ) ) , file . length ( ) ) , file . getAbsolutePath ( ) ) ; checkpoint . discardOnShutdown ( JobStatus . FAILED ) ; assertEquals ( false , file . exists ( ) ) ; }
Tests that persistent checkpoints discard their header file.
Tests that persistent checkpoints discard their header file .
// Verify discard call is forwarded to state