Version restore fails if restore would not change bundling
root but changes bundled nodes
Adding ignored test
@@ -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.state.NodeStore;
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 VersionedDocumentBundlingTest {
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);
