You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2021/05/04 17:35:30 UTC

[sling-org-apache-sling-jcr-repoinit] branch tmp/SLING-10349 created (now a3ac18b)

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

bdelacretaz pushed a change to branch tmp/SLING-10349
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git.


      at a3ac18b  SLING-10349 - added test for the supposedly failing script, which passes

This branch includes the following new commits:

     new a3ac18b  SLING-10349 - added test for the supposedly failing script, which passes

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.


[sling-org-apache-sling-jcr-repoinit] 01/01: SLING-10349 - added test for the supposedly failing script, which passes

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

bdelacretaz pushed a commit to branch tmp/SLING-10349
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit a3ac18b8cd8efbbfb73947cfb0a04c7b81c6cc01
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue May 4 19:35:11 2021 +0200

    SLING-10349 - added test for the supposedly failing script, which passes
---
 .../sling/jcr/repoinit/RegisterNodetypesTest.java    | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java b/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java
index efaed73..51b5b81 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java
@@ -38,6 +38,7 @@ public class RegisterNodetypesTest {
     public final SlingContext context = new SlingContext(ResourceResolverType.JCR_OAK);
     
     private TestUtil U;
+    private NamespaceRegistry nsReg;
     
     private static final String TEST_ID = UUID.randomUUID().toString();
     private static final String NS_PREFIX = RegisterNodetypesTest.class.getSimpleName();
@@ -48,16 +49,31 @@ public class RegisterNodetypesTest {
         U = new TestUtil(context);
         U.parseAndExecute("register namespace (" + NS_PREFIX + ") " + NS_URI);
         U.parseAndExecute(U.getTestCndStatement(NS_PREFIX, NS_URI));
+        nsReg = U.getAdminSession().getWorkspace().getNamespaceRegistry();
     }
 
     @Test
     public void NSregistered() throws Exception {
-        final NamespaceRegistry ns = U.getAdminSession().getWorkspace().getNamespaceRegistry();
-        assertEquals(NS_URI, ns.getURI(NS_PREFIX));
+        assertEquals(NS_URI, nsReg.getURI(NS_PREFIX));
     }
     
     @Test
     public void fooNodetypeRegistered() throws Exception {
         U.getAdminSession().getRootNode().addNode("test_" + TEST_ID, NS_PREFIX + ":foo");
     }
+
+    @Test
+    public void SLING_10349() throws Exception {
+        final String script =
+            "register namespace ( yyy ) http://yyy.com/jcr/nt/1.0\n"
+            + "register nodetypes\n"
+            + "<<===\n"
+            + "<< <yyy='http://yyy.com/jcr/nt/1.0'>\n"
+            + "<< [yyy:Foobar] > nt:unstructured\n"
+            + "===>>\n"
+        ;
+        U.parseAndExecute(script);
+        assertEquals("Expecting yyy namespace to be registered", "http://yyy.com/jcr/nt/1.0", nsReg.getURI("yyy"));
+        U.getAdminSession().getRootNode().addNode("yyyTest_" + TEST_ID, "yyy:Foobar");
+    }
  }