jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1492099 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Date Wed, 12 Jun 2013 07:57:17 GMT
Author: mduerig
Date: Wed Jun 12 07:57:16 2013
New Revision: 1492099

URL: http://svn.apache.org/r1492099
Log:
OAK-864: MicroKernelException when moving a node to its own descendant
test case

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

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java?rev=1492099&r1=1492098&r2=1492099&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Wed Jun 12 07:57:16 2013
@@ -36,6 +36,7 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.api.Type;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class RootImplTest extends OakBaseTest {
@@ -165,6 +166,43 @@ public class RootImplTest extends OakBas
         assertEquals("/moved/new", n.getPath());
     }
 
+    @Test
+    public void moveToSelf() throws CommitFailedException {
+        Root root = session.getLatestRoot();
+        root.getTree("/").addChild("s");
+        root.commit();
+
+        assertFalse(root.move("/s", "/s"));
+    }
+
+    @Test
+    @Ignore
+    public void moveToDescendant() throws CommitFailedException {
+        Root root = session.getLatestRoot();
+        root.getTree("/").addChild("s");
+        root.commit();
+
+        assertFalse(root.move("/s", "/s/t"));
+    }
+
+    @Test
+    public void copyToSelf() throws CommitFailedException {
+        Root root = session.getLatestRoot();
+        root.getTree("/").addChild("s");
+        root.commit();
+
+        assertFalse(root.copy("/s", "/s"));
+    }
+
+    @Test
+    public void copyToDescendant() throws CommitFailedException {
+        Root root = session.getLatestRoot();
+        root.getTree("/").addChild("s");
+        root.commit();
+
+        assertTrue(root.copy("/s", "/s/t"));
+    }
+
     /**
      * Regression test for OAK-208
      */



Mime
View raw message