jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1442930 - /jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetJournalTest.java
Date Wed, 06 Feb 2013 12:34:36 GMT
Author: meteatamel
Date: Wed Feb  6 12:34:36 2013
New Revision: 1442930

URL: http://svn.apache.org/viewvc?rev=1442930&view=rev
Log:
OAK-611 - GetJournalCommand does not take path into account

Added the test case for the issue

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

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetJournalTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetJournalTest.java?rev=1442930&r1=1442929&r2=1442930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetJournalTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetJournalTest.java
Wed Feb  6 12:34:36 2013
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEqu
 import org.apache.jackrabbit.mongomk.BaseMongoMicroKernelTest;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -30,13 +31,13 @@ public class MongoMKGetJournalTest exten
 
     @Test
     public void simple() throws Exception {
-        String fromDiff = "+\"a\" : {}";
+        String fromDiff = "+\"/a\" : {}";
         String fromMsg = "Add /a";
-        String fromRev = mk.commit("/", fromDiff, null, fromMsg);
+        String fromRev = mk.commit("", fromDiff, null, fromMsg);
 
-        String toDiff = "+\"b\" : {}";
+        String toDiff = "+\"/b\" : {}";
         String toMsg = "Add /b";
-        String toRev = mk.commit("/", toDiff, null, toMsg);
+        String toRev = mk.commit("", toDiff, null, toMsg);
 
         JSONArray array = parseJSONArray(mk.getJournal(fromRev, toRev, "/"));
         assertEquals(2, array.size());
@@ -54,4 +55,23 @@ public class MongoMKGetJournalTest exten
         assertPropertyValue(rev, "changes", toDiff);
     }
 
+    @Test
+    @Ignore("OAK-611")
+    public void emptyAndRootPath() {
+        // Commit with empty path
+        String rev = mk.commit("", "+\"/a\":{}", null, "");
+        String journalStr = mk.getJournal(rev, rev, "/");
+        JSONArray array = parseJSONArray(journalStr);
+        JSONObject entry = getObjectArrayEntry(array, 0);
+        String expected = "+\"/a\":{}";
+        assertPropertyValue(entry, "changes", expected);
+
+        // Commit with root path
+        rev = mk.commit("/", "+\"b\":{}", null, "");
+        journalStr = mk.getJournal(rev, rev, "/");
+        array = parseJSONArray(journalStr);
+        entry = getObjectArrayEntry(array, 0);
+        expected = "+\"/b\":{}";
+        assertPropertyValue(entry, "changes", expected);
+    }
 }
\ No newline at end of file



Mime
View raw message