@Test public void testRandomAccessWrites() throws IOException { int i = 0; try { for (; i < 10; i++) { Directory fsDir = FSDirectory.open(new File(file, "normal")); String name = getName(); createFile(name, fsDir, directory); assertInputsEquals(name, fsDir, directory); } } catch (Exception e) { e.printStackTrace(); fail("Test failed with seed [" + seed + "] on pass [" + i + "]"); } }
@Test public void testEOF() throws IOException { Directory fsDir = FSDirectory.open(new File(file, "normal")); String name = "test.eof"; createFile(name, fsDir, directory); long fsLength = fsDir.fileLength(name); long hdfsLength = directory.fileLength(name); assertEquals(fsLength, hdfsLength); testEof(name, fsDir, fsLength); testEof(name, directory, hdfsLength); }