Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-714

TCK: Test root path not escaped when used in XPath queries

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-alpha4
    • Component/s: jackrabbit-jcr-tests
    • Labels:
      None

      Description

      A repository implementation might use a test root path that contains names that need xXXXX escaping when used in XPath queries. Currently the TCK just uses the test path as-is when constructing queries. Even though this only affects few repositories (I've heard of one legacy connector to run into this problem), it would be good to add the proper escaping.

      1. JCR-714.patch
        14 kB
        Jukka Zitting

        Activity

        Hide
        Jukka Zitting added a comment -

        Attached a patch that properly encodes the test path for use in the XPath queries.

        The only problem with this patch is that it needs the ISO9075.encodePath() method from jackrabbit-jcr-commons. I'm not sure what are the implications of the jcr-commons dependency, though as long as the TCK webapp uses JNDI to access the repository from another classloader this should be no problem.

        Show
        Jukka Zitting added a comment - Attached a patch that properly encodes the test path for use in the XPath queries. The only problem with this patch is that it needs the ISO9075.encodePath() method from jackrabbit-jcr-commons. I'm not sure what are the implications of the jcr-commons dependency, though as long as the TCK webapp uses JNDI to access the repository from another classloader this should be no problem.
        Hide
        Marcel Reutegger added a comment -

        We had a similar issue with the ISO8601 class. Instead of introducing a dependency, we copied the class. I don't particularly like that, so I'm OK with the new dependency. Once jackrabbit-jcr-tests depends on jackrabbit-jcr-commons we should remove the class ISO8601 and use the one from the commons module.

        Show
        Marcel Reutegger added a comment - We had a similar issue with the ISO8601 class. Instead of introducing a dependency, we copied the class. I don't particularly like that, so I'm OK with the new dependency. Once jackrabbit-jcr-tests depends on jackrabbit-jcr-commons we should remove the class ISO8601 and use the one from the commons module.
        Hide
        Jukka Zitting added a comment -

        Patch applied in revision 792118.

        Instead of introducing the jcr-commons dependency, I copied the required support classes to o.a.j.test.api.util.

        Show
        Jukka Zitting added a comment - Patch applied in revision 792118. Instead of introducing the jcr-commons dependency, I copied the required support classes to o.a.j.test.api.util.

          People

          • Assignee:
            Jukka Zitting
            Reporter:
            Jukka Zitting
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development