tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r910123 - in /tomcat/trunk: java/org/apache/catalina/startup/ test/org/apache/catalina/connector/ test/org/apache/catalina/core/ test/org/apache/catalina/loader/ test/org/apache/catalina/startup/ test/org/apache/tomcat/util/http/
Date Sun, 14 Feb 2010 23:45:20 GMT
Author: markt
Date: Sun Feb 14 23:45:18 2010
New Revision: 910123

URL: http://svn.apache.org/viewvc?rev=910123&view=rev
Log:
Use interfaces in o.a.c.startup.Tomcat and update tests as appropriate

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
    tomcat/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java
    tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
    tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
    tomcat/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java
    tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java
    tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties Sun Feb 14 23:45:18
2010
@@ -108,6 +108,11 @@
 tldConfig.webxmlFail=Failed to process TLD with path [{1}] and URI [{0}]
 tldConfig.webxmlSkip=Path [{1}] skipped since URI [{0}] is a duplicate
 tldConfig.webxmlStart=Scanning <taglib> elements in web.xml
+tomcat.addContextNotLifecycle=Tomcat.addContext() was called but the Context implementation
does not implement Lifecycle. The functionality provided by the FixContextListener must be
provided by other means.
+tomcat.addWebappNotLifecycle=Tomcat.addWebapp() was called but the Context implementation
does not implement Lifecycle. The functionality provided by the DefaultWebXmlListener and
ContextConfig must be provided by other means.
+tomcat.namingNotLifecycle=Tomcat.enableNaming() was called but the Server implementation
does not implement Lifecycle. The functionality provided by the NamingContextListener must
be provided by other means.
+tomcat.startNotLifecycle=Tomcat.start() was called but the Server implementation does not
implement Lifecycle. The Server must be started by other means.
+tomcat.stopNotLifecycle=Tomcat.stop() was called but the Server implementation does not implement
Lifecycle. The Server must be stopped by other means.
 userConfig.database=Exception loading user database
 userConfig.deploy=Deploying web application for user {0}
 userConfig.deploying=Deploying user web applications

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Sun Feb 14 23:45:18 2010
@@ -31,11 +31,16 @@
 
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
 import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Realm;
+import org.apache.catalina.Server;
+import org.apache.catalina.Service;
+import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Connector;
 import org.apache.catalina.core.NamingContextListener;
 import org.apache.catalina.core.StandardContext;
@@ -47,6 +52,9 @@
 import org.apache.catalina.realm.GenericPrincipal;
 import org.apache.catalina.realm.RealmBase;
 import org.apache.catalina.session.StandardManager;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
 
 // TODO: lazy init for the temp dir - only when a JSP is compiled or 
 // get temp dir is called we need to create it. This will avoid the 
