Issue Details (XML | Word | Printable)

Key: COCOON-1873
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andreas Hartmann
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Cocoon

WildcardURIMatcher returns wrong results for **/*.html

Created: 27/Jun/06 10:37 PM   Updated: 02/Oct/06 04:38 PM
Return to search
Component/s: * Cocoon Core
Affects Version/s: None
Fix Version/s: 2.1.10, 2.2

Time Tracking:
Not Specified


 Description  « Hide
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"));
+ }
+
 }


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Andreas Hartmann added a comment - 27/Jun/06 10:39 PM
I committed the test case patch.

Vadim Gritsenko added a comment - 02/Oct/06 04:38 PM
test executes successfully now.