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 2025/12/16 18:34:41 UTC
(jackrabbit-filevault) branch JCRVLT-832 created (now db8b1a16)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a change to branch JCRVLT-832
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git
at db8b1a16 JCRVLT-832: test coverage for handling namespace information in PATH typed property values
This branch includes the following new commits:
new db8b1a16 JCRVLT-832: test coverage for handling namespace information in PATH typed property values
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: JCRVLT-832: test coverage for handling namespace information in PATH typed property values
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch JCRVLT-832
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git
commit db8b1a1626f36a3086b41470bba1ecc729a74871
Author: Julian Reschke <re...@apache.org>
AuthorDate: Tue Dec 16 19:34:21 2025 +0100
JCRVLT-832: test coverage for handling namespace information in PATH typed property values
---
.../vault/fs/impl/io/DocViewSaxFormatterIT.java | 52 ++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSaxFormatterIT.java b/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSaxFormatterIT.java
index 6da0e4f9..fc50736e 100644
--- a/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSaxFormatterIT.java
+++ b/vault-core-it/vault-core-integration-tests/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSaxFormatterIT.java
@@ -38,6 +38,7 @@ import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.Value;
+import javax.jcr.ValueFactory;
import javax.jcr.lock.LockException;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -48,6 +49,7 @@ import javax.jcr.version.VersionException;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
import org.apache.jackrabbit.commons.JcrUtils;
+import org.apache.jackrabbit.commons.NamespaceHelper;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
import org.apache.jackrabbit.util.ISO8601;
@@ -260,4 +262,54 @@ public class DocViewSaxFormatterIT extends IntegrationTestBase {
" jcr:uuid=\"" + node.getIdentifier() + "\"/>\n"
, serialization);
}
+
+ private static final String NL = "\n";
+
+ private static String q(String input) {
+ return '"' + input + '"';
+ }
+
+ private static String qns(String prefix, String name) {
+ return "xmlns:" + prefix + "=" + q(name);
+ }
+
+ private static String XMLNS_JCR = qns("jcr", NamespaceHelper.JCR);
+ private static String XMLNS_NT = qns("nt", NamespaceHelper.NT);
+ private static String XMLNS_MIX = qns("mix", NamespaceHelper.MIX);
+
+ @Test
+ // JCRVLT-832
+ public void testNamePathPropertyValueNamespacePrefixes() throws RepositoryException, URISyntaxException, IOException {
+ ValueFactory vf = admin.getValueFactory();
+
+ NamespaceHelper nh = new NamespaceHelper(admin);
+ nh.registerNamespace("foo1", "bar1:");
+ nh.registerNamespace("foo2", "bar2:");
+
+ Node node = JcrUtils.getOrCreateByPath("/testroot", NodeType.NT_UNSTRUCTURED, admin);
+
+ // simple multivalued Boolean
+ node.setProperty("mvbool", new Value[] {vf.createValue(true), vf.createValue(false), vf.createValue(true)});
+ // single valued name property
+ node.setProperty("svname", vf.createValue("svname-test", PropertyType.NAME));
+ // multi valued name property using namespace
+ node.setProperty("mvname",
+ new Value[] {vf.createValue("foo1:mvname-test", PropertyType.NAME), vf.createValue("xyz", PropertyType.NAME)});
+ // single valued path property using namespace
+ node.setProperty("svpath", vf.createValue("/foo1:a/foo2:b", PropertyType.PATH));
+
+ admin.save();
+
+ String serialization = getSerializedAggregate(admin, "/testroot");
+
+ assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL +
+ "<jcr:root " + XMLNS_JCR + " " + XMLNS_NT + " " + qns("foo1", "bar1:") + " " + qns("foo2", "bar2:") + NL +
+ " jcr:primaryType=\"nt:unstructured\"" + NL +
+ " mvbool=\"{Boolean}[true,false,true]\"" + NL +
+ " mvname=\"{Name}[foo1:mvname-test,xyz]\"" + NL +
+ " svname=\"{Name}svname-test\"" + NL +
+ " svpath=\"{Path}/foo1:a/foo2:b\"" +
+ "/>" + NL
+ , serialization);
+ }
}