Updated combine method on AntPatchMatcher to reflect usage in unit tests.

This commit is contained in:
Arjen Poutsma
2009-04-16 12:53:36 +00:00
parent 2f27bd5da7
commit 19e5b7d668
2 changed files with 71 additions and 107 deletions

View File

@@ -350,27 +350,9 @@ public class AntPathMatcherTests {
assertEquals("/hotels/{hotel}", pathMatcher.combine("/hotels", "{hotel}"));
assertEquals("/hotels/*/booking/{booking}", pathMatcher.combine("/hotels/*/booking", "{booking}"));
assertEquals("/hotel.html", pathMatcher.combine("/*.html", "/hotel.html"));
try {
String result = pathMatcher.combine("/*.html", "/hotel");
fail("IllegalArgumentException expected; got " + result);
}
catch (IllegalArgumentException ex) {
// expected
}
try {
String result = pathMatcher.combine("/*.html", "/*.txt");
fail("IllegalArgumentException expected; got " + result);
}
catch (IllegalArgumentException ex) {
// expected
}
try {
String result = pathMatcher.combine("/hotel.html", "/bookings.html");
fail("IllegalArgumentException expected; got " + result);
}
catch (IllegalArgumentException ex) {
// expected
}
assertEquals("/hotel.html", pathMatcher.combine("/*.html", "/hotel"));
assertEquals("/hotel.html", pathMatcher.combine("/*.html", "/hotel.*"));
assertEquals("/*.html", pathMatcher.combine("/*.*", "/*.html"));
}
@Test