jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1569317 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
Date Tue, 18 Feb 2014 13:35:08 GMT
Author: mduerig
Date: Tue Feb 18 13:35:07 2014
New Revision: 1569317

URL: http://svn.apache.org/r1569317
Log:
OAK-1424: Oak API allows to create hidden tree and properties
more tests

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

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java?rev=1569317&r1=1569316&r2=1569317&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenPropertyTest.java
Tue Feb 18 13:35:07 2014
@@ -16,6 +16,14 @@
  */
 package org.apache.jackrabbit.oak.security.authorization.evaluation;
 
+import static org.apache.jackrabbit.oak.api.Type.NAME;
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.Set;
 
 import com.google.common.collect.Sets;
@@ -23,18 +31,13 @@ import org.apache.jackrabbit.JcrConstant
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.plugins.memory.PropertyBuilder;
 import org.apache.jackrabbit.oak.plugins.version.VersionConstants;
 import org.apache.jackrabbit.oak.spi.state.MoveDetector;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 /**
  * Test for the hidden {@link org.apache.jackrabbit.oak.plugins.tree.TreeConstants#OAK_CHILD_ORDER}
property
  */
@@ -47,9 +50,9 @@ public class HiddenPropertyTest extends 
         super.before();
 
         Tree a = root.getTree("/a");
-        a.setProperty(":hiddenProp", "val", Type.STRING);
+        a.setProperty(":hiddenProp", "val", STRING);
         a.setProperty(MoveDetector.SOURCE_PATH, "/some/path", Type.PATH);
-        a.setProperty(VersionConstants.HIDDEN_COPY_SOURCE, "abc", Type.STRING);
+        a.setProperty(VersionConstants.HIDDEN_COPY_SOURCE, "abc", STRING);
         root.commit();
     }
 
@@ -106,4 +109,34 @@ public class HiddenPropertyTest extends 
             // success
         }
     }
+
+    @Ignore("OAK-1424") // FIXME : OAK-1424
+    @Test
+    public void testCreateHiddenProperty2() {
+        Tree a = root.getTree("/a");
+        try {
+            a.setProperty(":hiddenProperty", "val", NAME);
+            root.commit();
+            fail();
+        } catch (Exception e) {
+            // success
+        }
+    }
+
+    @Ignore("OAK-1424") // FIXME : OAK-1424
+    @Test
+    public void testCreateHiddenProperty3() {
+        Tree a = root.getTree("/a");
+        try {
+            PropertyState propertyState = PropertyBuilder.scalar(STRING)
+                    .setName(":hiddenProperty")
+                    .setValue("val")
+                    .getPropertyState();
+            a.setProperty(propertyState);
+            root.commit();
+            fail();
+        } catch (Exception e) {
+            // success
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message