1 16 package org.apache.cocoon.matching; 17 18 import java.util.Map ; 19 20 import org.apache.avalon.framework.parameters.Parameters; 21 import org.apache.cocoon.SitemapComponentTestCase; 22 23 public class WildcardURIMatcherTestCase extends SitemapComponentTestCase { 24 25 public void testWildcardURIMatch() throws Exception { 26 getRequest().setRequestURI("/test/foo/bla/end"); 27 28 Parameters parameters = new Parameters(); 29 30 Map result = match("wildcard-uri", "**", parameters); 31 System.out.println(result); 32 assertNotNull("Test if resource exists", result); 33 assertEquals("Test for **", "test/foo/bla/end", result.get("1")); 34 35 result = match("wildcard-uri", "**/bla/*", parameters); 36 System.out.println(result); 37 assertNotNull("Test if resource exists", result); 38 assertEquals("Test for **/bla/* {1}", "test/foo", result.get("1")); 39 assertEquals("Test for **/bla/* {2}", "end", result.get("2")); 40 } 41 } 42 | Popular Tags |