flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsSavepointStreamFactoryTest.java
/**
	 * Tests that the factory creates all files in the given directory without
	 * creating any sub directories.
	 */
Tests that the factory creates all files in the given directory without
creating any sub directories.
Tests that the factory creates all files in the given directory without creating any sub directories .
@Test
	public void testSavepointStreamDirectoryLayout() throws Exception {
		File testRoot = folder.newFolder();
		JobID jobId = new JobID();
		FsSavepointStreamFactory savepointStreamFactory = new FsSavepointStreamFactory(
				new Path(testRoot.getAbsolutePath()),
				jobId,
				0);
		Path root = new Path(testRoot.getAbsolutePath());
		FileStatus[] listed = root.getFileSystem().listStatus(root);
		assertNotNull(listed);
		assertEquals(0, listed.length);
		FsCheckpointStateOutputStream stream = savepointStreamFactory
			.createCheckpointStateOutputStream(1273, 19231);
		stream.write(1);
		FileStateHandle handle = (FileStateHandle) stream.closeAndGetHandle();
		listed = root.getFileSystem().listStatus(root);
		assertNotNull(listed);
		assertEquals(1, listed.length);
		assertEquals(handle.getFilePath().getPath(), listed[0].getPath().getPath());
	}
@ Test public void testSavepointStreamDirectoryLayout ( ) throws Exception { File testRoot = folder . newFolder ( ) ; JobID jobId = new JobID ( ) ; FsSavepointStreamFactory savepointStreamFactory = new FsSavepointStreamFactory ( new Path ( testRoot . getAbsolutePath ( ) ) , jobId , 0 ) ; Path root = new Path ( testRoot . getAbsolutePath ( ) ) ; FileStatus [ ] listed = root . getFileSystem ( ) . listStatus ( root ) ; assertNotNull ( listed ) ; assertEquals ( 0 , listed . length ) ; FsCheckpointStateOutputStream stream = savepointStreamFactory . createCheckpointStateOutputStream ( 1273 , 19231 ) ; stream . write ( 1 ) ; FileStateHandle handle = ( FileStateHandle ) stream . closeAndGetHandle ( ) ; listed = root . getFileSystem ( ) . listStatus ( root ) ; assertNotNull ( listed ) ; assertEquals ( 1 , listed . length ) ; assertEquals ( handle . getFilePath ( ) . getPath ( ) , listed [ 0 ] . getPath ( ) . getPath ( ) ) ; }
Tests that the factory creates all files in the given directory without
 creating any sub directories.
Tests that the factory creates all files in the given directory without creating any sub directories .