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 ca...@apache.org on 2017/05/26 01:03:06 UTC

svn commit: r1796230 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/document/VersionedDocumentBundlingTest.java

Author: catholicon
Date: Fri May 26 01:03:06 2017
New Revision: 1796230

URL: http://svn.apache.org/viewvc?rev=1796230&view=rev
Log:
OAK-6267: Version restore fails if restore would not change bundling
root but changes bundled nodes

Adding ignored test

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/document/VersionedDocumentBundlingTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/document/VersionedDocumentBundlingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/document/VersionedDocumentBundlingTest.java?rev=1796230&r1=1796229&r2=1796230&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/document/VersionedDocumentBundlingTest.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/document/VersionedDocumentBundlingTest.java Fri May 26 01:03:06 2017
@@ -27,6 +27,7 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.jcr.version.Version;
 import javax.jcr.version.VersionManager;
 
 import org.apache.jackrabbit.JcrConstants;
@@ -49,6 +50,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.junit.After;
 import org.junit.Assume;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.jackrabbit.oak.commons.PathUtils.concat;
@@ -115,6 +117,27 @@ public class VersionedDocumentBundlingTe
         assertNull(getNodeDocument(concat(versionedPath, "jcr:content")));
     }
 
+    //OAK-6267
+    @Ignore("OAK-6267")
+    @Test
+    public void restoreVersionedNode() throws Exception{
+        String assetParentPath = "/bundlingtest/par";
+        Node asset = JcrUtils.getOrCreateByPath(assetParentPath + "/foo.png", "oak:Unstructured", "oak:Asset", s, false);
+        Node assetParent = s.getNode(assetParentPath);
+        assetParent.addMixin(JcrConstants.MIX_VERSIONABLE);
+        asset.addNode("jcr:content", "oak:Unstructured");
+        s.save();
+
+        VersionManager vm = s.getWorkspace().getVersionManager();
+        Version version = vm.checkin(assetParentPath);
+        vm.checkout(assetParentPath);
+
+        asset.getNode("jcr:content").setProperty("foo1", "bar1");
+        s.save();
+
+        vm.restore(version, true);
+    }
+
     private void configureBundling() throws ParseException, RepositoryException, IOException {
         CndImporter.registerNodeTypes(new StringReader(TEST_NODE_TYPE), s);
         Node bundlor = JcrUtils.getOrCreateByPath(BundlingConfigHandler.CONFIG_PATH, "oak:Unstructured", s);