|
@@ -153,60 +153,4 @@ public class TestLocalFileSystem extends TestCase {
|
|
|
assertEquals(path.makeQualified(fs), status.getPath());
|
|
|
cleanupFile(fs, path);
|
|
|
}
|
|
|
-
|
|
|
- /* Renaming this in order to temporarily disable the test
|
|
|
- * until is append() is fixed for LocalFileSystem. See
|
|
|
- * HADOOP-4292.
|
|
|
- */
|
|
|
- public void disabledTestAppend() throws IOException {
|
|
|
-
|
|
|
- Configuration conf = new Configuration();
|
|
|
- final String dir = TEST_ROOT_DIR + "/append";
|
|
|
- LocalFileSystem fs = FileSystem.getLocal(conf);
|
|
|
-
|
|
|
- //normal case
|
|
|
- {
|
|
|
- Path f = new Path(dir, "f");
|
|
|
- FSDataOutputStream out = fs.create(f);
|
|
|
- out.writeBytes("something");
|
|
|
- out.close();
|
|
|
- assertEquals("something", readFile(fs, f));
|
|
|
-
|
|
|
- out = fs.append(f);
|
|
|
- out.writeBytes(" more");
|
|
|
- out.close();
|
|
|
- assertEquals("something more", readFile(fs, f));
|
|
|
-
|
|
|
- out = fs.append(f);
|
|
|
- out.writeBytes(" and more");
|
|
|
- out.close();
|
|
|
- assertEquals("something more and more", readFile(fs, f));
|
|
|
-
|
|
|
- cleanupFile(fs, f);
|
|
|
- }
|
|
|
-
|
|
|
- //file not found case
|
|
|
- {
|
|
|
- Path f = new Path(dir, "fileNotFound");
|
|
|
- try {
|
|
|
- fs.append(f);
|
|
|
- assertTrue(false);
|
|
|
- }
|
|
|
- catch(FileNotFoundException e) {
|
|
|
- System.out.println("good: " + e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //append to dir case
|
|
|
- {
|
|
|
- Path f = new Path(dir);
|
|
|
- try {
|
|
|
- fs.append(f);
|
|
|
- assertTrue(false);
|
|
|
- }
|
|
|
- catch(IOException e) {
|
|
|
- System.out.println("good: " + e);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|