hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1626381 - in /hive/trunk/itests: hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestExtendedAcls.java hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java
Date Sat, 20 Sep 2014 05:13:30 GMT
Author: brock
Date: Sat Sep 20 05:13:30 2014
New Revision: 1626381

URL: http://svn.apache.org/r1626381
Log:
HIVE-8096 - Fix a few small nits in TestExtendedAcls (Brock reviewed by Szehon)

Modified:
    hive/trunk/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestExtendedAcls.java
    hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java

Modified: hive/trunk/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestExtendedAcls.java
URL: http://svn.apache.org/viewvc/hive/trunk/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestExtendedAcls.java?rev=1626381&r1=1626380&r2=1626381&view=diff
==============================================================================
--- hive/trunk/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestExtendedAcls.java
(original)
+++ hive/trunk/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestExtendedAcls.java
Sat Sep 20 05:13:30 2014
@@ -34,6 +34,7 @@ import org.apache.hadoop.hive.conf.HiveC
 import org.junit.Assert;
 import org.junit.BeforeClass;
 
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 
 public class TestExtendedAcls extends FolderPermissionBase {
@@ -46,7 +47,7 @@ public class TestExtendedAcls extends Fo
     baseSetup();
   }
 
-  List<AclEntry> aclSpec1 = Lists.newArrayList(
+  private final ImmutableList<AclEntry> aclSpec1 = ImmutableList.of(
       aclEntry(ACCESS, USER, FsAction.ALL),
       aclEntry(ACCESS, GROUP, FsAction.ALL),
       aclEntry(ACCESS, OTHER, FsAction.ALL),
@@ -55,7 +56,7 @@ public class TestExtendedAcls extends Fo
       aclEntry(ACCESS, GROUP, "bar", FsAction.READ_WRITE),
       aclEntry(ACCESS, GROUP, "foo", FsAction.READ_EXECUTE));
 
-  List<AclEntry> aclSpec2 = Lists.newArrayList(
+  private final ImmutableList<AclEntry> aclSpec2 = ImmutableList.of(
       aclEntry(ACCESS, USER, FsAction.ALL),
       aclEntry(ACCESS, GROUP, FsAction.ALL),
       aclEntry(ACCESS, OTHER, FsAction.READ_EXECUTE),
@@ -83,20 +84,20 @@ public class TestExtendedAcls extends Fo
     switch (permIndex) {
       case 0:
         FsPermission perm = fs.getFileStatus(new Path(locn)).getPermission();
-        Assert.assertEquals(perm.toString(), "rwxrwxrwx");
+        Assert.assertEquals("Location: " + locn, "rwxrwxrwx", String.valueOf(perm));
 
         List<AclEntry> actual = getAcl(locn);
         verifyAcls(aclSpec1, actual);
         break;
       case 1:
         perm = fs.getFileStatus(new Path(locn)).getPermission();
-        Assert.assertEquals(perm.toString(), "rwxrwxr-x");
+        Assert.assertEquals("Location: " + locn, "rwxrwxr-x", String.valueOf(perm));
 
         List<AclEntry> acls = getAcl(locn);
         verifyAcls(aclSpec2, acls);
         break;
       default:
-        throw new RuntimeException("Only 2 permissions by this test");
+        throw new RuntimeException("Only 2 permissions by this test: " + permIndex);
     }
   }
 

Modified: hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java
URL: http://svn.apache.org/viewvc/hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java?rev=1626381&r1=1626380&r2=1626381&view=diff
==============================================================================
--- hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java
(original)
+++ hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java
Sat Sep 20 05:13:30 2014
@@ -52,7 +52,7 @@ public abstract class FolderPermissionBa
   protected static Path warehouseDir;
   protected static Path baseDfsDir;
 
-  public static final PathFilter hiddenFileFilter = new PathFilter(){
+  protected static final PathFilter hiddenFileFilter = new PathFilter(){
     public boolean accept(Path p){
       String name = p.getName();
       return !name.startsWith("_") && !name.startsWith(".");
@@ -591,7 +591,7 @@ public abstract class FolderPermissionBa
 
   private List<String> listStatus(String locn) throws Exception {
     List<String> results = new ArrayList<String>();
-    FileStatus[] listStatus = fs.listStatus(new Path(locn));
+    FileStatus[] listStatus = fs.listStatus(new Path(locn), hiddenFileFilter);
     for (FileStatus status : listStatus) {
       results.add(status.getPath().toString());
     }



Mime
View raw message