jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1447816 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AccessControlManagerImplTest.java
Date Tue, 19 Feb 2013 17:06:38 GMT
Author: angela
Date: Tue Feb 19 17:06:38 2013
New Revision: 1447816

URL: http://svn.apache.org/r1447816
Log:
OAK-51 : Access Control Management (WIP, fix ignored test)

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AccessControlManagerImplTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AccessControlManagerImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AccessControlManagerImplTest.java?rev=1447816&r1=1447815&r2=1447816&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AccessControlManagerImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AccessControlManagerImplTest.java
Tue Feb 19 17:06:38 2013
@@ -607,18 +607,17 @@ public class AccessControlManagerImplTes
         assertEquals("*/something", restr.getString(REP_GLOB, null));
     }
 
-    @Ignore("OAK-51")
     @Test
     public void testModifyExistingPolicy() throws Exception {
         ACL acl = getApplicablePolicy(testPath);
-        acl.addAccessControlEntry(testPrincipal, testPrivileges);
+        assertTrue(acl.addAccessControlEntry(testPrincipal, testPrivileges));
         AccessControlEntry allowTest = acl.getAccessControlEntries()[0];
 
         acMgr.setPolicy(testPath, acl);
         root.commit();
 
         acl = (ACL) acMgr.getPolicies(testPath)[0];
-        acl.addEntry(EveryonePrincipal.getInstance(), testPrivileges, false, getGlobRestriction("*/something"));
+        assertTrue(acl.addEntry(EveryonePrincipal.getInstance(), testPrivileges, false, getGlobRestriction("*/something")));
 
         AccessControlEntry[] aces = acl.getAccessControlEntries();
         assertEquals(2, aces.length);
@@ -635,8 +634,9 @@ public class AccessControlManagerImplTes
         assertEquals(denyEveryone, aces[0]);
         assertEquals(allowTest, aces[1]);
 
-        acl.addEntry(testPrincipal, new Privilege[]{acMgr.privilegeFromName(PrivilegeConstants.JCR_ALL)},
-                false, Collections.<String, Value>emptyMap());
+        Privilege[] readAc = new Privilege[]{acMgr.privilegeFromName(PrivilegeConstants.JCR_READ_ACCESS_CONTROL)};
+        assertTrue(acl.addEntry(testPrincipal, readAc, false, Collections.<String, Value>emptyMap()));
+        assertEquals(3, acl.size());
         AccessControlEntry denyTest = acl.getAccessControlEntries()[2];
 
         acl.orderBefore(denyTest, allowTest);



Mime
View raw message