Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1873

WildcardURIMatcher returns wrong results for **/*.html

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.10, 2.2
    • * Cocoon Core
    • None

    Description

      URI: foo/bar/baz.html
      Pattern: **/*.html

      {1} is replaced with foo
      {2} is replaced with bar/baz

      Here's a patch for the test case:


      Index: src/test/org/apache/cocoon/matching/WildcardURIMatcherTestCase.java
      ===================================================================
      --- src/test/org/apache/cocoon/matching/WildcardURIMatcherTestCase.java (revision 417475)
      +++ src/test/org/apache/cocoon/matching/WildcardURIMatcherTestCase.java (working copy)
      @@ -57,4 +57,16 @@
               assertEquals("Test for */*.xml", "test", result.get("1"));
               assertEquals("Test for */*.xml", "something.xmlbla", result.get("2"));
           }
      +
      + public void testWildcardURIMatchMultiSinglePattern() throws Exception {
      + getRequest().setRequestURI("foo/bar/baz.html");
      +
      + final Parameters parameters = new Parameters();
      +
      + Map result = match("wildcard-uri", "**/*.html", parameters);
      + assertNotNull("Test if resource exists", result);
      + assertEquals("Test for {1} in **/*.html", "foo/bar", result.get("1"));
      + assertEquals("Test for {2} in **/*.html", "baz", result.get("2"));
      + }
      +
       }

      Attachments

        Activity

          People

            Unassigned Unassigned
            andreas@apache.org Andreas Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: