Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9659

Namespace http://sling.apache.org/ registered as prefix sling instead of http://sling.apache.org/jcr/sling/1.0

    XMLWordPrintableJSON

Details

    Description

      When using org.apache.sling.testing.mock.sling.junit.SlingContext with ResourceResolverType.JCR_OAK , the URL http://sling.apache.org/ is somehow registered as namespace "sling" instead of the usual http://sling.apache.org/jcr/sling/1.0 . This has the effect that http://sling.apache.org/jcr/sling/1.0 gets the prefix sling0 , and this can lead to problems when importing content during tests. This does not appear in 2.1.8-1.16.0, so I assume it's a problem of Sling Mock Oak. It can be a problem of the included dependencies, too, of course.

      I'll attach a zip of a example project that reproduces the error. The crucial lines of the failing test are:

              JackrabbitSession session = (JackrabbitSession) context.resourceResolver().adaptTo(Session.class);
              String slinguri = session.getNamespaceURI("sling");
              Assert.assertEquals("http://sling.apache.org/jcr/sling/1.0", slinguri);
              // is actually http://sling.apache.org/

      Attachments

        1. slingmocktest.zip
          0.2 kB
          Hans-Peter Stoerr

        Activity

          People

            kwin Konrad Windszus
            hanspeterstoerr Hans-Peter Stoerr
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h