jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1492622 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
Date Thu, 13 Jun 2013 11:17:15 GMT
Author: mduerig
Date: Thu Jun 13 11:17:14 2013
New Revision: 1492622

URL: http://svn.apache.org/r1492622
Log:
OAK-868: KernelNodeState.processJsonDiff throws IAE on hidden items
@Ignored test case

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java?rev=1492622&r1=1492621&r2=1492622&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
Thu Jun 13 11:17:14 2013
@@ -41,6 +41,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class KernelNodeStoreTest {
@@ -282,7 +283,44 @@ public class KernelNodeStoreTest {
         assertEquals(1, diff.removed.size());
         assertEquals(0, diff.added.size());
         assertEquals("child-moved", diff.removed.get(0));
+    }
+
+    @Test
+    public void compareAgainstBaseState0() throws CommitFailedException {
+        compareAgainstBaseState(0);
+    }
+
+    @Test
+    public void compareAgainstBaseState20() throws CommitFailedException {
+        compareAgainstBaseState(20);
+    }
+
+    @Test
+    @Ignore
+    public void compareAgainstBaseState100() throws CommitFailedException {
+        compareAgainstBaseState(KernelNodeState.MAX_CHILD_NODE_NAMES);
+    }
 
+    private void compareAgainstBaseState(int childNodeCount) throws CommitFailedException
{
+        NodeStoreBranch branch = store.branch();
+
+        NodeState before = branch.getHead();
+        NodeBuilder builder = before.builder();
+        for (int k = 0; k < childNodeCount; k++) {
+            builder.child("c" + k);
+        }
+
+        builder.child("foo").child(":bar").child("quz").setProperty("p", "v");
+        branch.setRoot(builder.getNodeState());
+        branch.merge(EmptyHook.INSTANCE);
+
+        NodeState after = store.getRoot();
+        Diff diff = new Diff();
+        after.compareAgainstBaseState(before, diff);
+
+        assertEquals(0, diff.removed.size());
+        assertEquals(childNodeCount + 1, diff.added.size());
+        assertEquals(0, diff.addedProperties.size());
     }
 
     private static class Diff extends DefaultNodeStateDiff {



Mime
View raw message