jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1569442 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java
Date Tue, 18 Feb 2014 17:51:20 GMT
Author: angela
Date: Tue Feb 18 17:51:20 2014
New Revision: 1569442

URL: http://svn.apache.org/r1569442
Log:
resolve TODOs

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

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java?rev=1569442&r1=1569441&r2=1569442&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java
Tue Feb 18 17:51:20 2014
@@ -31,14 +31,12 @@ import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 public class TreeTest extends AbstractOakCoreTest {
 
-    // TODO: add tests for acls withs restrictions
-    // TODO: add tests with READ_PROPERTIES and READ_NODES privileges
-
     private Root testRoot;
 
     @Before
@@ -137,12 +135,20 @@ public class TreeTest extends AbstractOa
 
     @Test
     public void testHasProperty() throws Exception {
-        // TODO
+        setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES);
+
+        testRoot.refresh();
+        Tree a = testRoot.getTree("/a");
+        assertFalse(a.hasProperty("aProp"));
     }
 
     @Test
     public void testGetProperty() throws Exception {
-        // TODO
+        setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES);
+
+        testRoot.refresh();
+        Tree a = testRoot.getTree("/a");
+        assertNull(a.getProperty("aProp"));
     }
 
     @Test
@@ -161,11 +167,20 @@ public class TreeTest extends AbstractOa
 
     @Test
     public void testGetPropertyCount() throws Exception {
-        // TODO
+        setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES);
+
+        testRoot.refresh();
+        Tree a = testRoot.getTree("/a");
+        assertEquals(0, a.getPropertyCount());
     }
 
     @Test
     public void testGetProperties() throws Exception {
-        // TODO
+        setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES);
+
+        testRoot.refresh();
+        Tree a = testRoot.getTree("/a");
+        Iterable<? extends PropertyState> props = a.getProperties();
+        assertFalse(props.iterator().hasNext());
     }
 }



Mime
View raw message