Author: markt
Date: Thu May 20 09:48:43 2010
New Revision: 946583

URL: http://svn.apache.org/viewvc?rev=946583&view=rev
Log:
REpurpose the duplicate pathPath test to test the redirect process
Modified:
    tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=946583&r1=946582&r2=946583&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Thu 
May 20 09:48:43 2010
@@ -16,6 +16,7 @@
  */
 package org.apache.catalina.connector;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.logging.Level;
@@ -65,13 +66,20 @@ public class TestCoyoteAdapter extends T
         pathParamTest("/foo;jsessionid=1234/bar", "1234");
     }
 
-    public void testPathParams() throws Exception {
+    public void testPathParamsRedirect() 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"));
+        File docBase = new File(System.getProperty("java.io.tmpdir"));
+        
+        // Create the folder that will trigger the redirect
+        File foo = new File(docBase, "foo");
+        if (!foo.exists() && !foo.mkdirs()) {
+            fail("Unable to create foo directory in docBase");
+        }
+        
+        Context ctx = tomcat.addContext("/", docBase.getAbsolutePath());
 
         Tomcat.addServlet(ctx, "servlet", new PathParamServlet());
         ctx.addServletMapping("/", "servlet");



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to