ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [1/7] incubator-ranger git commit: RANGER-274: unit test fix in cleanup
Date Thu, 05 Nov 2015 22:13:17 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/tag-policy 6b79130d9 -> e11533079


RANGER-274: unit test fix in cleanup

Signed-off-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit fb56f9c22f319e70819e6405fad255bf82935daa)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/85008427
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/85008427
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/85008427

Branch: refs/heads/tag-policy
Commit: 85008427ceebff816f6152009ceaee88bb26b7d9
Parents: 6b79130
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Fri Oct 30 16:57:05 2015 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Thu Nov 5 13:57:54 2015 -0800

----------------------------------------------------------------------
 .../ranger/plugin/store/TestTagStore.java       | 25 +++++---------------
 1 file changed, 6 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/85008427/agents-common/src/test/java/org/apache/ranger/plugin/store/TestTagStore.java
----------------------------------------------------------------------
diff --git a/agents-common/src/test/java/org/apache/ranger/plugin/store/TestTagStore.java
b/agents-common/src/test/java/org/apache/ranger/plugin/store/TestTagStore.java
index 5b867ad..1bf35c6 100644
--- a/agents-common/src/test/java/org/apache/ranger/plugin/store/TestTagStore.java
+++ b/agents-common/src/test/java/org/apache/ranger/plugin/store/TestTagStore.java
@@ -121,29 +121,16 @@ public class TestTagStore {
 	@AfterClass
 	public static void tearDownAfterClass() throws Exception {
 
-		Path dirPath = new Path(tmpDir);
-		FileSystem fs = dirPath.getFileSystem(config);
+		if (filePath != null) {
+			try {
+				FileSystem fs = filePath.getFileSystem(config);
 
-		try {
-			if (fs.exists(dirPath) && fs.isDirectory(dirPath)) {
-
-				RemoteIterator<LocatedFileStatus> files = fs.listFiles(dirPath, false);
-
-				if (files != null) {
-					while (files.hasNext()) {
-						LocatedFileStatus fileStatus = files.next();
-						Path path = fileStatus.getPath();
-						if (fs.isFile(path)) {
-							fs.delete(path, true);
-						}
-					}
-				}
+				fs.delete(filePath, true);
+			} catch (Throwable t) {
+				// Ignore
 			}
-		} catch (IOException excp) {
 		}
 
-		fs.delete(filePath, true);
-
 	}
 
 	@Test


Mime
View raw message