jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1436248 - /jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitAddTest.java
Date Mon, 21 Jan 2013 10:01:14 GMT
Author: meteatamel
Date: Mon Jan 21 10:01:14 2013
New Revision: 1436248

URL: http://svn.apache.org/viewvc?rev=1436248&view=rev
Log:
OAK-565 - CommitCommand readExistingNodes/mergeNodes called unnecessarily

A simple test case related to the issue

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

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitAddTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitAddTest.java?rev=1436248&r1=1436247&r2=1436248&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitAddTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKCommitAddTest.java
Mon Jan 21 10:01:14 2013
@@ -175,4 +175,21 @@ public class MongoMKCommitAddTest extend
         }
         if (debug) System.out.println("Final Result:" + commitMonitor);
     }
+
+    @Test
+    public void existingNodesMerged() throws Exception {
+        String rev = mk.commit("/", "+\"a\" : {}", null, null);
+        mk.commit("/", "+\"a/b\" : {}", null, null);
+        mk.commit("/", "^\"a/key1\" : \"value1\"", null, null);
+
+        // Commit to rev before key1 and b were added
+        mk.commit("/", "^\"a/key2\" : \"value2\"", rev, null);
+
+        // Check that key1 and b were merged
+        String nodes = mk.getNodes("/", null, 1 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/,
null /*filter*/);
+        JSONObject obj = parseJSONObject(nodes);
+        assertPropertyValue(obj, ":childNodeCount", 1L);
+        assertPropertyValue(obj, "a/key1", "value1");
+        assertPropertyValue(obj, "a/key2", "value2");
+    }
 }
\ No newline at end of file



Mime
View raw message