jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1309489 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
Date Wed, 04 Apr 2012 16:42:01 GMT
Author: mduerig
Date: Wed Apr  4 16:42:01 2012
New Revision: 1309489

URL: http://svn.apache.org/viewvc?rev=1309489&view=rev
Log:
OAK-9: Internal tree builder
copy test: assert copy is equal to original
new test: rename

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

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java?rev=1309489&r1=1309488&r2=1309489&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
Wed Apr  4 16:42:01 2012
@@ -197,6 +197,21 @@ public class KernelNodeStateEditorTest {
     }
 
     @Test
+    public void rename() {
+        KernelNodeStateEditor editor = new KernelNodeStateEditor(state);
+        TransientNodeState transientState = editor.getTransientState();
+
+        assertTrue(transientState.hasNode("x"));
+        editor.move("x", "xx");
+        assertFalse(transientState.hasNode("x"));
+        assertTrue(transientState.hasNode("xx"));
+
+        NodeState newState = editor.mergeInto(microkernel, state);
+        assertNull(newState.getChildNode("x"));
+        assertNotNull(newState.getChildNode("xx"));
+    }
+
+    @Test
     public void copy() {
         KernelNodeStateEditor editor = new KernelNodeStateEditor(state);
         TransientNodeState transientState = editor.getTransientState();
@@ -229,6 +244,10 @@ public class KernelNodeStateEditorTest {
         assertNotNull(newState.getChildNode("y"));
         assertNotNull(newState.getChildNode("y").getChildNode("xx"));
         assertNotNull(newState.getChildNode("y").getChildNode("xx").getChildNode("x1"));
+
+        NodeState x = newState.getChildNode("x");
+        NodeState xx = newState.getChildNode("y").getChildNode("xx");
+        assertEquals(x, xx);
     }
 
 }



Mime
View raw message