jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1221649 - /jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
Date Wed, 21 Dec 2011 09:00:10 GMT
Author: thomasm
Date: Wed Dec 21 09:00:10 2011
New Revision: 1221649

URL: http://svn.apache.org/viewvc?rev=1221649&view=rev
Log:
Added test case.

Modified:
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java?rev=1221649&r1=1221648&r2=1221649&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
Wed Dec 21 09:00:10 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.mk;
 
+import static org.junit.Assert.fail;
 import junit.framework.Assert;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
@@ -252,6 +253,20 @@ public class MoveNodeTest extends MultiM
         assertJournal(">\"/test/c\":\"/test2/c\"");
     }
 
+    @Test
+    public void moveTryOverwriteExisting() {
+        // move /test/b to /test2
+        commit("/", "> \"test/b\": \"/test2/b\"");
+
+        try {
+            // try to move /test/a to /test2/b
+            commit("/", "> \"test/a\": \"/test2/b\"");
+            fail();
+        } catch (Exception e) {
+            // expected
+        }
+    }
+
     private void commit(String root, String diff) {
         head = mk.commit(root, diff, head, null);
     }



Mime
View raw message