jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1540984 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java
Date Tue, 12 Nov 2013 09:36:27 GMT
Author: angela
Date: Tue Nov 12 09:36:27 2013
New Revision: 1540984

URL: http://svn.apache.org/r1540984
Log:
OAK-869 : Runtime exception while adding node (oak-level test case)

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

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java?rev=1540984&r1=1540983&r2=1540984&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java
Tue Nov 12 09:36:27 2013
@@ -18,19 +18,21 @@
  */
 package org.apache.jackrabbit.oak.security.authorization.evaluation;
 
-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;
-
+import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants;
+import org.apache.jackrabbit.oak.util.NodeUtil;
 import org.junit.Ignore;
 import org.junit.Test;
 
+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 ShadowInvisibleContentTest extends AbstractOakCoreTest {
      
     @Test
@@ -107,4 +109,24 @@ public class ShadowInvisibleContentTest 
         }
     }
 
+    @Ignore("OAK-869") // FIXME: OAK-869
+    @Test
+    public void testAddNodeCollidingWithInvisibleNode() throws Exception {
+        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_ALL);
+        setupPermission("/a/b", testPrincipal, false, PrivilegeConstants.JCR_READ);
+
+        Root testRoot = getTestRoot();
+        Tree a = testRoot.getTree("/a");
+
+        assertFalse(a.getChild("b").exists());
+        new NodeUtil(a).addChild("b", JcrConstants.NT_UNSTRUCTURED);
+
+        try {
+            testRoot.commit();
+            fail();
+        } catch (CommitFailedException e) {
+            assertTrue(e.isConstraintViolation());
+        }
+    }
+
 }



Mime
View raw message