tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r905430 - /tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
Date Mon, 01 Feb 2010 22:15:48 GMT
Author: markt
Date: Mon Feb  1 22:15:48 2010
New Revision: 905430

URL: http://svn.apache.org/viewvc?rev=905430&view=rev
Log:
Fix test failure

Modified:
    tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=905430&r1=905429&r2=905430&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java Mon Feb  1 22:15:48 2010
@@ -26,7 +26,9 @@
 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 @@
         // 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");



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


Mime
View raw message