hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject hadoop git commit: HADOOP-14247. FileContextMainOperationsBaseTest should clean up test root path. Contributed by Mingliang Liu
Date Wed, 29 Mar 2017 18:19:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 15e3873dc -> 13c766b62


HADOOP-14247. FileContextMainOperationsBaseTest should clean up test root path. Contributed
by Mingliang Liu


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

Branch: refs/heads/trunk
Commit: 13c766b62c48ae07849f7f1762ef6883239aef54
Parents: 15e3873
Author: Mingliang Liu <liuml07@apache.org>
Authored: Mon Mar 27 16:37:39 2017 -0700
Committer: Mingliang Liu <liuml07@apache.org>
Committed: Wed Mar 29 11:13:39 2017 -0700

----------------------------------------------------------------------
 .../fs/FileContextMainOperationsBaseTest.java   | 21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/13c766b6/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java
index 2b3ab2a..ece96f8 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java
@@ -36,6 +36,8 @@ import org.junit.Assert;
 import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static org.apache.hadoop.fs.FileContextTestHelper.*;
 import static org.apache.hadoop.fs.CreateFlag.*;
@@ -60,6 +62,9 @@ import static org.apache.hadoop.fs.CreateFlag.*;
  * </p>
  */
 public abstract class FileContextMainOperationsBaseTest  {
+
+  protected static final Logger LOG =
+      LoggerFactory.getLogger(FileContextMainOperationsBaseTest.class);
   
   private static String TEST_DIR_AAA2 = "test/hadoop2/aaa";
   private static String TEST_DIR_AAA = "test/hadoop/aaa";
@@ -111,9 +116,19 @@ public abstract class FileContextMainOperationsBaseTest  {
   @After
   public void tearDown() throws Exception {
     if (fc != null) {
-      boolean del = fc.delete(new Path(fileContextTestHelper.getAbsoluteTestRootPath(fc),
new Path("test")), true);
-      assertTrue(del);
-      fc.delete(localFsRootPath, true);
+      final Path testRoot = fileContextTestHelper.getAbsoluteTestRootPath(fc);
+      LOG.info("Deleting test root path {}", testRoot);
+      try {
+        fc.delete(testRoot, true);
+      } catch (Exception e) {
+        LOG.error("Error when deleting test root path " + testRoot, e);
+      }
+
+      try {
+        fc.delete(localFsRootPath, true);
+      } catch (Exception e) {
+        LOG.error("Error when deleting localFsRootPath " + localFsRootPath, e);
+      }
     }
   }
   


---------------------------------------------------------------------
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