@@ -83,16 +91,19 @@
  * @author Costin Manolache
  */
 public class Tomcat {
+	private static final Log log = LogFactory.getLog(Tomcat.class);
+    private static final StringManager sm = StringManager.getManager(Constants.Package);
+
     // Single engine, service, server, connector - few cases need more,
     // they can use server.xml
-    protected StandardServer server;
-    protected StandardService service;
-    protected StandardEngine engine;
+    protected Server server;
+    protected Service service;
+    protected Engine engine;
     protected Connector connector; // for more - customize the classes
     
     // To make it a bit easier to config for the common case
     // ( one host, one context ). 
-    protected StandardHost host;
+    protected Host host;
 
     // TODO: it's easy to add support for more hosts - but is it 
     // really needed ?
@@ -154,10 +165,10 @@
      * 
      * @param contextPath
      * @param baseDir
-     * @return new StandardContext
+     * @return new Context
      * @throws ServletException 
      */
-    public StandardContext addWebapp(String contextPath, 
+    public Context addWebapp(String contextPath, 
                                      String baseDir) throws ServletException {
         
         return addWebapp(getHost(), contextPath, baseDir);    
@@ -191,7 +202,7 @@
      *  @param baseDir base dir for the context, for static files. Must exist, 
      *  relative to the server home
      */
-    public StandardContext addContext(String contextPath, 
+    public Context addContext(String contextPath, 
                                       String baseDir) {
         return addContext(getHost(), contextPath, baseDir);
     }
@@ -214,12 +225,11 @@
      * @param servletClass  The class to be used for the Servlet
      * @return The wrapper for the servlet
      */
-    public StandardWrapper addServlet(String contextPath, 
+    public Wrapper addServlet(String contextPath, 
             String servletName, 
             String servletClass) {
         Container ctx = getHost().findChild(contextPath);
-        return addServlet((StandardContext) ctx, 
-                servletName, servletClass);
+        return addServlet((Context) ctx, servletName, servletClass);
     }
 
     /**
@@ -229,11 +239,11 @@
      * @param servletClass  The class to be used for the Servlet
      * @return The wrapper for the servlet
      */
-    public static StandardWrapper addServlet(StandardContext ctx, 
+    public static Wrapper addServlet(Context ctx, 
                                       String servletName, 
                                       String servletClass) {
         // will do class for name and set init params
-        StandardWrapper sw = (StandardWrapper)ctx.createWrapper();
+        Wrapper sw = ctx.createWrapper();
         sw.setServletClass(servletClass);
         sw.setName(servletName);
         ctx.addChild(sw);
@@ -249,12 +259,11 @@
      * @param servlet       The Servlet to add
      * @return The wrapper for the servlet
      */
-    public StandardWrapper addServlet(String contextPath, 
+    public Wrapper addServlet(String contextPath, 
             String servletName, 
             Servlet servlet) {
         Container ctx = getHost().findChild(contextPath);
-        return addServlet((StandardContext) ctx, 
-                servletName, servlet);
+        return addServlet((Context) ctx, servletName, servlet);
     }
 
     /**
@@ -264,11 +273,11 @@
      * @param servlet       The Servlet to add
      * @return The wrapper for the servlet
      */
-    public static StandardWrapper addServlet(StandardContext ctx,
+    public static Wrapper addServlet(Context ctx,
                                       String servletName, 
                                       Servlet servlet) {
         // will do class for name and set init params
-        StandardWrapper sw = new ExistingStandardWrapper(servlet);
+        Wrapper sw = new ExistingStandardWrapper(servlet);
         sw.setName(servletName);
         ctx.addChild(sw);
         
@@ -277,22 +286,35 @@
     
     
     /**
-     * Initialize and start the server.
+     * Initialize and start the server, assuming that the Server implementation
+     * implements {@link Lifecycle} (the standard implementation does). If it
+     * does not, the {@link Server} must be started directly.
      * @throws LifecycleException 
      */
     public void start() throws LifecycleException {
         getServer();
         getConnector();
         server.initialize();
-        server.start();
+        if (server instanceof Lifecycle) {
+            ((Lifecycle) server).start();
+        } else {
+            log.warn(sm.getString("tomcat.startNotLifecycle"));
+        }
     }
 
     /** 
-     * Stop the server.
+     * Stop the server, assuming that the Server implementation implements
+     * {@link Lifecycle} (the standard implementation does). If it does not, the
+     * {@link Server} must be stopped directly.
      * @throws LifecycleException 
      */
     public void stop() throws LifecycleException {
-        getServer().stop();
+        getServer();
+        if (server instanceof Lifecycle) {
+            ((Lifecycle) server).stop();
+        } else {
+            log.warn(sm.getString("tomcat.stopNotLifecycle"));
+        }
     }
 
 
@@ -353,7 +375,7 @@
      * Get the service object. Can be used to add more 
      * connectors and few other global settings.
      */
-    public StandardService getService() {
+    public Service getService() {
         getServer();
         return service;
     }
@@ -365,11 +387,11 @@
      * 
      * @param host
      */
-    public void setHost(StandardHost host) {
+    public void setHost(Host host) {
         this.host = host;
     }
     
-    public StandardHost getHost() {
+    public Host getHost() {
         if (host == null) {
             host = new StandardHost();
             host.setName(hostname);
@@ -393,7 +415,7 @@
     /** 
      * Access to the engine, for further customization.
      */
-    public StandardEngine getEngine() {
+    public Engine getEngine() {
         if(engine == null ) {
             getServer();
             engine = new StandardEngine();
@@ -408,7 +430,7 @@
      * Get the server object. You can add listeners and few more
      * customizations. JNDI is disabled by default.  
      */
-    public StandardServer getServer() {
+    public Server getServer() {
         
         if (server != null) {
             return server;
@@ -427,14 +449,16 @@
         return server;
     }
 
-    public StandardContext addContext(StandardHost host, 
-                                      String contextPath, 
-                                      String dir) {
+    public Context addContext(Host host, String contextPath, String dir) {
         silence(contextPath);
-        StandardContext ctx = new StandardContext();
+        Context ctx = new StandardContext();
         ctx.setPath( contextPath );
         ctx.setDocBase(dir);
-        ctx.addLifecycleListener(new FixContextListener());
+        if (ctx instanceof Lifecycle) {
+            ((Lifecycle) ctx).addLifecycleListener(new FixContextListener());
+        } else {
+            log.warn(sm.getString("tomcat.addContextNotLifecycle"));
+        }
         
         if (host == null) {
             getHost().addChild(ctx);
@@ -444,23 +468,27 @@
         return ctx;
     }
     
-    public StandardContext addWebapp(StandardHost host, 
-                                     String url, String path) {
+    public Context addWebapp(Host host, String url, String path) {
         silence(url);
 
-        StandardContext ctx = new StandardContext();
+        Context ctx = new StandardContext();
         ctx.setPath( url );
         ctx.setDocBase(path);
         if (defaultRealm == null) {
             initSimpleAuth();
         }
         ctx.setRealm(defaultRealm);
-        ctx.addLifecycleListener(new DefaultWebXmlListener());
-        
-        ContextConfig ctxCfg = new ContextConfig();
-        ctx.addLifecycleListener( ctxCfg );
-        // prevent it from looking ( if it finds one - it'll have dup error )
-        ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
+        if (ctx instanceof Lifecycle) {
+            ((Lifecycle) ctx).addLifecycleListener(new DefaultWebXmlListener());
+            
+            ContextConfig ctxCfg = new ContextConfig();
+            ((Lifecycle) ctx).addLifecycleListener(ctxCfg);
+            
+            // prevent it from looking ( if it finds one - it'll have dup error )
+            ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
+        } else {
+            log.warn(sm.getString("tomcat.addWebappNotLifecycle"));
+        }
         
         if (host == null) {
             getHost().addChild(ctx);
@@ -572,13 +600,21 @@
     }
     
     /**
-     * Enables JNDI naming which is disabled by default.
+     * Enables JNDI naming which is disabled by default. Server must implement
+     * {@link Lifecycle} in order for the {@link NamingContextListener} to be
+     * used.
+     * 
      */
     public void enableNaming() {
         // Make sure getServer() has been called as that is where naming is
         // disabled
         getServer();
-        server.addLifecycleListener(new NamingContextListener());
+        if (server instanceof Lifecycle) {
+            ((Lifecycle) server).addLifecycleListener(
+                    new NamingContextListener());
+        } else {
+            log.warn(sm.getString("tomcat.namingNotLifecycle"));
+        }
         
         System.setProperty("catalina.useNaming", "true");
 
@@ -607,23 +643,23 @@
      * Provide default configuration for a context. This is the programmatic
      * equivalent of the default web.xml. 
      * 
-     *  TODO: in normal tomcat, if default-web.xml is not found, use this 
+     *  TODO: in normal Tomcat, if default-web.xml is not found, use this 
      *  method
      *  
      * @param contextPath   The context to set the defaults for
      */
     public void initWebappDefaults(String contextPath) {
         Container ctx = getHost().findChild(contextPath);
-        initWebappDefaults((StandardContext) ctx);
+        initWebappDefaults((Context) ctx);
     }
     
     /**
      * Static version of {@link #initWebappDefaults(String)}
      * @param ctx   The context to set the defaults for
      */
-    public static void initWebappDefaults(StandardContext ctx) {
+    public static void initWebappDefaults(Context ctx) {
         // Default servlet 
-        StandardWrapper servlet = addServlet(
+        Wrapper servlet = addServlet(
                 ctx, "default", "org.apache.catalina.servlets.DefaultServlet");
         servlet.setLoadOnStartup(1);
 
@@ -680,15 +716,12 @@
     /**
      * Fix reload - required if reloading and using programmatic configuration.
      * When a context is reloaded, any programmatic configuration is lost. This
-     * listener sets the equivalent of conf/web.xml when the context starts. The
-     * context needs to be an instance of StandardContext for this listener to
-     * have any effect.
+     * listener sets the equivalent of conf/web.xml when the context starts.
      */
     public static class DefaultWebXmlListener implements LifecycleListener {
         public void lifecycleEvent(LifecycleEvent event) {
-            if (Lifecycle.BEFORE_START_EVENT.equals(event.getType()) &&
-                    event.getLifecycle() instanceof StandardContext) {
-                initWebappDefaults((StandardContext) event.getLifecycle());
+            if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) {
+                initWebappDefaults((Context) event.getLifecycle());
             }
         }
     }

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java Sun Feb 14 23:45:18
2010
@@ -23,7 +23,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.Context;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.startup.Tomcat;
@@ -50,7 +50,7 @@
             if (init) return;
             
             Tomcat tomcat = getTomcatInstance();
-            StandardContext root = tomcat.addContext("", TEMP_DIR);
+            Context root = tomcat.addContext("", TEMP_DIR);
             Tomcat.addServlet(root, "Simple", new SimpleServlet());
             root.addServletMapping("/test", "Simple");
             tomcat.getConnector().setProperty("maxKeepAliveRequests", "5");

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=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java Sun Feb 14 23:45:18 2010
@@ -26,8 +26,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.catalina.Context;
 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;
@@ -125,7 +125,7 @@
             if (init) return;
             
             Tomcat tomcat = getTomcatInstance();
-            StandardContext root = tomcat.addContext("", TEMP_DIR);
+            Context root = tomcat.addContext("", TEMP_DIR);
             Tomcat.addServlet(root, "Bug37794", new Bug37794Servlet());
             root.addServletMapping("/test", "Bug37794");
             tomcat.start();
@@ -206,7 +206,7 @@
         Tomcat tomcat = getTomcatInstance();
         
         // Must have a real docBase - just use temp
-        StandardContext ctx = 
+        Context ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
 
         LoginConfig config = new LoginConfig();

Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java Sun Feb 14 23:45:18
2010
@@ -27,6 +27,7 @@
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
+import org.apache.catalina.Context;
 import org.apache.catalina.deploy.FilterDef;
 import org.apache.catalina.deploy.FilterMap;
 import org.apache.catalina.startup.SimpleHttpClient;
@@ -49,7 +50,7 @@
         File docBase = new File(tomcat.getHost().getAppBase(), "ROOT");
         docBase.mkdirs();
         
-        StandardContext root = tomcat.addContext("", "ROOT");
+        Context root = tomcat.addContext("", "ROOT");
        
         // Add test a filter that fails
         FilterDef filterDef = new FilterDef();

Modified: tomcat/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java (original)
+++ tomcat/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java Sun
Feb 14 23:45:18 2010
@@ -9,7 +9,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.Context;
+import org.apache.catalina.Lifecycle;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 
@@ -19,7 +20,7 @@
         Tomcat tomcat = getTomcatInstance();
         
         // Must have a real docBase - just use temp
-        StandardContext ctx = 
+        Context ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
         
         Tomcat.addServlet(ctx, "taskServlet", new TaskServlet());
@@ -31,7 +32,11 @@
         getUrl("http://localhost:" + getPort() + "/");
         
         // Stop the context
-        ctx.stop();
+        if (ctx instanceof Lifecycle) {
+            ((Lifecycle) ctx).stop();
+        } else {
+            fail("Test requires context implements Lifecycle");
+        }
         
         // If the thread still exists, we have a thread/memory leak
         Thread[] threads = getThreads();

Modified: tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java Sun Feb 14 23:45:18 2010
@@ -34,7 +34,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.deploy.ContextEnvironment;
 import org.apache.catalina.deploy.ContextResourceLink;
 import org.apache.catalina.realm.GenericPrincipal;
@@ -169,7 +168,7 @@
         Tomcat tomcat = getTomcatInstance();
         
         // Must have a real docBase - just use temp
-        StandardContext ctx = 
+        org.apache.catalina.Context ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
         // You can customize the context by calling 
         // its API
@@ -230,7 +229,7 @@
         Tomcat tomcat = getTomcatInstance();
         
         // Must have a real docBase - just use temp
-        StandardContext ctx = 
+        org.apache.catalina.Context ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
         
         // You can customise the context by calling its API
@@ -260,7 +259,7 @@
         Tomcat tomcat = getTomcatInstance();
         
         // Must have a real docBase - just use temp
-        StandardContext ctx = 
+        org.apache.catalina.Context ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
         
         // You can customise the context by calling its API
@@ -299,7 +298,7 @@
         
         File appDir = new File("output/build/webapps" + contextPath);
         // app dir is relative to server home
-        StandardContext ctx =
+        org.apache.catalina.Context ctx =
             tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
         
         Tomcat.addServlet(ctx, "testGetResource", new GetResource());

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java Sun Feb 14 23:45:18
2010
@@ -24,7 +24,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.Context;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.startup.Tomcat;
 
@@ -68,7 +68,7 @@
 
     public static void addServlets(Tomcat tomcat) {
         // Must have a real docBase - just use temp
-        StandardContext ctx = 
+        Context ctx = 
             tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
 
         Tomcat.addServlet(ctx, "invalid", new CookieServlet("na;me", "value"));

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java Sun Feb 14 23:45:18
2010
@@ -24,7 +24,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.Context;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.startup.Tomcat;
@@ -49,7 +49,7 @@
 
         private void doRequest() throws Exception {
             Tomcat tomcat = getTomcatInstance();
-            StandardContext root = tomcat.addContext("", TEMP_DIR);
+            Context root = tomcat.addContext("", TEMP_DIR);
             Tomcat.addServlet(root, "Simple", new SimpleServlet());
             root.addServletMapping("/test", "Simple");
             

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java Sun Feb 14
23:45:18 2010
@@ -24,7 +24,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.Context;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.startup.Tomcat;
@@ -47,7 +47,7 @@
 
         private void doRequest() throws Exception {
             Tomcat tomcat = getTomcatInstance();
-            StandardContext root = tomcat.addContext("", TEMP_DIR);
+            Context root = tomcat.addContext("", TEMP_DIR);
             Tomcat.addServlet(root, "Simple", new SimpleServlet());
             root.addServletMapping("/test", "Simple");
             

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java?rev=910123&r1=910122&r2=910123&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java Sun Feb 14
23:45:18 2010
@@ -24,7 +24,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.Context;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.startup.Tomcat;
@@ -44,7 +44,7 @@
 
         private void doRequest() throws Exception {
             Tomcat tomcat = getTomcatInstance();
-            StandardContext root = tomcat.addContext("", TEMP_DIR);
+            Context root = tomcat.addContext("", TEMP_DIR);
             Tomcat.addServlet(root, "Simple", new SimpleServlet());
             root.addServletMapping("/test", "Simple");
             



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


Mime
View raw message