You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2019/03/05 12:31:48 UTC

svn commit: r1854848 - /jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMKResetTest.java

Author: mreutegg
Date: Tue Mar  5 12:31:47 2019
New Revision: 1854848

URL: http://svn.apache.org/viewvc?rev=1854848&view=rev
Log:
OAK-8108: Branch reset does not remove all branch commit entries

Add ignored test

Modified:
    jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMKResetTest.java

Modified: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMKResetTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMKResetTest.java?rev=1854848&r1=1854847&r2=1854848&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMKResetTest.java (original)
+++ jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMKResetTest.java Tue Mar  5 12:31:47 2019
@@ -18,6 +18,8 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.util.Map;
 
+import org.apache.jackrabbit.oak.plugins.document.util.Utils;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES;
@@ -164,6 +166,31 @@ public class DocumentMKResetTest extends
                 Revision.fromString(b1).asTrunkRevision()));
     }
 
+    @Ignore("OAK-8108")
+    @Test
+    public void resetRemovesBranchCommitEntries() {
+        DocumentStore store = mk.getDocumentStore();
+
+        addNodes(null, "/foo");
+        String b0 = mk.branch(null);
+        String b1 = addNodes(b0, "/foo/bar");
+
+        NodeDocument foo = store.find(NODES, getIdFromPath("/foo"));
+        assertNotNull(foo);
+        assertTrue(foo.getLocalCommitRoot().containsKey(
+                Revision.fromString(b1).asTrunkRevision()));
+
+        addNodes(null, "/foo/bar");
+
+        mk.reset(b1, b0);
+
+        // reset must also remove _bc entry on parent document
+        Revision r = Revision.fromString(b1).asTrunkRevision();
+        for (NodeDocument doc : Utils.getAllDocuments(store)) {
+            assertFalse(doc.getId(), doc.getLocalBranchCommits().contains(r));
+        }
+    }
+
     @Test
     public void resetMultipleCommits() {
         DocumentStore store = mk.getDocumentStore();