jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1465547 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/nodetype/TypeEditorTest.java
Date Mon, 08 Apr 2013 07:19:47 GMT
Author: mreutegg
Date: Mon Apr  8 07:19:47 2013
New Revision: 1465547

URL: http://svn.apache.org/r1465547
Log:
OAK-695: TypeEditor must not check hidden nodes

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/nodetype/TypeEditorTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/nodetype/TypeEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/nodetype/TypeEditorTest.java?rev=1465547&r1=1465546&r2=1465547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/nodetype/TypeEditorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/nodetype/TypeEditorTest.java
Mon Apr  8 07:19:47 2013
@@ -16,12 +16,13 @@
  */
 package org.apache.jackrabbit.oak.plugins.nodetype;
 
-import org.apache.jackrabbit.oak.Oak;
+import static org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
+
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.ContentSession;
-import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
-import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
+import org.apache.jackrabbit.oak.spi.commit.EditorHook;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.junit.Test;
 
 /**
@@ -31,17 +32,25 @@ public class TypeEditorTest {
 
     @Test
     public void ignoreHidden() throws CommitFailedException {
-        Oak oak = new Oak()
-                .with(new OpenSecurityProvider())
-                .with(new InitialContent())
-                .with(new TypeEditorProvider());
-        ContentSession session = oak.createContentSession();
-        Root root = session.getLatestRoot();
-        root.getTree("/").addChild(":hidden");
-        root.commit();
-        root.getTree("/:hidden").setProperty("prop", "value");
-        root.commit();
-        root.getTree("/:hidden").remove();
-        root.commit();
+        EditorHook hook = new EditorHook(new TypeEditorProvider());
+
+        NodeState root = new InitialContent().initialize(EMPTY_NODE);
+        NodeBuilder builder = root.builder();
+
+        NodeState before = builder.getNodeState();
+        builder.child(":hidden");
+        NodeState after = builder.getNodeState();
+        hook.processCommit(before, after);
+
+        before = after;
+        builder.child(":hidden").setProperty("prop", "value");
+        after = builder.getNodeState();
+        hook.processCommit(before, after);
+
+        before = after;
+        builder.removeNode(":hidden");
+        after = builder.getNodeState();
+        hook.processCommit(before, after);
     }
+
 }



Mime
View raw message