From: kkolinko Date: Wed, 19 May 2010 03:44:51 +0000 (+0000) Subject: re-add all-in-one testcase, X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=17820898746827b22ad64f019ba42536bcd8bc54;p=tomcat7.0 re-add all-in-one testcase, in case if it matters for the failure that was observed by Gump git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@946011 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/org/apache/catalina/connector/TestCoyoteAdaptor.java b/test/org/apache/catalina/connector/TestCoyoteAdaptor.java index 0e2b24fcd..a044cc567 100644 --- a/test/org/apache/catalina/connector/TestCoyoteAdaptor.java +++ b/test/org/apache/catalina/connector/TestCoyoteAdaptor.java @@ -61,10 +61,9 @@ public class TestCoyoteAdaptor extends TomcatBaseTest { public void testPathParmsFooSessionBar() throws Exception { pathParamTest("/foo;jsessionid=1234/bar", "1234"); - } - public void pathParamTest(String path, String expected) throws Exception { + public void testPathParams() throws Exception { // Setup Tomcat instance Tomcat tomcat = getTomcatInstance(); @@ -74,9 +73,36 @@ public class TestCoyoteAdaptor extends TomcatBaseTest { Tomcat.addServlet(ctx, "servlet", new PathParamServlet()); 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 pathParamTest(String path, String expected) throws Exception { + // Setup Tomcat instance + Tomcat tomcat = getTomcatInstance(); + + // Must have a real docBase - just use temp + Context ctx = + tomcat.addContext("/", System.getProperty("java.io.tmpdir")); + + Tomcat.addServlet(ctx, "servlet", new PathParamServlet()); + ctx.addServletMapping("/", "servlet"); + + tomcat.start(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + path); + assertEquals(expected, res.toString()); + } + + private void testPath(String path, String expected) throws Exception { ByteChunk res = getUrl("http://localhost:" + getPort() + path); assertEquals(expected, res.toString()); }