jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1504797 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/ReadTest.java
Date Fri, 19 Jul 2013 08:19:17 GMT
Author: mduerig
Date: Fri Jul 19 08:19:16 2013
New Revision: 1504797

URL: http://svn.apache.org/r1504797
Log:
OAK-911: Optimize Session.getItem(String)
test cases

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/ReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/ReadTest.java?rev=1504797&r1=1504796&r2=1504797&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/ReadTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/ReadTest.java
Fri Jul 19 08:19:16 2013
@@ -16,9 +16,12 @@
  */
 package org.apache.jackrabbit.oak.jcr.security.authorization;
 
+import static org.junit.Assert.assertArrayEquals;
+
 import java.security.Principal;
 import java.util.HashSet;
 import java.util.Set;
+
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
@@ -33,8 +36,6 @@ import org.apache.jackrabbit.oak.securit
 import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
 import org.junit.Test;
 
-import static org.junit.Assert.assertArrayEquals;
-
 /**
  * Permission evaluation tests related to {@link javax.jcr.security.Privilege#JCR_READ} privilege.
  */
@@ -68,6 +69,24 @@ public class ReadTest extends AbstractEv
     }
 
     @Test
+    public void testGetItem() throws Exception {
+        // withdraw READ privilege to 'testUser' at 'path'
+        deny(path, readPrivileges);
+        allow(childNPath, readPrivileges);
+        testSession.getItem(childNPath);
+    }
+
+    @Test
+    public void testItemExists() throws Exception {
+        // withdraw READ privilege to 'testUser' at 'path'
+        deny(path, readPrivileges);
+        allow(childNPath, readPrivileges);
+
+        assertFalse(testSession.itemExists(path));
+        assertTrue(testSession.itemExists(childNPath));
+    }
+
+    @Test
     public void testDeniedReadOnSubTree() throws Exception, InterruptedException {
         // withdraw READ privilege to 'testUser' at 'path'
         deny(childNPath, readPrivileges);



Mime
View raw message