Browse Source

SPR-7064

+ added unit tests for WAS with complaint setting

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3277 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Costin Leau 16 years ago
parent
commit
897a1c6470
  1. 46
      org.springframework.web/src/test/java/org/springframework/web/util/UrlPathHelperTests.java

46
org.springframework.web/src/test/java/org/springframework/web/util/UrlPathHelperTests.java

@ -94,7 +94,6 @@ public class UrlPathHelperTests { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 - <host>/<context>/foo
@Test
public void wasCasualServletRootWithMissingSlash() throws Exception {
@ -220,6 +244,12 @@ public class UrlPathHelperTests { @@ -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 { @@ -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 { @@ -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();
}
}
Loading…
Cancel
Save