You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2015/10/31 02:02:18 UTC
incubator-ranger git commit: RANGER-274: unit test fix in cleanup
Repository: incubator-ranger
Updated Branches:
refs/heads/master 6b79130d9 -> fb56f9c22
RANGER-274: unit test fix in cleanup
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/fb56f9c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/fb56f9c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/fb56f9c2
Branch: refs/heads/master
Commit: fb56f9c22f319e70819e6405fad255bf82935daa
Parents: 6b79130
Author: Abhay Kulkarni <ak...@hortonworks.com>
Authored: Fri Oct 30 16:57:05 2015 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Fri Oct 30 17:08:15 2015 -0700
----------------------------------------------------------------------
.../ranger/plugin/store/TestTagStore.java | 25 +++++---------------
1 file changed, 6 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/fb56f9c2/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