You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2024/01/22 15:41:55 UTC

(jackrabbit-filevault) branch test/for-OAK10544 created (now 1ea189f5)

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a change to branch test/for-OAK10544
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git


      at 1ea189f5 rpeo test for issue OAK-10544; currently fails for Oak but passes for Jackrabbit

This branch includes the following new commits:

     new 1ea189f5 rpeo test for issue OAK-10544; currently fails for Oak but passes for Jackrabbit

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(jackrabbit-filevault) 01/01: rpeo test for issue OAK-10544; currently fails for Oak but passes for Jackrabbit

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch test/for-OAK10544
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 1ea189f5711500b46079f9222cca2d43b6d7011b
Author: Julian Reschke <re...@apache.org>
AuthorDate: Mon Jan 22 16:41:38 2024 +0100

    rpeo test for issue OAK-10544; currently fails for Oak but passes for Jackrabbit
---
 .../vault/packaging/integration/NamespaceImportIT.java | 16 ++++++++++++++++
 .../remappedprefix.zip/META-INF/vault/filter.xml       |  4 ++++
 .../remappedprefix.zip/META-INF/vault/properties.xml   | 18 ++++++++++++++++++
 .../remappedprefix.zip/jcr_root/.content.xml           |  4 ++++
 .../remappedprefix.zip/jcr_root/tmp/.content.xml       |  4 ++++
 .../remappedprefix.zip/jcr_root/tmp/remappedprefix.xml |  3 +++
 6 files changed, 49 insertions(+)

diff --git a/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/packaging/integration/NamespaceImportIT.java b/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/packaging/integration/NamespaceImportIT.java
index b44b44e3..2211495e 100644
--- a/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/packaging/integration/NamespaceImportIT.java
+++ b/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/packaging/integration/NamespaceImportIT.java
@@ -19,12 +19,14 @@ package org.apache.jackrabbit.vault.packaging.integration;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assume.assumeTrue;
 
 import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
 import java.util.Properties;
+import java.util.UUID;
 
 import javax.jcr.NamespaceException;
 import javax.jcr.NamespaceRegistry;
@@ -35,6 +37,7 @@ import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 
 import org.apache.jackrabbit.api.JackrabbitRepository;
+import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.vault.fs.api.PathFilterSet;
 import org.apache.jackrabbit.vault.fs.config.DefaultMetaInf;
 import org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter;
@@ -208,6 +211,19 @@ public class NamespaceImportIT extends IntegrationTestBase {
         }
     }
 
+    @Test
+    public void importRemappedNamespace() throws IOException, PackageException, RepositoryException {
+        // repro test for OAK-10544
+        admin.getWorkspace().getNamespaceRegistry().registerNamespace("correct", "bar:");
+        admin.getWorkspace().getNamespaceRegistry().registerNamespace("ns2", "bad:");
+        Node test = JcrUtils.getOrCreateByPath("/tmp/remappedprefix", "nt:unstructured", admin);
+        test.setProperty("ns2:prop", "old");
+        admin.save();
+        extractVaultPackageStrict("/test-packages/remappedprefix.zip");
+        Node test2 = admin.getNode("/tmp/remappedprefix");
+        assertEquals("new", test2.getProperty("{correct:}prop").getString());
+    }
+
     /** Simple Oak repository wrapper */
     private static final class Instance implements Closeable {
 
diff --git a/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/META-INF/vault/filter.xml b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/META-INF/vault/filter.xml
new file mode 100644
index 00000000..434a0f9a
--- /dev/null
+++ b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/META-INF/vault/filter.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspaceFilter version="1.0">
+    <filter root="/tmp/remappedprefix"/>
+</workspaceFilter>
diff --git a/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/META-INF/vault/properties.xml b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/META-INF/vault/properties.xml
new file mode 100644
index 00000000..2494f50c
--- /dev/null
+++ b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/META-INF/vault/properties.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+<comment>FileVault Package Properties</comment>
+<entry key="createdBy">admin</entry>
+<entry key="name">test_referenceable</entry>
+<entry key="lastModified">2015-12-16T16:59:10.779+01:00</entry>
+<entry key="lastModifiedBy">admin</entry>
+<entry key="created">2015-12-16T16:59:10.795+01:00</entry>
+<entry key="buildCount">5</entry>
+<entry key="version"/>
+<entry key="dependencies"/>
+<entry key="packageFormatVersion">2</entry>
+<entry key="description"/>
+<entry key="lastWrapped">2015-12-16T16:59:10.779+01:00</entry>
+<entry key="group">my_packages</entry>
+<entry key="lastWrappedBy">admin</entry>
+</properties>
diff --git a/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/.content.xml b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/.content.xml
new file mode 100644
index 00000000..6d7a9768
--- /dev/null
+++ b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/.content.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
+    jcr:mixinTypes="[rep:AccessControllable,rep:RepoAccessControllable]"
+    jcr:primaryType="rep:root"/>
diff --git a/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/tmp/.content.xml b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/tmp/.content.xml
new file mode 100644
index 00000000..fb0a629b
--- /dev/null
+++ b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/tmp/.content.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
+    jcr:mixinTypes="[rep:AccessControllable]"
+    jcr:primaryType="nt:unstructured"/>
diff --git a/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/tmp/remappedprefix.xml b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/tmp/remappedprefix.xml
new file mode 100644
index 00000000..8090af73
--- /dev/null
+++ b/vault-core-it/vault-core-integration-tests/src/main/resources/test-packages/remappedprefix.zip/jcr_root/tmp/remappedprefix.xml
@@ -0,0 +1,3 @@
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ns2="correct:" ns2:prop="new"
+    jcr:primaryType="nt:unstructured">
+</jcr:root>