jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1504179 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
Date Wed, 17 Jul 2013 15:40:12 GMT
Author: angela
Date: Wed Jul 17 15:40:12 2013
New Revision: 1504179

URL: http://svn.apache.org/r1504179
Log:
OAK-908 : Performance measurement 

- fix occasional test failure caused by trying to add ac content to an access controlled node

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java?rev=1504179&r1=1504178&r2=1504179&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
Wed Jul 17 15:40:12 2013
@@ -28,6 +28,8 @@ import javax.jcr.security.Privilege;
 import javax.jcr.util.TraversingItemVisitor;
 
 import org.apache.jackrabbit.core.security.principal.EveryonePrincipal;
+import org.apache.jackrabbit.oak.spi.security.authorization.AccessControlConstants;
+import org.apache.jackrabbit.util.Text;
 
 /**
  * Concurrently reads random items from the deep tree where every 10th node is
@@ -60,6 +62,17 @@ public class ConcurrentReadAccessControl
             private void addPolicy(Node node) throws RepositoryException {
                 AccessControlManager acMgr = node.getSession().getAccessControlManager();
                 String path = node.getPath();
+                int level = 0;
+                if (node.isNodeType(AccessControlConstants.NT_REP_POLICY)) {
+                    level = 1;
+                } else if (node.isNodeType(AccessControlConstants.NT_REP_ACE)) {
+                    level = 2;
+                } else if (node.isNodeType(AccessControlConstants.NT_REP_RESTRICTIONS)) {
+                    level = 3;
+                }
+                if (level > 0) {
+                    path = Text.getRelativeParent(path, level);
+                }
                 AccessControlPolicyIterator acIterator = acMgr.getApplicablePolicies(path);
                 if (acIterator.hasNext()) {
                     AccessControlPolicy policy = acIterator.nextAccessControlPolicy();



Mime
View raw message