diff --git a/org.springframework.web/src/test/java/org/springframework/web/util/UrlPathHelperTests.java b/org.springframework.web/src/test/java/org/springframework/web/util/UrlPathHelperTests.java index 21a80cd23fb..9de82a6b7b8 100644 --- a/org.springframework.web/src/test/java/org/springframework/web/util/UrlPathHelperTests.java +++ b/org.springframework.web/src/test/java/org/springframework/web/util/UrlPathHelperTests.java @@ -94,7 +94,6 @@ public class UrlPathHelperTests { request.setPathInfo(null); request.setServletPath("/"); request.setRequestURI("/test/"); - assertEquals("/", helper.getLookupPathForRequest(request)); } @@ -118,7 +117,6 @@ public class UrlPathHelperTests { assertEquals("/foo/", helper.getLookupPathForRequest(request)); } - @Test public void wasDefaultServletRoot() throws Exception { request.setContextPath("/test"); @@ -130,6 +128,12 @@ public class UrlPathHelperTests { assertEquals("/", helper.getLookupPathForRequest(request)); } + @Test + public void wasDefaultServletRootWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/"); + tomcatDefaultServletRoot(); + } + @Test public void wasDefaultServletFile() throws Exception { request.setContextPath("/test"); @@ -141,6 +145,13 @@ public class UrlPathHelperTests { assertEquals("/foo", helper.getLookupPathForRequest(request)); } + @Test + public void tomcatDefaultServletFileWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/foo"); + tomcatDefaultServletFile(); + } + + @Test public void wasDefaultServletFolder() throws Exception { request.setContextPath("/test"); @@ -152,6 +163,13 @@ public class UrlPathHelperTests { assertEquals("/foo/", helper.getLookupPathForRequest(request)); } + @Test + public void tomcatDefaultServletFolderWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/foo/"); + tomcatDefaultServletFolder(); + } + + // // /foo/* mapping // @@ -208,6 +226,12 @@ public class UrlPathHelperTests { assertEquals("/", helper.getLookupPathForRequest(request)); } + @Test + public void wasCasualServletRootWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/foo/"); + tomcatCasualServletRoot(); + } + // test the root mapping for /foo/* w/o a trailing slash - //foo @Test public void wasCasualServletRootWithMissingSlash() throws Exception { @@ -220,6 +244,12 @@ public class UrlPathHelperTests { assertEquals("/", helper.getLookupPathForRequest(request)); } + @Test + public void wasCasualServletRootWithMissingSlashWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/foo"); + tomcatCasualServletRootWithMissingSlash(); + } + @Test public void wasCasualServletFile() throws Exception { request.setContextPath("/test"); @@ -231,6 +261,12 @@ public class UrlPathHelperTests { assertEquals("/foo", helper.getLookupPathForRequest(request)); } + @Test + public void wasCasualServletFileWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/foo/foo"); + tomcatCasualServletFile(); + } + @Test public void wasCasualServletFolder() throws Exception { request.setContextPath("/test"); @@ -241,4 +277,10 @@ public class UrlPathHelperTests { assertEquals("/foo/", helper.getLookupPathForRequest(request)); } + + @Test + public void wasCasualServletFolderWithCompliantSetting() throws Exception { + request.setAttribute(WEBSPHERE_URI_ATTRIBUTE, "/test/foo/foo/"); + tomcatCasualServletFolder(); + } } \ No newline at end of file