jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1420940 - /jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
Date Wed, 12 Dec 2012 20:03:49 GMT
Author: meteatamel
Date: Wed Dec 12 20:03:48 2012
New Revision: 1420940

URL: http://svn.apache.org/viewvc?rev=1420940&view=rev
Log:
Added some node removal tests.

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java?rev=1420940&r1=1420939&r2=1420940&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitRemoveTest.java
Wed Dec 12 20:03:48 2012
@@ -1,6 +1,7 @@
 package org.apache.jackrabbit.mongomk.impl;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -50,4 +51,34 @@ public class MongoMKCommitRemoveTest ext
         assertTrue(mk.nodeExists("/a", base));
         mk.commit("", "+\"/a\":{}", base, null);
     }
+
+    @Test
+    public void removeNodeWithChildren() throws Exception {
+        mk.commit("/", "+\"a\" : { \"b\" : {},  \"c\" : {}, \"d\" : {}}", null, null);
+        assertTrue(mk.nodeExists("/a", null));
+        assertTrue(mk.nodeExists("/a/b", null));
+        assertTrue(mk.nodeExists("/a/c", null));
+        assertTrue(mk.nodeExists("/a/d", null));
+
+        mk.commit("/", "-\"a/b\"", null, null);
+        assertTrue(mk.nodeExists("/a", null));
+        assertFalse(mk.nodeExists("/a/b", null));
+        assertTrue(mk.nodeExists("/a/c", null));
+        assertTrue(mk.nodeExists("/a/d", null));
+    }
+
+    @Test
+    public void removeNodeWithNestedChildren() throws Exception {
+        mk.commit("/", "+\"a\" : { \"b\" : { \"c\" : { \"d\" : {} } } }", null, null);
+        assertTrue(mk.nodeExists("/a", null));
+        assertTrue(mk.nodeExists("/a/b", null));
+        assertTrue(mk.nodeExists("/a/b/c", null));
+        assertTrue(mk.nodeExists("/a/b/c/d", null));
+
+        mk.commit("/", "-\"a\"", null, null);
+        assertFalse(mk.nodeExists("/a", null));
+        assertFalse(mk.nodeExists("/a/b", null));
+        assertFalse(mk.nodeExists("/a/b/c", null));
+        assertFalse(mk.nodeExists("/a/b/c/d", null));
+    }
 }
\ No newline at end of file



Mime
View raw message