jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1409233 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Date Wed, 14 Nov 2012 15:42:06 GMT
Author: mduerig
Date: Wed Nov 14 15:42:05 2012
New Revision: 1409233

URL: http://svn.apache.org/viewvc?rev=1409233&view=rev
Log:
OAK-447: Adding a node with the name of a removed node can lead to an inconsistent hierarchy
of node builders
 Test case demonstrating the issue

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java?rev=1409233&r1=1409232&r2=1409233&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Wed Nov 14 15:42:05 2012
@@ -16,10 +16,13 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import java.util.Collections;
+
 import com.google.common.collect.ImmutableMap;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static junit.framework.Assert.assertEquals;
@@ -38,7 +41,9 @@ public class MemoryNodeBuilderTest {
                     "b", LongPropertyState.createLongProperty("b", 2L),
                     "c", LongPropertyState.createLongProperty("c", 3L)),
             ImmutableMap.of(
-                    "x", MemoryNodeState.EMPTY_NODE,
+                    "x", new MemoryNodeState(
+                        Collections.<String, PropertyState>emptyMap(),
+                        Collections.singletonMap("q", MemoryNodeState.EMPTY_NODE)),
                     "y", MemoryNodeState.EMPTY_NODE,
                     "z", MemoryNodeState.EMPTY_NODE));
 
@@ -115,6 +120,18 @@ public class MemoryNodeBuilderTest {
     }
 
     @Test
+    @Ignore("OAK-447")  // FIXME OAK-447
+    public void testAddRemovedNodeAgain() {
+        NodeBuilder root = new MemoryNodeBuilder(BASE);
+
+        root.removeNode("x");
+        NodeBuilder x = root.child("x");
+
+        x.child("q");
+        assertTrue(x.hasChildNode("q"));
+    }
+
+    @Test
     public void testReset() {
         NodeBuilder root = new MemoryNodeBuilder(BASE);
         NodeBuilder child = root.child("x");



Mime
View raw message