You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/06/24 14:29:28 UTC
svn commit: r416906 -
/cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java
Author: cziegeler
Date: Sat Jun 24 05:29:28 2006
New Revision: 416906
URL: http://svn.apache.org/viewvc?rev=416906&view=rev
Log:
Sync test cases
Modified:
cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java
Modified: cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java?rev=416906&r1=416905&r2=416906&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java Sat Jun 24 05:29:28 2006
@@ -195,6 +195,63 @@
assertNull(result);
}
+ public void test24WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("**favicon.ico", "samples1234/");
+ assertNull(result);
+ }
+
+ public void test25WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("**favicon.ico", "samples123/");
+ assertNull(result);
+ }
+
+ public void test26WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("**/*/**", "foo/bar/baz/bug");
+ assertNotNull(result);
+ assertEquals("foo", result.get("1"));
+ assertEquals("bar", result.get("2"));
+ assertEquals("baz/bug", result.get("3"));
+ }
+
+ public void test27WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("end*end*end*end", "endXXendYendend");
+ assertNotNull(result);
+ assertEquals("XX", result.get("1"));
+ assertEquals("Y", result.get("2"));
+ assertEquals("", result.get("3"));
+ }
+
+ public void test28WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("end*end*end*end", "endendendend");
+ assertNotNull(result);
+ assertEquals("", result.get("1"));
+ assertEquals("", result.get("2"));
+ assertEquals("", result.get("3"));
+ }
+
+ public void test29WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("end**end**end**end", "endXXendYendend");
+ assertNotNull(result);
+ assertEquals("XX", result.get("1"));
+ assertEquals("Y", result.get("2"));
+ assertEquals("", result.get("3"));
+ }
+
+ public void test30WildcardURIMatch()
+ throws Exception {
+ Map result = WildcardMatcherHelper.match("end**end**end**end", "endendendend");
+ assertNotNull(result);
+ assertEquals("", result.get("1"));
+ assertEquals("", result.get("2"));
+ assertEquals("", result.get("3"));
+ }
+
public void testEmptyPattern() throws Exception {
assertNotNull(WildcardMatcherHelper.match("", ""));
assertNull(WildcardMatcherHelper.match("", "foo"));