hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [06/21] hadoop git commit: TestLocalMetadataStore: use absolute path strings
Date Fri, 08 Jul 2016 21:30:13 GMT
TestLocalMetadataStore: use absolute path strings


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4f9b84df
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4f9b84df
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4f9b84df

Branch: refs/heads/s3_create
Commit: 4f9b84dfd9cc60105b86741a2a32f0276bc64fb1
Parents: 9d32cea
Author: Aaron Fabbri <fabbri@cloudera.com>
Authored: Wed Jun 29 16:41:47 2016 -0700
Committer: Aaron Fabbri <fabbri@cloudera.com>
Committed: Wed Jun 29 16:41:47 2016 -0700

----------------------------------------------------------------------
 .../hadoop/fs/s3a/TestLocalMetadataStore.java   | 56 ++++++++++----------
 1 file changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4f9b84df/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestLocalMetadataStore.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestLocalMetadataStore.java
b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestLocalMetadataStore.java
index 499718c..6accd20 100644
--- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestLocalMetadataStore.java
+++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestLocalMetadataStore.java
@@ -49,28 +49,28 @@ public class TestLocalMetadataStore extends Assert {
   @Test
   public void testPutNew() throws Exception {
     /* create three dirs /da1, /da2, /da3 */
-    createNewDirs("da1", "da2", "da3");
+    createNewDirs("/da1", "/da2", "/da3");
 
     /* "Fully-cached" property of directories is not recursive. We only
      * track direct children of the directory.  Thus this will not
      * affect entry for /da1.
      */
-    lms.put(new CachedFileStatus(makeFileStatus("da1/db1/fc1", 100)));
+    lms.put(new CachedFileStatus(makeFileStatus("/da1/db1/fc1", 100)));
 
-    assertEmptyDirs("da1", "da2", "da3");
+    assertEmptyDirs("/da1", "/da2", "/da3");
 
     /* Ensure new directories update correct parent dirs. */
-    lms.putNew(new CachedFileStatus(makeDirStatus("da1/db1")));
-    assertDirectorySize("da1", 1);
-    assertEmptyDirs("da1/db1", "da2", "da3");
+    lms.putNew(new CachedFileStatus(makeDirStatus("/da1/db1")));
+    assertDirectorySize("/da1", 1);
+    assertEmptyDirs("/da1/db1", "/da2", "/da3");
 
     /* Ensure new files update correct parent dirs. */
-    lms.putNew(new CachedFileStatus(makeFileStatus("da1/db1/fc1", 100)));
-    lms.putNew(new CachedFileStatus(makeFileStatus("da1/db1/fc2", 200)));
-    assertDirectorySize("da1", 1);
-    assertDirectorySize("da1/db1", 2);
-    assertEmptyDirs("da2", "da3");
-    CachedFileStatus cfs = lms.get(new Path("da1/db1/fc2"));
+    lms.putNew(new CachedFileStatus(makeFileStatus("/da1/db1/fc1", 100)));
+    lms.putNew(new CachedFileStatus(makeFileStatus("/da1/db1/fc2", 200)));
+    assertDirectorySize("/da1", 1);
+    assertDirectorySize("/da1/db1", 2);
+    assertEmptyDirs("/da2", "/da3");
+    CachedFileStatus cfs = lms.get(new Path("/da1/db1/fc2"));
     assertNotNull("Get file after put new.", cfs);
     assertEquals("Cached file size correct.", cfs.getFileStatus().getLen(), 200);
   }
@@ -79,39 +79,39 @@ public class TestLocalMetadataStore extends Assert {
   public void testDelete() throws Exception {
     setUpDeleteTest();
 
-    lms.delete(new Path("ADirectory1/db1/file2"), false);
+    lms.delete(new Path("/ADirectory1/db1/file2"), false);
 
     /* Ensure delete happened. */
-    assertDirectorySize("ADirectory1/db1/", 1);
-    CachedFileStatus cfs = lms.get(new Path("ADirectory1/db1/file2"));
+    assertDirectorySize("/ADirectory1/db1/", 1);
+    CachedFileStatus cfs = lms.get(new Path("/ADirectory1/db1/file2"));
     assertNull("File deleted", cfs);
   }
 
   @Test
   public void testDeleteRecursive() throws Exception {
     setUpDeleteTest();
-    createNewDirs("ADirectory1/db1/dc1", "ADirectory1/db1/dc1/dd1");
+    createNewDirs("/ADirectory1/db1/dc1", "/ADirectory1/db1/dc1/dd1");
     lms.putNew(new CachedFileStatus(
-        makeFileStatus("ADirectory1/db1/dc1/dd1/deepFile", 100))
+        makeFileStatus("/ADirectory1/db1/dc1/dd1/deepFile", 100))
     );
-    lms.delete(new Path("ADirectory1/db1"), true);
+    lms.delete(new Path("/ADirectory1/db1"), true);
 
-    assertEmptyDirectory("ADirectory1");
-    assertNotCached("ADirectory1/file1");
-    assertNotCached("ADirectory1/file2");
-    assertNotCached("ADirectory1/db1/dc1/dd1/deepFile");
-    assertEmptyDirectory("ADirectory2");
+    assertEmptyDirectory("/ADirectory1");
+    assertNotCached("/ADirectory1/file1");
+    assertNotCached("/ADirectory1/file2");
+    assertNotCached("/ADirectory1/db1/dc1/dd1/deepFile");
+    assertEmptyDirectory("/ADirectory2");
   }
 
   private void setUpDeleteTest() throws IOException {
-    createNewDirs("ADirectory1", "ADirectory2", "ADirectory1/db1");
-    lms.putNew(new CachedFileStatus(makeFileStatus("ADirectory1/db1/file1", 100)));
-    lms.putNew(new CachedFileStatus(makeFileStatus("ADirectory1/db1/file2", 100)));
+    createNewDirs("/ADirectory1", "/ADirectory2", "/ADirectory1/db1");
+    lms.putNew(new CachedFileStatus(makeFileStatus("/ADirectory1/db1/file1", 100)));
+    lms.putNew(new CachedFileStatus(makeFileStatus("/ADirectory1/db1/file2", 100)));
 
-    CachedFileStatus cfs = lms.get(new Path("ADirectory1/db1/file2"));
+    CachedFileStatus cfs = lms.get(new Path("/ADirectory1/db1/file2"));
     assertNotNull("Found test file", cfs);
 
-    assertDirectorySize("ADirectory1/db1/", 2);
+    assertDirectorySize("/ADirectory1/db1/", 2);
   }
 
   @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message