Fix test failure
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 1 Feb 2010 22:15:48 +0000 (22:15 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 1 Feb 2010 22:15:48 +0000 (22:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@905430 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/connector/TestRequest.java

index 0df0df3..f96879c 100644 (file)
@@ -26,7 +26,9 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.catalina.authenticator.BasicAuthenticator;
 import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.deploy.LoginConfig;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.startup.Tomcat;
@@ -206,8 +208,11 @@ public class TestRequest extends TomcatBaseTest {
         // Must have a real docBase - just use temp
         StandardContext ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
-        // You can customize the context by calling 
-        // its API
+
+        LoginConfig config = new LoginConfig();
+        config.setAuthMethod("BASIC");
+        ctx.setLoginConfig(config);
+        ctx.getPipeline().addValve(new BasicAuthenticator());
         
         Tomcat.addServlet(ctx, "servlet", new LoginLogoutServlet());
         ctx.addServletMapping("/", "servlet");