hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r939803 - in /hadoop/hdfs/trunk: CHANGES.txt src/test/aop/org/apache/hadoop/fs/TestFiRename.java src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java
Date Fri, 30 Apr 2010 20:30:48 GMT
Author: hairong
Date: Fri Apr 30 20:30:48 2010
New Revision: 939803

URL: http://svn.apache.org/viewvc?rev=939803&view=rev
Log:
HDFS-1089. Remove uses of FileContext#isFile, isDirectory and exists. Contributed by Eli Collins.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java
    hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=939803&r1=939802&r2=939803&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Fri Apr 30 20:30:48 2010
@@ -162,6 +162,9 @@ Trunk (unreleased changes)
     HDFS-1100. Override unwrapException in TestFcHdfsSymlink to test 
     symlink API conformance. (Eli Collins via suresh).
 
+    HDFS-1089. Remove uses of FileContext#isFile, isDirectory, and exists.
+    (Eli Collins via hairong)
+
   OPTIMIZATIONS
 
     HDFS-946. NameNode should not return full path name when lisitng a

Modified: hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java?rev=939803&r1=939802&r2=939803&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java (original)
+++ hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java Fri Apr 30 20:30:48
2010
@@ -31,6 +31,8 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.apache.hadoop.fs.FileContextTestHelper.*;
+
 /**
  * Rename names src to dst. Rename is done using following steps:
  * <ul>
@@ -206,7 +208,7 @@ public class TestFiRename {
     dst = getTestPath("testDeletionOfDstFile/newdir/dst");
     while (exception && count < 5) {
       try {
-        fc.exists(src);
+        exists(fc, src);
         exception = false;
       } catch (Exception e) {
         LOG.warn("Exception " + " count " + count + " " + e.getMessage());
@@ -214,8 +216,8 @@ public class TestFiRename {
         count++;
       }
     }
-    Assert.assertFalse(fc.exists(src));
-    Assert.assertTrue(fc.exists(dst));
+    Assert.assertFalse(exists(fc, src));
+    Assert.assertTrue(exists(fc, dst));
   }
 
   /** Rename test where both src and dst are directories */
@@ -242,7 +244,7 @@ public class TestFiRename {
     boolean exception = true;
     while (exception && count < 5) {
       try {
-        fc.exists(src);
+        exists(fc, src);
         exception = false;
       } catch (Exception e) {
         LOG.warn("Exception " + " count " + count + " " + e.getMessage());
@@ -250,8 +252,8 @@ public class TestFiRename {
         count++;
       }
     }
-    Assert.assertFalse(fc.exists(src));
-    Assert.assertTrue(fc.exists(dst));
+    Assert.assertFalse(exists(fc, src));
+    Assert.assertTrue(exists(fc, dst));
   }
 
   private void rename(Path src, Path dst, boolean exception, boolean srcExists,
@@ -263,7 +265,7 @@ public class TestFiRename {
       LOG.warn("Exception ", e);
       Assert.assertTrue(exception);
     }
-    Assert.assertEquals(srcExists, fc.exists(src));
-    Assert.assertEquals(dstExists, fc.exists(dst));
+    Assert.assertEquals(srcExists, exists(fc, src));
+    Assert.assertEquals(dstExists, exists(fc, dst));
   }
 }

Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java?rev=939803&r1=939802&r2=939803&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java
(original)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java
Fri Apr 30 20:30:48 2010
@@ -40,7 +40,7 @@ import org.junit.Test;
 import static org.apache.hadoop.fs.FileContextTestHelper.*;
 
 public class TestHDFSFileContextMainOperations extends
-                                  FileContextMainOperationsBaseTest {
+    FileContextMainOperationsBaseTest {
   private static MiniDFSCluster cluster;
   private static Path defaultWorkingDirectory;
   private static HdfsConfiguration CONF = new HdfsConfiguration();
@@ -259,8 +259,8 @@ public class TestHDFSFileContextMainOper
     } catch (Exception ex) {
       Assert.assertTrue(exception);
     }
-    Assert.assertEquals(renameSucceeds, !fc.exists(src));
-    Assert.assertEquals(renameSucceeds, fc.exists(dst));
+    Assert.assertEquals(renameSucceeds, !exists(fc, src));
+    Assert.assertEquals(renameSucceeds, exists(fc, dst));
   }
   
   private void rename(Path src, Path dst, boolean dstExists,
@@ -272,7 +272,7 @@ public class TestHDFSFileContextMainOper
     } catch (Exception ex) {
       Assert.assertTrue(exception);
     }
-    Assert.assertEquals(renameSucceeds, !fc.exists(src));
-    Assert.assertEquals((dstExists||renameSucceeds), fc.exists(dst));
+    Assert.assertEquals(renameSucceeds, !exists(fc, src));
+    Assert.assertEquals((dstExists||renameSucceeds), exists(fc, dst));
   }
 }



Mime
View raw message