You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/05/18 15:35:35 UTC
svn commit: r945647 -
/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java
Author: markt
Date: Tue May 18 13:35:35 2010
New Revision: 945647
URL: http://svn.apache.org/viewvc?rev=945647&view=rev
Log:
Re-factor test to get a clearer idea of why Gump is failing
Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java
Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java?rev=945647&r1=945646&r2=945647&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java Tue May 18 13:35:35 2010
@@ -31,7 +31,40 @@ import org.apache.tomcat.util.buf.ByteCh
public class TestCoyoteAdaptor extends TomcatBaseTest {
- public void testPathParams() throws Exception {
+ public void testPathParmsRootNone() throws Exception {
+ pathParamTest("/", "none");
+ }
+
+ public void testPathParmsFooNone() throws Exception {
+ pathParamTest("/foo", "none");
+ }
+
+ public void testPathParmsRootSessionOnly() throws Exception {
+ pathParamTest("/;jsessionid=1234", "1234");
+ }
+
+ public void testPathParmsFooSessionOnly() throws Exception {
+ pathParamTest("/foo;jsessionid=1234", "1234");
+ }
+
+ public void testPathParmsFooSessionDummy() throws Exception {
+ pathParamTest("/foo;jsessionid=1234;dummy", "1234");
+ }
+
+ public void testPathParmsFooSessionDummyValue() throws Exception {
+ pathParamTest("/foo;jsessionid=1234;dummy=5678", "1234");
+ }
+
+ public void testPathParmsFooSessionValue() throws Exception {
+ pathParamTest("/foo;jsessionid=1234;=5678", "1234");
+ }
+
+ public void testPathParmsFooSessionBar() throws Exception {
+ pathParamTest("/foo;jsessionid=1234/bar", "1234");
+
+ }
+
+ public void pathParamTest(String path, String expected) throws Exception {
// Setup Tomcat instance
Tomcat tomcat = getTomcatInstance();
@@ -43,17 +76,7 @@ public class TestCoyoteAdaptor extends T
ctx.addServletMapping("/", "servlet");
tomcat.start();
-
- testPath("/", "none");
- testPath("/;jsessionid=1234", "1234");
- testPath("/foo;jsessionid=1234", "1234");
- testPath("/foo;jsessionid=1234;dummy", "1234");
- testPath("/foo;jsessionid=1234;dummy=5678", "1234");
- testPath("/foo;jsessionid=1234;=5678", "1234");
- testPath("/foo;jsessionid=1234/bar", "1234");
- }
- private void testPath(String path, String expected) throws Exception {
ByteChunk res = getUrl("http://localhost:" + getPort() + path);
assertEquals(expected, res.toString());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org