From fec3e7c4b3bc87a556f59dfe17c171af6381c9c9 Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 18 May 2010 13:35:35 +0000 Subject: [PATCH] Re-factor test to get a clearer idea of why Gump is failing git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@945647 13f79535-47bb-0310-9956-ffa450edef68 --- .../catalina/connector/TestCoyoteAdaptor.java | 45 ++++++++++++++++------ 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/test/org/apache/catalina/connector/TestCoyoteAdaptor.java b/test/org/apache/catalina/connector/TestCoyoteAdaptor.java index 08fc6b7c1..0e2b24fcd 100644 --- a/test/org/apache/catalina/connector/TestCoyoteAdaptor.java +++ b/test/org/apache/catalina/connector/TestCoyoteAdaptor.java @@ -31,7 +31,40 @@ import org.apache.tomcat.util.buf.ByteChunk; 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 TomcatBaseTest { 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()); } -- 2.11.0