hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1553411 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Date Wed, 25 Dec 2013 19:17:33 GMT
Author: apurtell
Date: Wed Dec 25 19:17:33 2013
New Revision: 1553411

URL: http://svn.apache.org/r1553411
Log:
HBASE-10238. TestAccessController#verifyDenied can fail even if ADE is thrown

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java?rev=1553411&r1=1553410&r2=1553411&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Wed Dec 25 19:17:33 2013
@@ -25,7 +25,6 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.lang.reflect.UndeclaredThrowableException;
-import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.util.List;
 import java.util.Map;
@@ -308,9 +307,9 @@ public class TestAccessController extend
             fail("Expected no results for user '" + user.getShortName() + "'");
           }
         }
-      } catch (IOException e) {
+      } catch (Exception e) {
         boolean isAccessDeniedException = false;
-        if(e instanceof RetriesExhaustedWithDetailsException) {
+        if (e instanceof RetriesExhaustedWithDetailsException) {
           // in case of batch operations, and put, the client assembles a
           // RetriesExhaustedWithDetailsException instead of throwing an
           // AccessDeniedException
@@ -335,20 +334,6 @@ public class TestAccessController extend
         if (!isAccessDeniedException) {
           fail("Not receiving AccessDeniedException for user '" + user.getShortName() + "'");
         }
-      } catch (UndeclaredThrowableException ute) {
-        // TODO why we get a PrivilegedActionException, which is unexpected?
-        Throwable ex = ute.getUndeclaredThrowable();
-        if (ex instanceof PrivilegedActionException) {
-          ex = ((PrivilegedActionException) ex).getException();
-        }
-        if (ex instanceof ServiceException) {
-          ServiceException se = (ServiceException)ex;
-          if (se.getCause() != null && se.getCause() instanceof AccessDeniedException)
{
-            // expected result
-            return;
-          }
-        }
-        fail("Not receiving AccessDeniedException for user '" + user.getShortName() + "'");
       }
     }
   }



Mime
View raw message