Author: kkolinko Date: Wed May 19 03:44:51 2010 New Revision: 946011 URL: http://svn.apache.org/viewvc?rev=946011&view=rev Log: re-add all-in-one testcase, in case if it matters for the failure that was observed by Gump
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=946011&r1=946010&r2=946011&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java (original) +++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdaptor.java Wed May 19 03:44:51 2010 @@ -61,10 +61,9 @@ public class TestCoyoteAdaptor extends T 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 T 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()); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org