jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1466408 - in /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization: NamespaceManagementTest.java NodeTypeDefinitionManagementTest.java
Date Wed, 10 Apr 2013 09:45:43 GMT
Author: angela
Date: Wed Apr 10 09:45:43 2013
New Revision: 1466408

URL: http://svn.apache.org/r1466408
Log:
OAK-527: permissions (wip, fix tests and add comments why they fail)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NamespaceManagementTest.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeDefinitionManagementTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NamespaceManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NamespaceManagementTest.java?rev=1466408&r1=1466407&r2=1466408&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NamespaceManagementTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NamespaceManagementTest.java
Wed Apr 10 09:45:43 2013
@@ -49,6 +49,7 @@ public class NamespaceManagementTest ext
     @After
     protected void tearDown() throws Exception {
         try {
+            superuser.refresh(false);
             for (AccessControlPolicy policy : acMgr.getPolicies(null)) {
                 acMgr.removePolicy(null, policy);
             }
@@ -92,18 +93,23 @@ public class NamespaceManagementTest ext
     }
 
     @Test
-    public void testRegisterNamespaceWithPrivilege() throws Exception {
+    public void testModifyNamespaceWithPrivilege() throws Exception {
         modify(null, JCR_NAMESPACE_MANAGEMENT.toString(), true);
         assertHasPrivilege(null, JCR_NAMESPACE_MANAGEMENT, true);
 
+        modify(null, JCR_NAMESPACE_MANAGEMENT.toString(), false);
+        assertHasPrivilege(null, JCR_NAMESPACE_MANAGEMENT, false);
+    }
+
+    @Test
+    public void testRegisterNamespaceWithPrivilege() throws Exception {
+        modify(null, JCR_NAMESPACE_MANAGEMENT.toString(), true);
         try {
             Workspace testWsp = testSession.getWorkspace();
             testWsp.getNamespaceRegistry().registerNamespace(getNewNamespacePrefix(testWsp),
getNewNamespaceURI(testWsp));
         } finally {
             modify(null, JCR_NAMESPACE_MANAGEMENT.toString(), false);
         }
-
-        assertHasPrivilege(null, JCR_NAMESPACE_MANAGEMENT, false);
     }
 
     @Test

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeDefinitionManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeDefinitionManagementTest.java?rev=1466408&r1=1466407&r2=1466408&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeDefinitionManagementTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeDefinitionManagementTest.java
Wed Apr 10 09:45:43 2013
@@ -97,10 +97,17 @@ public class NodeTypeDefinitionManagemen
     }
 
     @Test
-    public void testRegisterNodeTypeWithPrivilege() throws Exception {
+    public void testModifyNodeTypeWithPrivilege() throws Exception {
         modify(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT.toString(), true);
         assertHasPrivilege(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT, true);
 
+        modify(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT.toString(), false);
+        assertHasPrivilege(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT, false);
+    }
+
+    @Test
+    public void testRegisterNodeTypeWithPrivilege() throws Exception {
+        modify(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT.toString(), true);
         try {
             Workspace testWsp = testSession.getWorkspace();
             NodeTypeManager ntm = testWsp.getNodeTypeManager();
@@ -118,8 +125,6 @@ public class NodeTypeDefinitionManagemen
         } finally {
             modify(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT.toString(), false);
         }
-
-        assertHasPrivilege(null, JCR_NODE_TYPE_DEFINITION_MANAGEMENT, false);
     }
 
     @Test



Mime
View raw message