tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1187812 [7/8] - in /tomcat/trunk/modules/tomcat-lite: ./ java/org/apache/coyote/lite/ java/org/apache/tomcat/lite/http/ java/org/apache/tomcat/lite/io/ java/org/apache/tomcat/lite/io/jsse/ java/org/apache/tomcat/lite/proxy/ java/org/apache...
Date Sat, 22 Oct 2011 21:31:02 GMT
Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/Tomcat.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/Tomcat.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/Tomcat.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/Tomcat.java Sat Oct 22 21:30:59 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,37 +49,37 @@ import org.apache.catalina.startup.Conte
 
 // This class is here for compat with Tomcat6.
 
-// 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 
+// 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
 // need for the baseDir
 
-// TODO: allow contexts without a base dir - i.e. 
+// TODO: allow contexts without a base dir - i.e.
 // only programmatic. This would disable the default servlet.
 
 /**
  * Minimal tomcat starter for embedding/unit tests.
- * 
- * Tomcat supports multiple styles of configuration and 
+ *
+ * Tomcat supports multiple styles of configuration and
  * startup - the most common and stable is server.xml-based,
  * implemented in org.apache.catalina.startup.Bootstrap.
  *
- * This class is for use in apps that embed tomcat. 
+ * This class is for use in apps that embed tomcat.
  * Requirements:
- * 
+ *
  * - all tomcat classes and possibly servlets are in the classpath.
  * ( for example all is in one big jar, or in eclipse CP, or in any other
  * combination )
- * 
+ *
  * - we need one temporary directory for work files
- * 
- * - no config file is required. This class provides methods to 
- * use if you have a webapp with a web.xml file, but it is 
+ *
+ * - no config file is required. This class provides methods to
+ * use if you have a webapp with a web.xml file, but it is
  * optional - you can use your own servlets.
- * 
+ *
  * This class provides a main() and few simple CLI arguments,
  * see setters for doc. It can be used for simple tests and
  * demo.
- * 
+ *
  * @see TestTomcat for examples on how to use this
  * @author Costin Manolache
  */
@@ -93,134 +93,134 @@ public class Tomcat {
 
     boolean started = false;
     // To make it a bit easier to config for the common case
-    // ( one host, one context ). 
+    // ( one host, one context ).
     protected StandardHost host;
 
-    // TODO: it's easy to add support for more hosts - but is it 
+    // TODO: it's easy to add support for more hosts - but is it
     // really needed ?
 
     // TODO: allow use of in-memory connector
-    
+
     protected int port = 8080;
     protected String hostname = "localhost";
     protected String basedir;
-    
-    // Default in-memory realm, will be set by default on 
-    // created contexts. Can be replaced with setRealm() on 
+
+    // Default in-memory realm, will be set by default on
+    // created contexts. Can be replaced with setRealm() on
     // the context.
     protected Realm defaultRealm;
     private Map<String, String> userPass = new HashMap<String, String>();
-    private Map<String, List<String>> userRoles = 
+    private Map<String, List<String>> userRoles =
             new HashMap<String, List<String>>();
     private Map<String, Principal> userPrincipals = new HashMap<String, Principal>();
-    
+
     public Tomcat() {
         // NOOP
     }
-    
+
     /**
-     * Tomcat needs a directory for temp files. This should be the 
-     * first method called. 
-     * 
+     * Tomcat needs a directory for temp files. This should be the
+     * first method called.
+     *
      * By default, if this method is not called, we use:
-     *  - system properties - catalina.base, catalina.home 
+     *  - system properties - catalina.base, catalina.home
      *  - $HOME/tomcat.$PORT
      * ( /tmp doesn't seem a good choice for security ).
-     *   
      *
-     * TODO: better default ? Maybe current dir ? 
+     *
+     * TODO: better default ? Maybe current dir ?
      * TODO: disable work dir if not needed ( no jsp, etc ).
      */
     public void setBaseDir(String basedir) {
         this.basedir = basedir;
     }
 
-    /** 
-     * Set the port for the default connector. Must 
+    /**
+     * Set the port for the default connector. Must
      * be called before start().
      */
     public void setPort(int port) {
         this.port = port;
     }
-    
-    /** 
-     * The the hostname of the default host, default is 
+
+    /**
+     * The the hostname of the default host, default is
      * 'localhost'.
      */
     public void setHostname(String s) {
         hostname = s;
     }
 
-    /** 
+    /**
      * Add a webapp using normal WEB-INF/web.xml if found.
-     * 
+     *
      * @param contextPath
      * @param baseDir
      * @return new StandardContext
-     * @throws ServletException 
+     * @throws ServletException
      */
-    public StandardContext addWebapp(String contextPath, 
+    public StandardContext addWebapp(String contextPath,
                                      String baseDir) throws ServletException {
-        
-        return addWebapp(getHost(), contextPath, baseDir);    
+
+        return addWebapp(getHost(), contextPath, baseDir);
     }
-    
-    
-    /** 
+
+
+    /**
      * Add a context - programmatic mode, no web.xml used.
      *
      * API calls equivalent with web.xml:
-     * 
+     *
      * context-param
      *  ctx.addParameter("name", "value");
-     *     
+     *
      *
      * error-page
      *    ErrorPage ep = new ErrorPage();
      *    ep.setErrorCode(500);
      *    ep.setLocation("/error.html");
      *    ctx.addErrorPage(ep);
-     *   
+     *
      * ctx.addMimeMapping("ext", "type");
-     * 
+     *
      * Note: If you reload the Context, all your configuration will be lost. If
      * you need reload support, consider using a LifecycleListener to provide
      * your configuration.
-     *  
+     *
      * TODO: add the rest
      *
      *  @param contextPath "/" for root context.
-     *  @param baseDir base dir for the context, for static files. Must exist, 
+     *  @param baseDir base dir for the context, for static files. Must exist,
      *  relative to the server home
      */
-    public StandardContext addContext(String contextPath, 
+    public StandardContext addContext(String contextPath,
                                       String baseDir) {
         return addContext(getHost(), contextPath, baseDir);
     }
 
     /**
-     * Equivalent with 
+     * Equivalent with
      *  <servlet><servlet-name><servlet-class>.
-     *  
-     * In general it is better/faster to use the method that takes a 
-     * Servlet as param - this one can be used if the servlet is not 
+     *
+     * In general it is better/faster to use the method that takes a
+     * Servlet as param - this one can be used if the servlet is not
      * commonly used, and want to avoid loading all deps.
      * ( for example: jsp servlet )
-     * 
+     *
      * You can customize the returned servlet, ex:
-     * 
+     *
      *    wrapper.addInitParameter("name", "value");
-     *    
+     *
      * @param contextPath   Context to add Servlet to
      * @param servletName   Servlet name (used in mappings)
      * @param servletClass  The class to be used for the Servlet
      * @return The wrapper for the servlet
      */
-    public StandardWrapper addServlet(String contextPath, 
-            String servletName, 
+    public StandardWrapper addServlet(String contextPath,
+            String servletName,
             String servletClass) {
         Container ctx = getHost().findChild(contextPath);
-        return addServlet((StandardContext) ctx, 
+        return addServlet((StandardContext) ctx,
                 servletName, servletClass);
     }
 
@@ -231,15 +231,15 @@ public class Tomcat {
      * @param servletClass  The class to be used for the Servlet
      * @return The wrapper for the servlet
      */
-    public static StandardWrapper addServlet(StandardContext ctx, 
-                                      String servletName, 
+    public static StandardWrapper addServlet(StandardContext ctx,
+                                      String servletName,
                                       String servletClass) {
         // will do class for name and set init params
         StandardWrapper sw = (StandardWrapper)ctx.createWrapper();
         sw.setServletClass(servletClass);
         sw.setName(servletName);
         ctx.addChild(sw);
-        
+
         return sw;
     }
 
@@ -251,11 +251,11 @@ public class Tomcat {
      * @param servlet       The Servlet to add
      * @return The wrapper for the servlet
      */
-    public StandardWrapper addServlet(String contextPath, 
-            String servletName, 
+    public StandardWrapper addServlet(String contextPath,
+            String servletName,
             Servlet servlet) {
         Container ctx = getHost().findChild(contextPath);
-        return addServlet((StandardContext) ctx, 
+        return addServlet((StandardContext) ctx,
                 servletName, servlet);
     }
 
@@ -267,20 +267,20 @@ public class Tomcat {
      * @return The wrapper for the servlet
      */
     public static StandardWrapper addServlet(StandardContext ctx,
-                                      String servletName, 
+                                      String servletName,
                                       Servlet servlet) {
         // will do class for name and set init params
         StandardWrapper sw = new ExistingStandardWrapper(servlet);
         sw.setName(servletName);
         ctx.addChild(sw);
-        
+
         return sw;
     }
-    
-    
+
+
     /**
      * Initialize and start the server.
-     * @throws LifecycleException 
+     * @throws LifecycleException
      */
     public void start() throws LifecycleException {
         if (started) {
@@ -292,26 +292,26 @@ public class Tomcat {
         server.start();
     }
 
-    /** 
+    /**
      * Stop the server.
-     * @throws LifecycleException 
+     * @throws LifecycleException
      */
     public void stop() throws LifecycleException {
         getServer().stop();
     }
 
 
-    /** 
-     * Add a user for the in-memory realm. All created apps use this 
+    /**
+     * Add a user for the in-memory realm. All created apps use this
      * by default, can be replaced using setRealm().
-     *  
+     *
      */
     public void addUser(String user, String pass) {
         userPass.put(user, pass);
     }
-    
+
     /**
-     * @see #addUser(String, String) 
+     * @see #addUser(String, String)
      */
     public void addRole(String user, String role) {
         List<String> roles = userRoles.get(user);
@@ -324,14 +324,14 @@ public class Tomcat {
 
     // ------- Extra customization -------
     // You can tune individual tomcat objects, using internal APIs
-    
-    /** 
-     * Get the default http connector. You can set more 
+
+    /**
+     * Get the default http connector. You can set more
      * parameters - the port is already initialized.
-     * 
+     *
      * Alternatively, you can construct a Connector and set any params,
      * then call addConnector(Connector)
-     * 
+     *
      * @return A connector object that can be customized
      */
     public Connector getConnector() {
@@ -342,7 +342,7 @@ public class Tomcat {
         // This will load Apr connector if available,
         // default to nio. I'm having strange problems with apr
         // and for the use case the speed benefit wouldn't matter.
-        
+
         //connector = new Connector("HTTP/1.1");
         try {
             connector = new Connector("org.apache.coyote.http11.Http11Protocol");
@@ -351,16 +351,16 @@ public class Tomcat {
         } catch (Exception e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
-        } 
+        }
         return connector;
     }
-    
+
     public void setConnector(Connector connector) {
         this.connector = connector;
     }
-    
-    /** 
-     * Get the service object. Can be used to add more 
+
+    /**
+     * Get the service object. Can be used to add more
      * connectors and few other global settings.
      */
     public StandardService getService() {
@@ -368,17 +368,17 @@ public class Tomcat {
         return service;
     }
 
-    /** 
+    /**
      * Sets the current host - all future webapps will
-     * be added to this host. When tomcat starts, the 
+     * be added to this host. When tomcat starts, the
      * host will be the default host.
-     * 
+     *
      * @param host
      */
     public void setHost(StandardHost host) {
         this.host = host;
     }
-    
+
     public StandardHost getHost() {
         if (host == null) {
             host = new StandardHost();
@@ -388,19 +388,19 @@ public class Tomcat {
         }
         return host;
     }
-    
-    /** 
+
+    /**
      * Set a custom realm for auth. If not called, a simple
      * default will be used, using an internal map.
-     * 
+     *
      * Must be called before adding a context.
      */
     public void setDefaultRealm(Realm realm) {
         defaultRealm = realm;
     }
-    
 
-    /** 
+
+    /**
      * Access to the engine, for further customization.
      */
     public StandardEngine getEngine() {
@@ -416,36 +416,36 @@ public class Tomcat {
 
     /**
      * Get the server object. You can add listeners and few more
-     * customizations. JNDI is disabled by default.  
+     * customizations. JNDI is disabled by default.
      */
     public StandardServer getServer() {
-        
+
         if (server != null) {
             return server;
         }
-        
-        initBaseDir(); 
-        
+
+        initBaseDir();
+
         System.setProperty("catalina.useNaming", "false");
-        
+
         server = new StandardServer();
         server.setPort( -1 );
-        
+
         service = new StandardService();
         service.setName("Tomcat");
         server.addService( service );
         return server;
     }
 
-    public StandardContext addContext(StandardHost host, 
-                                      String contextPath, 
+    public StandardContext addContext(StandardHost host,
+                                      String contextPath,
                                       String dir) {
         silence(contextPath);
         StandardContext ctx = new StandardContext();
         ctx.setPath( contextPath );
         ctx.setDocBase(dir);
         ctx.addLifecycleListener(new FixContextListener());
-        
+
         if (host == null) {
             getHost().addChild(ctx);
         } else {
@@ -453,8 +453,8 @@ public class Tomcat {
         }
         return ctx;
     }
-    
-    public StandardContext addWebapp(StandardHost host, 
+
+    public StandardContext addWebapp(StandardHost host,
                                      String url, String path) {
         silence(url);
 
@@ -466,27 +466,27 @@ public class Tomcat {
         }
         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 (host == null) {
             getHost().addChild(ctx);
         } else {
             host.addChild(ctx);
         }
-        
+
         return ctx;
     }
 
 
     // ---------- Helper methods and classes -------------------
-    
-    /** 
-     * Initialize an in-memory realm. You can replace it 
-     * for contexts with a real one. 
+
+    /**
+     * Initialize an in-memory realm. You can replace it
+     * for contexts with a real one.
      */
     protected void initSimpleAuth() {
         defaultRealm = new RealmBase() {
@@ -512,16 +512,16 @@ public class Tomcat {
                             public String getName() {
                                 return username;
                             }
-                            
+
                         };
                     }
                 }
                 return p;
             }
-            
-        };        
+
+        };
     }
-    
+
     protected void initBaseDir() {
         if (basedir == null) {
             basedir = System.getProperty("catalina.base");
@@ -531,7 +531,7 @@ public class Tomcat {
         }
         if (basedir == null) {
             // Create a temp dir.
-            basedir = System.getProperty("user.dir") + 
+            basedir = System.getProperty("user.dir") +
                 "/tomcat." + port;
             File home = new File(basedir);
             home.mkdir();
@@ -555,7 +555,7 @@ public class Tomcat {
         "org.apache.catalina.core.ApplicationContext",
         "org.apache.catalina.core.AprLifecycleListener"
     };
-    
+
     /**
      * Controls if the loggers will be silenced or not.
      * @param silent    <code>true</code> sets the log level to WARN for the
@@ -573,16 +573,16 @@ public class Tomcat {
             }
         }
     }
-    
+
     private void silence(String ctx) {
         String base = "org.apache.catalina.core.ContainerBase.[default].[";
         base += getHost().getName();
         base += "].[";
-        base += ctx; 
+        base += ctx;
         base += "]";
         Logger.getLogger(base).setLevel(Level.WARNING);
     }
-    
+
     /**
      * Enables JNDI naming which is disabled by default.
      */
@@ -590,7 +590,7 @@ public class Tomcat {
         // Make sure getServer() has been called as that is where naming is
         // disabled
         getServer();
-        
+
         System.setProperty("catalina.useNaming", "true");
         String value = "org.apache.naming";
         String oldValue =
@@ -610,24 +610,24 @@ public class Tomcat {
 
     /**
      * 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 
+     * equivalent of the default web.xml.
+     *
+     *  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);
     }
-    
+
     /**
      * Static version of {@link #initWebappDefaults(String)}
      * @param ctx   The context to set the defaults for
      */
     public static void initWebappDefaults(StandardContext ctx) {
-        // Default servlet 
+        // Default servlet
         StandardWrapper servlet = addServlet(
                 ctx, "default", "org.apache.catalina.servlets.DefaultServlet");
         servlet.setLoadOnStartup(1);
@@ -637,8 +637,8 @@ public class Tomcat {
                 ctx, "jsp", "org.apache.jasper.servlet.JspServlet");
         servlet.addInitParameter("fork", "false");
         servlet.setLoadOnStartup(3);
-        
-        // Servlet mappings 
+
+        // Servlet mappings
         ctx.addServletMapping("/", "default");
         ctx.addServletMapping("*.jsp", "jsp");
         ctx.addServletMapping("*.jspx", "jsp");
@@ -646,23 +646,23 @@ public class Tomcat {
         // Sessions
         ctx.setManager( new StandardManager());
         ctx.setSessionTimeout(30);
-        
+
         // MIME mappings
         for (int i = 0; i < DEFAULT_MIME_MAPPINGS.length; ) {
             ctx.addMimeMapping(DEFAULT_MIME_MAPPINGS[i++],
                     DEFAULT_MIME_MAPPINGS[i++]);
         }
-        
+
         // Welcome files
         ctx.addWelcomeFile("index.html");
         ctx.addWelcomeFile("index.htm");
         ctx.addWelcomeFile("index.jsp");
     }
 
-    
+
     /**
      * Fix startup sequence - required if you don't use web.xml.
-     * 
+     *
      * The start() method in context will set 'configured' to false - and
      * expects a listener to set it back to true.
      */
@@ -678,7 +678,7 @@ public class Tomcat {
                 return;
             }
         }
-        
+
     }
 
 
@@ -700,14 +700,14 @@ public class Tomcat {
 
 
     /**
-     * Helper class for wrapping existing servlets. This disables servlet 
+     * Helper class for wrapping existing servlets. This disables servlet
      * lifecycle and normal reloading, but also reduces overhead and provide
-     * more direct control over the servlet.  
+     * more direct control over the servlet.
      */
     public static class ExistingStandardWrapper extends StandardWrapper {
         private Servlet existing;
         boolean init = false;
-        
+
         public ExistingStandardWrapper( Servlet existing ) {
             this.existing = existing;
         }
@@ -726,105 +726,105 @@ public class Tomcat {
         }
         @Override
         public boolean isUnavailable() {
-            return false;       
+            return false;
         }
     }
-    
+
     /**
      * TODO: would a properties resource be better ? Or just parsing
      * /etc/mime.types ?
-     * This is needed because we don't use the default web.xml, where this 
+     * This is needed because we don't use the default web.xml, where this
      * is encoded.
      */
     public static final String[] DEFAULT_MIME_MAPPINGS = {
-        "abs", "audio/x-mpeg", 
-        "ai", "application/postscript", 
-        "aif", "audio/x-aiff", 
-        "aifc", "audio/x-aiff", 
-        "aiff", "audio/x-aiff", 
-        "aim", "application/x-aim", 
-        "art", "image/x-jg", 
-        "asf", "video/x-ms-asf", 
-        "asx", "video/x-ms-asf", 
-        "au", "audio/basic", 
-        "avi", "video/x-msvideo", 
-        "avx", "video/x-rad-screenplay", 
-        "bcpio", "application/x-bcpio", 
-        "bin", "application/octet-stream", 
-        "bmp", "image/bmp", 
-        "body", "text/html", 
-        "cdf", "application/x-cdf", 
-        "cer", "application/x-x509-ca-cert", 
-        "class", "application/java", 
-        "cpio", "application/x-cpio", 
-        "csh", "application/x-csh", 
-        "css", "text/css", 
-        "dib", "image/bmp", 
-        "doc", "application/msword", 
-        "dtd", "application/xml-dtd", 
-        "dv", "video/x-dv", 
-        "dvi", "application/x-dvi", 
-        "eps", "application/postscript", 
-        "etx", "text/x-setext", 
-        "exe", "application/octet-stream", 
-        "gif", "image/gif", 
-        "gtar", "application/x-gtar", 
-        "gz", "application/x-gzip", 
-        "hdf", "application/x-hdf", 
-        "hqx", "application/mac-binhex40", 
-        "htc", "text/x-component", 
-        "htm", "text/html", 
-        "html", "text/html", 
-        "hqx", "application/mac-binhex40", 
-        "ief", "image/ief", 
-        "jad", "text/vnd.sun.j2me.app-descriptor", 
-        "jar", "application/java-archive", 
-        "java", "text/plain", 
-        "jnlp", "application/x-java-jnlp-file", 
-        "jpe", "image/jpeg", 
-        "jpeg", "image/jpeg", 
-        "jpg", "image/jpeg", 
-        "js", "text/javascript", 
-        "jsf", "text/plain", 
-        "jspf", "text/plain", 
-        "kar", "audio/x-midi", 
-        "latex", "application/x-latex", 
-        "m3u", "audio/x-mpegurl", 
-        "mac", "image/x-macpaint", 
-        "man", "application/x-troff-man", 
-        "mathml", "application/mathml+xml", 
-        "me", "application/x-troff-me", 
-        "mid", "audio/x-midi", 
-        "midi", "audio/x-midi", 
-        "mif", "application/x-mif", 
-        "mov", "video/quicktime", 
-        "movie", "video/x-sgi-movie", 
-        "mp1", "audio/x-mpeg", 
-        "mp2", "audio/x-mpeg", 
-        "mp3", "audio/x-mpeg", 
-        "mp4", "video/mp4", 
-        "mpa", "audio/x-mpeg", 
-        "mpe", "video/mpeg", 
-        "mpeg", "video/mpeg", 
-        "mpega", "audio/x-mpeg", 
-        "mpg", "video/mpeg", 
-        "mpv2", "video/mpeg2", 
-        "ms", "application/x-wais-source", 
-        "nc", "application/x-netcdf", 
-        "oda", "application/oda", 
-        "odb", "application/vnd.oasis.opendocument.database", 
-        "odc", "application/vnd.oasis.opendocument.chart", 
-        "odf", "application/vnd.oasis.opendocument.formula", 
-        "odg", "application/vnd.oasis.opendocument.graphics", 
-        "odi", "application/vnd.oasis.opendocument.image", 
-        "odm", "application/vnd.oasis.opendocument.text-master", 
-        "odp", "application/vnd.oasis.opendocument.presentation", 
-        "ods", "application/vnd.oasis.opendocument.spreadsheet", 
-        "odt", "application/vnd.oasis.opendocument.text", 
-        "otg", "application/vnd.oasis.opendocument.graphics-template", 
-        "oth", "application/vnd.oasis.opendocument.text-web", 
-        "otp", "application/vnd.oasis.opendocument.presentation-template", 
-        "ots", "application/vnd.oasis.opendocument.spreadsheet-template ", 
+        "abs", "audio/x-mpeg",
+        "ai", "application/postscript",
+        "aif", "audio/x-aiff",
+        "aifc", "audio/x-aiff",
+        "aiff", "audio/x-aiff",
+        "aim", "application/x-aim",
+        "art", "image/x-jg",
+        "asf", "video/x-ms-asf",
+        "asx", "video/x-ms-asf",
+        "au", "audio/basic",
+        "avi", "video/x-msvideo",
+        "avx", "video/x-rad-screenplay",
+        "bcpio", "application/x-bcpio",
+        "bin", "application/octet-stream",
+        "bmp", "image/bmp",
+        "body", "text/html",
+        "cdf", "application/x-cdf",
+        "cer", "application/x-x509-ca-cert",
+        "class", "application/java",
+        "cpio", "application/x-cpio",
+        "csh", "application/x-csh",
+        "css", "text/css",
+        "dib", "image/bmp",
+        "doc", "application/msword",
+        "dtd", "application/xml-dtd",
+        "dv", "video/x-dv",
+        "dvi", "application/x-dvi",
+        "eps", "application/postscript",
+        "etx", "text/x-setext",
+        "exe", "application/octet-stream",
+        "gif", "image/gif",
+        "gtar", "application/x-gtar",
+        "gz", "application/x-gzip",
+        "hdf", "application/x-hdf",
+        "hqx", "application/mac-binhex40",
+        "htc", "text/x-component",
+        "htm", "text/html",
+        "html", "text/html",
+        "hqx", "application/mac-binhex40",
+        "ief", "image/ief",
+        "jad", "text/vnd.sun.j2me.app-descriptor",
+        "jar", "application/java-archive",
+        "java", "text/plain",
+        "jnlp", "application/x-java-jnlp-file",
+        "jpe", "image/jpeg",
+        "jpeg", "image/jpeg",
+        "jpg", "image/jpeg",
+        "js", "text/javascript",
+        "jsf", "text/plain",
+        "jspf", "text/plain",
+        "kar", "audio/x-midi",
+        "latex", "application/x-latex",
+        "m3u", "audio/x-mpegurl",
+        "mac", "image/x-macpaint",
+        "man", "application/x-troff-man",
+        "mathml", "application/mathml+xml",
+        "me", "application/x-troff-me",
+        "mid", "audio/x-midi",
+        "midi", "audio/x-midi",
+        "mif", "application/x-mif",
+        "mov", "video/quicktime",
+        "movie", "video/x-sgi-movie",
+        "mp1", "audio/x-mpeg",
+        "mp2", "audio/x-mpeg",
+        "mp3", "audio/x-mpeg",
+        "mp4", "video/mp4",
+        "mpa", "audio/x-mpeg",
+        "mpe", "video/mpeg",
+        "mpeg", "video/mpeg",
+        "mpega", "audio/x-mpeg",
+        "mpg", "video/mpeg",
+        "mpv2", "video/mpeg2",
+        "ms", "application/x-wais-source",
+        "nc", "application/x-netcdf",
+        "oda", "application/oda",
+        "odb", "application/vnd.oasis.opendocument.database",
+        "odc", "application/vnd.oasis.opendocument.chart",
+        "odf", "application/vnd.oasis.opendocument.formula",
+        "odg", "application/vnd.oasis.opendocument.graphics",
+        "odi", "application/vnd.oasis.opendocument.image",
+        "odm", "application/vnd.oasis.opendocument.text-master",
+        "odp", "application/vnd.oasis.opendocument.presentation",
+        "ods", "application/vnd.oasis.opendocument.spreadsheet",
+        "odt", "application/vnd.oasis.opendocument.text",
+        "otg", "application/vnd.oasis.opendocument.graphics-template",
+        "oth", "application/vnd.oasis.opendocument.text-web",
+        "otp", "application/vnd.oasis.opendocument.presentation-template",
+        "ots", "application/vnd.oasis.opendocument.spreadsheet-template ",
         "ott", "application/vnd.oasis.opendocument.text-template",
         "ogx", "application/ogg",
         "ogv", "video/ogg",
@@ -836,79 +836,79 @@ public class Tomcat {
         "axa", "audio/annodex",
         "axv", "video/annodex",
         "xspf", "application/xspf+xml",
-        "pbm", "image/x-portable-bitmap", 
-        "pct", "image/pict", 
-        "pdf", "application/pdf", 
-        "pgm", "image/x-portable-graymap", 
-        "pic", "image/pict", 
-        "pict", "image/pict", 
-        "pls", "audio/x-scpls", 
-        "png", "image/png", 
-        "pnm", "image/x-portable-anymap", 
-        "pnt", "image/x-macpaint", 
-        "ppm", "image/x-portable-pixmap", 
+        "pbm", "image/x-portable-bitmap",
+        "pct", "image/pict",
+        "pdf", "application/pdf",
+        "pgm", "image/x-portable-graymap",
+        "pic", "image/pict",
+        "pict", "image/pict",
+        "pls", "audio/x-scpls",
+        "png", "image/png",
+        "pnm", "image/x-portable-anymap",
+        "pnt", "image/x-macpaint",
+        "ppm", "image/x-portable-pixmap",
         "ppt", "application/vnd.ms-powerpoint",
         "pps", "application/vnd.ms-powerpoint",
-        "ps", "application/postscript", 
-        "psd", "image/x-photoshop", 
-        "qt", "video/quicktime", 
-        "qti", "image/x-quicktime", 
-        "qtif", "image/x-quicktime", 
-        "ras", "image/x-cmu-raster", 
-        "rdf", "application/rdf+xml", 
-        "rgb", "image/x-rgb", 
-        "rm", "application/vnd.rn-realmedia", 
-        "roff", "application/x-troff", 
-        "rtf", "application/rtf", 
-        "rtx", "text/richtext", 
-        "sh", "application/x-sh", 
-        "shar", "application/x-shar", 
+        "ps", "application/postscript",
+        "psd", "image/x-photoshop",
+        "qt", "video/quicktime",
+        "qti", "image/x-quicktime",
+        "qtif", "image/x-quicktime",
+        "ras", "image/x-cmu-raster",
+        "rdf", "application/rdf+xml",
+        "rgb", "image/x-rgb",
+        "rm", "application/vnd.rn-realmedia",
+        "roff", "application/x-troff",
+        "rtf", "application/rtf",
+        "rtx", "text/richtext",
+        "sh", "application/x-sh",
+        "shar", "application/x-shar",
         /*"shtml", "text/x-server-parsed-html",*/
-        "smf", "audio/x-midi", 
-        "sit", "application/x-stuffit", 
-        "snd", "audio/basic", 
-        "src", "application/x-wais-source", 
-        "sv4cpio", "application/x-sv4cpio", 
-        "sv4crc", "application/x-sv4crc", 
-        "svg", "image/svg+xml", 
-        "svgz", "image/svg+xml", 
-        "swf", "application/x-shockwave-flash", 
-        "t", "application/x-troff", 
-        "tar", "application/x-tar", 
-        "tcl", "application/x-tcl", 
-        "tex", "application/x-tex", 
-        "texi", "application/x-texinfo", 
-        "texinfo", "application/x-texinfo", 
-        "tif", "image/tiff", 
-        "tiff", "image/tiff", 
-        "tr", "application/x-troff", 
-        "tsv", "text/tab-separated-values", 
-        "txt", "text/plain", 
-        "ulw", "audio/basic", 
-        "ustar", "application/x-ustar", 
-        "vxml", "application/voicexml+xml", 
-        "xbm", "image/x-xbitmap", 
-        "xht", "application/xhtml+xml", 
-        "xhtml", "application/xhtml+xml", 
-        "xls", "application/vnd.ms-excel", 
-        "xml", "application/xml", 
-        "xpm", "image/x-xpixmap", 
-        "xsl", "application/xml", 
-        "xslt", "application/xslt+xml", 
-        "xul", "application/vnd.mozilla.xul+xml", 
-        "xwd", "image/x-xwindowdump", 
-        "vsd", "application/x-visio", 
-        "wav", "audio/x-wav", 
-        "wbmp", "image/vnd.wap.wbmp", 
-        "wml", "text/vnd.wap.wml", 
-        "wmlc", "application/vnd.wap.wmlc", 
-        "wmls", "text/vnd.wap.wmlscript", 
-        "wmlscriptc", "application/vnd.wap.wmlscriptc", 
-        "wmv", "video/x-ms-wmv", 
-        "wrl", "x-world/x-vrml", 
-        "wspolicy", "application/wspolicy+xml", 
-        "Z", "application/x-compress", 
-        "z", "application/x-compress", 
-        "zip", "application/zip" 
+        "smf", "audio/x-midi",
+        "sit", "application/x-stuffit",
+        "snd", "audio/basic",
+        "src", "application/x-wais-source",
+        "sv4cpio", "application/x-sv4cpio",
+        "sv4crc", "application/x-sv4crc",
+        "svg", "image/svg+xml",
+        "svgz", "image/svg+xml",
+        "swf", "application/x-shockwave-flash",
+        "t", "application/x-troff",
+        "tar", "application/x-tar",
+        "tcl", "application/x-tcl",
+        "tex", "application/x-tex",
+        "texi", "application/x-texinfo",
+        "texinfo", "application/x-texinfo",
+        "tif", "image/tiff",
+        "tiff", "image/tiff",
+        "tr", "application/x-troff",
+        "tsv", "text/tab-separated-values",
+        "txt", "text/plain",
+        "ulw", "audio/basic",
+        "ustar", "application/x-ustar",
+        "vxml", "application/voicexml+xml",
+        "xbm", "image/x-xbitmap",
+        "xht", "application/xhtml+xml",
+        "xhtml", "application/xhtml+xml",
+        "xls", "application/vnd.ms-excel",
+        "xml", "application/xml",
+        "xpm", "image/x-xpixmap",
+        "xsl", "application/xml",
+        "xslt", "application/xslt+xml",
+        "xul", "application/vnd.mozilla.xul+xml",
+        "xwd", "image/x-xwindowdump",
+        "vsd", "application/x-visio",
+        "wav", "audio/x-wav",
+        "wbmp", "image/vnd.wap.wbmp",
+        "wml", "text/vnd.wap.wml",
+        "wmlc", "application/vnd.wap.wmlc",
+        "wmls", "text/vnd.wap.wmlscript",
+        "wmlscriptc", "application/vnd.wap.wmlscriptc",
+        "wmv", "video/x-ms-wmv",
+        "wrl", "x-world/x-vrml",
+        "wspolicy", "application/wspolicy+xml",
+        "Z", "application/x-compress",
+        "z", "application/x-compress",
+        "zip", "application/zip"
     };
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatLiteCoyoteTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatLiteCoyoteTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatLiteCoyoteTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatLiteCoyoteTest.java Sat Oct 22 21:30:59 2011
@@ -17,26 +17,26 @@ import org.apache.tomcat.lite.io.BBuffer
  * Very simple test.
  */
 public class TomcatLiteCoyoteTest extends TestCase {
-    static int port = 8884; 
+    static int port = 8884;
     static {
         Logger.getLogger("org.apache.catalina.core.StandardService").setLevel(Level.WARNING);
         Logger.getLogger("org.apache.catalina.core.StandardEngine").setLevel(Level.WARNING);
-        Logger.getLogger("org.apache.catalina.startup.ContextConfig").setLevel(Level.WARNING);        
+        Logger.getLogger("org.apache.catalina.startup.ContextConfig").setLevel(Level.WARNING);
     }
     static Tomcat main = TomcatStandaloneMain.setUp(port);
-    
+
     public void testSimple() throws IOException {
         HttpConnector clientCon = HttpClient.newClient();
-        
+
         HttpChannel ch = clientCon.get("localhost", port);
         ch.getRequest().setRequestURI("/index.html");
         ch.getRequest().send();
-        
+
         BBuffer res = ch.readAll(null, 0);
-        
-        assertTrue(res.toString(), 
+
+        assertTrue(res.toString(),
                 res.toString().indexOf("<title>Apache Tomcat</title>") >= 0);
     }
-    
-    
+
+
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatStandaloneMain.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatStandaloneMain.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatStandaloneMain.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/coyote/lite/TomcatStandaloneMain.java Sat Oct 22 21:30:59 2011
@@ -11,18 +11,18 @@ import org.apache.tomcat.lite.TestMain;
 /**
  * Startup tomcat + coyote lite connector.
  * No config files used.
- * 
+ *
  * @author Costin Manolache
  */
 public class TomcatStandaloneMain {
-    
+
     public static Tomcat setUp(int port) {
         try {
             Tomcat tomcat = new Tomcat();
 
             tomcat.setPort(port);
             String base = TestMain.findDir("/output/build");
-            tomcat.setBaseDir(base);               
+            tomcat.setBaseDir(base);
             // Absolute path - tomcat6 and 7 are different,
             // 7 adds webapps.
             tomcat.addWebapp("/", base + "/webapps/ROOT");
@@ -40,7 +40,7 @@ public class TomcatStandaloneMain {
         }
         return null;
     }
-    
+
     public static LiteProtocolHandler setUp(Tomcat tomcat, int port) {
         Connector connector;
         try {
@@ -48,7 +48,7 @@ public class TomcatStandaloneMain {
             tomcat.getService().addConnector(connector);
             connector.setPort(port);
             tomcat.setConnector(connector);
-            LiteProtocolHandler ph = 
+            LiteProtocolHandler ph =
                 (LiteProtocolHandler) connector.getProtocolHandler();
             return ph;
         } catch (Exception e) {

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java Sat Oct 22 21:30:59 2011
@@ -30,9 +30,9 @@ import org.apache.tomcat.lite.service.IO
 
 /**
  * Laucher for tomcat-lite standalone, configured with test handlers.
- * 
+ *
  * Used in tests - one is running for the entire suite.
- * 
+ *
  * @author Costin Manolache
  */
 public class TestMain {
@@ -42,9 +42,9 @@ public class TestMain {
     }
 
     static TestMain defaultServer;
-    
+
     private boolean init = false;
-    
+
     HttpConnector testClient;
     HttpConnector testServer;
     HttpConnector testProxy;
@@ -58,7 +58,7 @@ public class TestMain {
     protected void init() {
         testClient = HttpClient.newClient();
     }
-    
+
     /**
      * A single instance used for all tests.
      */
@@ -69,7 +69,7 @@ public class TestMain {
         }
         return defaultServer;
     }
-    
+
     public static HttpConnector getTestServer() {
         return shared().testServer;
     }
@@ -80,7 +80,7 @@ public class TestMain {
 
     public static BaseMapper.Context initTestContext(Dispatcher d) throws IOException {
         BaseMapper.Context mCtx = d.addContext(null, "", null, null, null, null);
-        
+
         mCtx.addWrapper("/", new StaticContentService()
             .setContentType("text/html")
             .setData("<a href='/proc/cpool/client'>Client pool</a><br/>" +
@@ -88,7 +88,7 @@ public class TestMain {
                     "<a href='/proc/cpool/proxy'>Proxy pool</a><br/>" +
                     ""));
 
-        mCtx.addWrapper("/favicon.ico", 
+        mCtx.addWrapper("/favicon.ico",
                 new StaticContentService().setStatus(404).setData("Not found"));
 
         mCtx.addWrapper("/hello", new StaticContentService().setData("Hello world"));
@@ -118,7 +118,7 @@ public class TestMain {
         mCtx.addWrapper("/proc/cpool/proxy", new IOStatus(testProxy.cpool));
         mCtx.addWrapper("/proc/cpool/server", new IOStatus(testServer.cpool));
     }
-    
+
     public void run() {
         try {
             startAll();
@@ -134,8 +134,8 @@ public class TestMain {
         } catch (Throwable t) {
             t.printStackTrace();
         }
-    } 
-    
+    }
+
     public static String findDir(String dir) {
         String path = ".";
         for (int i = 0; i < 5; i++) {
@@ -151,7 +151,7 @@ public class TestMain {
         }
         return null;
     }
-    
+
     public int getServerPort() {
         return 8802;
     }
@@ -163,8 +163,8 @@ public class TestMain {
     public int getSslServerPort() {
         return 8443;
     }
-    
-    static String PRIVATE_KEY = 
+
+    static String PRIVATE_KEY =
     "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALsz2milZGHliWte61TfMTSwpAdq" +
 "9uJkMTqgpSVtwxxOe8kT84QtIzhdAsQYjRz9ZtQn9DYWhJQs/cs/R3wWsjWwgiFHLzGalvsmMYJ3" +
 "vBO8VMj762fAWu7GjUApIXcxMJoK4sQUpZKbqTuXpwzVUeeqBcspsIDgOLCo233G7/fBAgMBAAEC" +
@@ -196,7 +196,7 @@ public class TestMain {
 "c82iSbM0LseFeHwxAfeNXosSShMFtQzKt2wKZLLQB/Oqrea32m4hU//NP8rNbTux" +
 "dcAHeNQEDB5EUUSewAlh+fUE6HB6c8j0\n" +
 "-----END CERTIFICATE-----\n\n";
-    
+
     protected synchronized void startAll() throws IOException {
         if (init) {
             System.err.println("2x init ???");
@@ -204,13 +204,13 @@ public class TestMain {
             init = true;
             boolean debug = false;
             if (debug) {
-                System.setProperty("javax.net.debug", "ssl");            
-                System.setProperty("jsse", "conn_state,alert,engine,record,ssocket,socket,prf");            
+                System.setProperty("javax.net.debug", "ssl");
+                System.setProperty("jsse", "conn_state,alert,engine,record,ssocket,socket,prf");
                 Logger.getLogger("SSL").setLevel(Level.FINEST);
                 testClient.setDebug(true);
                 testClient.setDebugHttp(true);
             }
-            
+
             proxy = new HttpProxyService()
                 .withHttpClient(testClient);
             testProxy = HttpServer.newServer(getProxyPort());
@@ -219,7 +219,7 @@ public class TestMain {
                 testProxy.setDebugHttp(true);
                 testProxy.setDebug(true);
             }
-            
+
             // dispatcher rejects 'http://'
             testProxy.setHttpService(proxy);
             try {
@@ -227,7 +227,7 @@ public class TestMain {
             } catch (IOException e) {
                 e.printStackTrace();
             }
-            
+
             testServer = HttpServer.newServer(getServerPort());
             if (debug) {
                 testServer.setDebugHttp(true);
@@ -245,20 +245,20 @@ public class TestMain {
 //            byte[] keyBytes = b64.decode(PRIVATE_KEY);
 
             sslServer = HttpServer.newSslServer(getSslServerPort());
-            
+
             if (debug) {
                 sslServer.setDebug(true);
                 sslServer.setDebugHttp(true);
             }
             JsseSslProvider sslCon = (JsseSslProvider) sslServer.getSslProvider();
-            
+
             sslCon = sslCon
-                .setKeyRes("org/apache/tomcat/lite/http/genrsa_512.cert", 
+                .setKeyRes("org/apache/tomcat/lite/http/genrsa_512.cert",
                         "org/apache/tomcat/lite/http/genrsa_512.der");
-            initTestCallback(sslServer.getDispatcher());            
+            initTestCallback(sslServer.getDispatcher());
             sslServer.start();
-        }   
-        
+        }
+
         Runtime.getRuntime().addShutdownHook(new Thread() {
             public void run() {
                 System.err.println("Done");
@@ -268,7 +268,7 @@ public class TestMain {
             }
         });
     }
-    
+
     /**
      * Blocking get, returns when the body has been read.
      */
@@ -278,23 +278,23 @@ public class TestMain {
 
         HttpRequest aclient = HttpClient.newClient().request(url);
         aclient.send();
-        aclient.readAll(out, 
+        aclient.readAll(out,
                 //Long.MAX_VALUE);//
                 2000000);
         aclient.release(); // return connection to pool
         return out;
     }
-    
+
     public static BBuffer getUrl(String path) throws IOException {
         BBuffer out = BBuffer.allocate();
         getUrl(path, out);
         return out;
     }
 
-    public static HttpURLConnection getUrl(String path, 
+    public static HttpURLConnection getUrl(String path,
                              BBuffer out) throws IOException {
         URL url = new URL(path);
-        HttpURLConnection connection = 
+        HttpURLConnection connection =
             (HttpURLConnection) url.openConnection();
         connection.setReadTimeout(10000);
         connection.connect();
@@ -308,6 +308,6 @@ public class TestMain {
         }
         return connection;
     }
-    
-    
+
+
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/ClientTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/ClientTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/ClientTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/ClientTest.java Sat Oct 22 21:30:59 2011
@@ -11,50 +11,50 @@ import junit.framework.TestCase;
 
 /**
  * Examples and tests for Tomcat-lite in client mode.
- * 
+ *
  */
 public class ClientTest extends TestCase {
 
-    /** 
-     * All connectors created this way will share a single 
-     * IO thread. Each connector will have its keep-alive 
+    /**
+     * All connectors created this way will share a single
+     * IO thread. Each connector will have its keep-alive
      * pool - so it's better to share them.
-     * 
+     *
      * Since I want to test keep-alive works, I use a static one
      */
     static HttpConnector httpCon = HttpClient.newClient();
 
-    /** 
+    /**
      * Start a http server, runs on 8802 - shared by all tests.
-     * Will use /echo handler. 
+     * Will use /echo handler.
      */
     static HttpConnector testServer = TestMain.getTestServer();
 
-    
+
     public void testSimpleBlocking() throws IOException {
         HttpRequest req = httpCon.request("http://localhost:8802/echo/test1");
         HttpResponse res = req.waitResponse();
-        
+
         assertEquals(200, res.getStatus());
         //assertEquals("", res.getHeader(""));
-        
+
         BufferedReader reader = res.getReader();
         String line1 = reader.readLine();
         assertEquals("REQ HEAD:", line1);
     }
-    
+
     public void testSimpleCallback() throws IOException {
-        
+
     }
-    
+
     public void testGetParams() throws IOException {
-    }    
+    }
 
     public void testPostParams() throws IOException {
-    }    
+    }
 
     public void testPostBody() throws IOException {
-    }    
-    
+    }
+
 
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/CompressFilterTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/CompressFilterTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/CompressFilterTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/CompressFilterTest.java Sat Oct 22 21:30:59 2011
@@ -11,18 +11,18 @@ import org.apache.tomcat.lite.io.IOBuffe
 public class CompressFilterTest extends TestCase {
 
     CompressFilter cf = new CompressFilter();
-    
+
     private void check(String clear, String xtra) throws Exception {
         IOBuffer in = new IOBuffer();
         IOBuffer out = new IOBuffer();
-        
+
         in.append(clear);
         in.close();
-        
+
         cf.compress(in, out);
-        
+
 //        BBuffer bb = out.copyAll(null);
-//        String hd = Hex.getHexDump(bb.array(), bb.position(), 
+//        String hd = Hex.getHexDump(bb.array(), bb.position(),
 //                bb.remaining(), true);
 //        System.err.println(hd);
 
@@ -32,27 +32,27 @@ public class CompressFilterTest extends 
         in.recycle();
         out.close();
         cf.decompress(out, in);
-        
+
         assertEquals(in.copyAll(null).toString(), clear);
         assertTrue(in.isAppendClosed());
-        
+
         if (xtra != null) {
-            assertEquals(out.copyAll(null).toString(), xtra);            
+            assertEquals(out.copyAll(null).toString(), xtra);
         }
     }
 
     public void test1() throws Exception {
         check("X1Y2Z3", null);
     }
-        
+
     public void testXtra() throws Exception {
         check("X1Y2Z3", "GET /");
     }
-        
+
     public void testLarge() throws Exception {
         StringBuffer sb = new StringBuffer();
         for (int i = 0; i < 2 * 1024; i++) {
-            sb.append("0123456789012345"); 
+            sb.append("0123456789012345");
         }
         check(sb.toString(), null);
     }
@@ -63,17 +63,17 @@ public class CompressFilterTest extends 
             cf.recycle();
         }
     }
-    
+
     public void testLargeIn() throws Exception {
         StringBuffer sb = new StringBuffer();
         Random r = new Random();
         for (int i = 0; i < 16 * 2 * 1024; i++) {
-            sb.append(' ' + r.nextInt(32)); 
+            sb.append(' ' + r.nextInt(32));
         }
         check(sb.toString(), null);
     }
-        
-    
+
+
     public void testSpdy() throws Exception {
         cf.setDictionary(SpdyConnection.SPDY_DICT, SpdyConnection.DICT_ID);
         check("connection: close\n", null);

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/DispatcherTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/DispatcherTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/DispatcherTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/DispatcherTest.java Sat Oct 22 21:30:59 2011
@@ -31,15 +31,15 @@ public class DispatcherTest extends Test
         mapper.addContext("asdf.com", "", "context0", new String[0], null, null);
 
         MappingData mappingData = new MappingData();
-        
+
         CBuffer host = CBuffer.newInstance();
         host.set("test1.com");
-        
+
         CBuffer uri = CBuffer.newInstance();
         uri.set("/foo/bar/blah/bobou/foo");
 
         mapper.map(host, uri, mappingData);
-        
+
         assertEquals("context2", mappingData.context.toString());
         assertEquals("/foo/bar", mappingData.contextPath.toString());
     }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelInMemoryTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelInMemoryTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelInMemoryTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelInMemoryTest.java Sat Oct 22 21:30:59 2011
@@ -20,15 +20,15 @@ import org.apache.tomcat.lite.io.MemoryI
 // TODO: rename to Http11ConnectionTest
 public class HttpChannelInMemoryTest extends TestCase {
     /**
-     *  Connection under test 
+     *  Connection under test
      */
     Http11Connection conn;
 
-    /** 
+    /**
      * Last http channel created by the connection
      */
     volatile HttpChannel http;
-    
+
     // Input/output for the connection
     MemoryIOConnector.MemoryIOChannel net = new MemoryIOChannel();
 
@@ -40,12 +40,12 @@ public class HttpChannelInMemoryTest ext
     boolean bodySentDone = false;
     boolean headersDone = false;
     boolean allDone = false;
-    
+
     public void setUp() throws IOException {
         // Requests will not be serviced - you must manually generate
         // the response.
         serverConnector.setHttpService(null);
-    
+
         conn = new Http11Connection(serverConnector) {
             protected HttpChannel checkHttpChannel() throws IOException {
                 return http = super.checkHttpChannel();
@@ -53,17 +53,17 @@ public class HttpChannelInMemoryTest ext
         }.serverMode();
         conn.setSink(net);
     }
-    
-   
+
+
     public void test2Req() throws IOException {
         String req = "GET /index.html?q=b&c=d HTTP/1.1\r\n" +
-        "Host:  Foo.com \n" + 
-        "H2:Bar\r\n" + 
+        "Host:  Foo.com \n" +
+        "H2:Bar\r\n" +
         "H3: Foo \r\n" +
         " Bar\r\n" +
         "H4: Foo\n" +
         "    Bar\n" +
-        "\r\n" + 
+        "\r\n" +
         "HEAD /r2? HTTP/1.1\n" +
         "Host: Foo.com\r\n" +
         "H3: Foo \r\n" +
@@ -71,8 +71,8 @@ public class HttpChannelInMemoryTest ext
         "H4: Foo\n" +
         " Bar\n" +
         "\r\n";
-        net.getIn().append(req);        
-        
+        net.getIn().append(req);
+
         //http = lastServer.get(0);
         assertTrue(http.getRequest().method().equals("GET"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.1"));
@@ -81,17 +81,17 @@ public class HttpChannelInMemoryTest ext
                 "Foo.com");
         assertEquals(http.getRequest().getMimeHeaders().getHeader("H2").toString(),
                 "Bar");
-        
+
         http.getOut().append("Response1");
         http.getOut().close();
         http.startSending();
-        http.release(); 
-        
-        // now second response must be in. 
+        http.release();
+
+        // now second response must be in.
         // the connector will create a new http channel
-        
+
         //http = lastServer.get(1);
-        
+
         assertTrue(http.getRequest().method().equals("HEAD"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.1"));
         assertTrue(http.getRequest().getMimeHeaders().size() == 3);
@@ -101,36 +101,36 @@ public class HttpChannelInMemoryTest ext
 
     public void testHttp11Close() throws IOException {
         String req = "GET /index.html?q=b&c=d HTTP/1.1\r\n" +
-        "Host:  Foo.com\n" + 
+        "Host:  Foo.com\n" +
         "Connection: close\n" +
-        "\n"; 
-        net.getIn().append(req);        
-        
+        "\n";
+        net.getIn().append(req);
+
         assertTrue(http.getRequest().method().equals("GET"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.1"));
-        
+
         http.getOut().append("Response1");
         http.getOut().close();
         http.startSending();
-        http.release(); 
-        
+        http.release();
+
         assertTrue(net.out.indexOf("connection:close") > 0);
         assertFalse(net.isOpen());
     }
 
     public void testHttp10Close() throws IOException {
         String req = "GET /index.html?q=b&c=d HTTP/1.0\r\n" +
-        "Host:  Foo.com \n" + 
-        "\r\n"; 
-        net.getIn().append(req);        
-        
+        "Host:  Foo.com \n" +
+        "\r\n";
+        net.getIn().append(req);
+
         assertTrue(http.getRequest().method().equals("GET"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.0"));
-        
+
         http.getOut().append("Response1");
         http.getOut().close();
         http.startSending();
-        
+
         assertTrue(net.out.indexOf("connection:close") > 0);
         assertFalse(net.isOpen());
     }
@@ -138,47 +138,47 @@ public class HttpChannelInMemoryTest ext
     public void testHttp10KA() throws IOException {
         String req = "GET /index.html?q=b&c=d HTTP/1.0\r\n" +
         "Connection: Keep-Alive\n" +
-        "Host:  Foo.com \n" + 
-        "\r\n"; 
-        net.getIn().append(req);        
-        
+        "Host:  Foo.com \n" +
+        "\r\n";
+        net.getIn().append(req);
+
         assertTrue(http.getRequest().method().equals("GET"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.0"));
-        
+
         http.getOut().append("Hi");
         http.getOut().close();
         http.startSending();
-        
+
         // after request
         assertEquals(conn.activeHttp, null);
-        
+
         assertTrue(net.out.indexOf("connection:keep-alive") > 0);
         assertTrue(net.isOpen());
         // inserted since we can calculate the response
         assertEquals(http.getResponse().getHeader("Content-Length"),
                    "2");
     }
-    
+
     public void testHttp10KANoCL() throws IOException {
         String req = "GET /index.html?q=b&c=d HTTP/1.0\r\n" +
         "Connection: Keep-Alive\n" +
-        "Host:  Foo.com \n" + 
-        "\r\n"; 
-        net.getIn().append(req);        
-        
+        "Host:  Foo.com \n" +
+        "\r\n";
+        net.getIn().append(req);
+
         assertTrue(http.getRequest().method().equals("GET"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.0"));
-        
+
         http.getOut().append("Hi");
         http.startSending();
 
         http.getOut().append("After");
         http.getOut().close();
         http.startSending();
-        
+
         // after request
         assertEquals(conn.activeHttp, null);
-        
+
         assertFalse(net.out.indexOf("connection:keep-alive") > 0);
         assertFalse(net.isOpen());
         // inserted since we can calculate the response
@@ -187,21 +187,21 @@ public class HttpChannelInMemoryTest ext
         assertEquals(http.getResponse().getHeader("Transfer-Encoding"),
                 null);
     }
-    
+
     public void testMultiLineHead() throws IOException {
         net.getIn().append("GET / HTTP/1.0\n" +
                 "Cookie: 1234\n" +
                 "  456 \n" +
                 "Connection:   Close\n\n");
         net.getIn().close();
-        
+
         MultiMap headers = http.getRequest().getMimeHeaders();
         CBuffer cookie = headers.getHeader("Cookie");
         CBuffer conn = headers.getHeader("Connection");
         assertEquals(conn.toString(), "close");
         assertEquals(cookie.toString(), "1234 456");
-        
-        assertEquals(http.conn.headRecvBuf.toString(), 
+
+        assertEquals(http.conn.headRecvBuf.toString(),
                 "GET / HTTP/1.0\n" +
                 "Cookie: 1234 456   \n" + // \n -> trailing space
                 "Connection:   Close\n\n");
@@ -216,39 +216,39 @@ public class HttpChannelInMemoryTest ext
         net.getIn().close();
         assertFalse(((Http11Connection)http.conn).keepAlive());
     }
-    
+
     public void test2ReqByte2Byte() throws IOException {
         String req = "GET /index.html?q=b&c=d HTTP/1.1\r\n" +
-        "Host:  Foo.com \n" + 
-        "H2:Bar\r\n" + 
+        "Host:  Foo.com \n" +
+        "H2:Bar\r\n" +
         "H3: Foo \r\n" +
         " Bar\r\n" +
         "H4: Foo\n" +
         "    Bar\n" +
-        "\r\n" + 
+        "\r\n" +
         "HEAD /r2? HTTP/1.1\n" +
         "Host: Foo1.com\n" +
         "H3: Foo \r\n" +
         "       Bar\r\n" +
         "\r\n";
         for (int i = 0; i < req.length(); i++) {
-            net.getIn().append(req.charAt(i));        
+            net.getIn().append(req.charAt(i));
         }
-        
+
         assertTrue(http.getRequest().method().equals("GET"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.1"));
         assertTrue(http.getRequest().getMimeHeaders().size() == 4);
         assertTrue(http.getRequest().getMimeHeaders().getHeader("Host")
                 .equals("Foo.com"));
-        
+
         // send a response
         http.sendBody.append("Response1");
         http.getOut().close();
-        
+
         http.startSending(); // This will trigger a pipelined request
-        
+
         http.release(); // now second response must be in
-        
+
         assertTrue(http.getRequest().method().equals("HEAD"));
         assertTrue(http.getRequest().protocol().equals("HTTP/1.1"));
         assertTrue(http.getRequest().getMimeHeaders().size() == 2);
@@ -259,12 +259,12 @@ public class HttpChannelInMemoryTest ext
         http.sendBody.append("Response2");
         http.getOut().close();
         http.release(); // now second response must be in
-        
-        
+
+
     }
-    
+
     public void testEndWithoutFlushCallbacks() throws IOException {
-        
+
         net.getIn().append(POST);
 
         net.getIn().close();
@@ -274,13 +274,13 @@ public class HttpChannelInMemoryTest ext
                 allDone = true;
             }
         });
-        
+
         http.sendBody.queue("Hi");
         http.getOut().close();
         http.startSending(); // will call handleEndSend
 
         assertTrue(allDone);
-        
+
     }
 
     public void testCallbacks() throws IOException {
@@ -288,10 +288,10 @@ public class HttpChannelInMemoryTest ext
         serverConnector.setHttpService(new HttpService() {
             public void service(HttpRequest httpReq, HttpResponse httpRes)
                     throws IOException {
-                
+
                 headersDone = true;
                 HttpChannel http = httpReq.getHttpChannel();
-                
+
                 http.setCompletedCallback(new RequestCompleted() {
                     public void handle(HttpChannel data, Object extra)
                     throws IOException {
@@ -324,24 +324,24 @@ public class HttpChannelInMemoryTest ext
                 "1");
         assertTrue(headersDone);
         net.getIn().append("234");
-        
+
         net.getIn().close();
         assertTrue(bodyDone);
-        
-        
+
+
         http.sendBody.queue("Hi");
         http.getOut().close();
         http.startSending();
         assertTrue(bodySentDone);
 
         assertTrue(allDone);
-        
+
     }
-    
+
     public static String POST = "POST / HTTP/1.0\n" +
         "Connection: Close\n" +
         "Content-Length: 4\n\n" +
-        "1234"; 
+        "1234";
 
     public void testClose() throws IOException {
         net.getIn().append(POST);
@@ -351,19 +351,19 @@ public class HttpChannelInMemoryTest ext
         IOBuffer appData = receiveBody;
         BBuffer res = BBuffer.allocate(1000);
         appData.readAll(res);
-        
+
         assertEquals(res.toString(), "1234");
         assertFalse(((Http11Connection)http.conn).keepAlive());
-        
+
         http.sendBody.queue(res);
         http.getOut().close();
         http.startSending();
-        
+
         assertTrue(net.getOut().isAppendClosed());
         assertTrue(net.out.toString().indexOf("\n1234") > 0);
-        
+
     }
-    
+
     public void testReadLine() throws Exception {
         net.getIn().append("POST / HTTP/1.0\n" +
         		"Content-Length: 28\n\n" +
@@ -372,13 +372,13 @@ public class HttpChannelInMemoryTest ext
                 "Line 3\r" +
                 "Line 4");
         net.getIn().close();
-        
+
         BufferedReader r = http.getRequest().getReader();
         assertEquals("Line 1", r.readLine());
         assertEquals("Line 2", r.readLine());
         assertEquals("Line 3", r.readLine());
         assertEquals("Line 4", r.readLine());
         assertEquals(null, r.readLine());
-        
+
     }
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpChannelTest.java Sat Oct 22 21:30:59 2011
@@ -13,33 +13,33 @@ public class HttpChannelTest extends Tes
     HttpChannel ch = new HttpChannel().serverMode(true);
     Http11Connection con = new Http11Connection(null).serverMode();
     HttpRequest req = ch.getRequest();
-    
-    
+
+
     BBuffer head = BBuffer.allocate();
     BBuffer line = BBuffer.wrapper();
     BBuffer name = BBuffer.wrapper();
     BBuffer value = BBuffer.wrapper();
-    
+
     BBuffer statusB = BBuffer.wrapper();
     BBuffer msgB = BBuffer.wrapper();
     BBuffer methodB = BBuffer.wrapper();
     BBuffer queryB = BBuffer.wrapper("");
     BBuffer requestB = BBuffer.wrapper();
     BBuffer protoB = BBuffer.wrapper();
-    
+
     BBuffer l7 = BBuffer.wrapper("GET \n");
     BBuffer l8 = BBuffer.wrapper("GET /\n");
     BBuffer l9 = BBuffer.wrapper("GET /a?b\n");
     BBuffer l10 = BBuffer.wrapper("GET /a?b HTTP/1.0\n");
     BBuffer l11 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b");
     BBuffer l12 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\n");
-    
+
     BBuffer f1 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\n\n");
     BBuffer f2 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\r\n\r\n");
     BBuffer f3 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\r\r");
     BBuffer f4 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\r\n\r");
 
-    public void reqTest(String lineS, String method, String req, 
+    public void reqTest(String lineS, String method, String req,
             String qry, String proto) throws IOException {
         BBuffer line = BBuffer.wrapper(lineS);
         queryB.recycle();
@@ -65,7 +65,7 @@ public class HttpChannelTest extends Tes
         MultiMap params = req.getParameters();
         return params;
     }
-    
+
     public void testParseReq() throws IOException {
         reqTest("GET / HTTP/1.0", "GET", "/", "", "HTTP/1.0");
         reqTest("GET", "GET", "", "", "");
@@ -76,20 +76,20 @@ public class HttpChannelTest extends Tes
         reqTest("GET a HTTP/1.0", "GET", "a", "", "HTTP/1.0");
         reqTest("GET a? HTTP/1.0", "GET", "a", "", "HTTP/1.0");
     }
-    
-    public void headTest(String headS, String expName, String expValue, 
+
+    public void headTest(String headS, String expName, String expValue,
             String expLine, String expRest) throws IOException {
         head = BBuffer.wrapper(headS);
         head.readLine(line);
         con.parseHeader(ch, head, line, name, value);
-        
+
         assertEquals(expName, name.toString());
         assertEquals(expValue, value.toString());
 
         assertEquals(expLine, line.toString());
         assertEquals(expRest, head.toString());
     }
-    
+
     public void testParseHeader() throws IOException {
         headTest("a:b\n", "a", "b", "", "");
         headTest("a :b\n", "a", "b", "", "");
@@ -101,22 +101,22 @@ public class HttpChannelTest extends Tes
         headTest("a :  b  \n c\n", "a", "b c", "", "");
         headTest("a :  b  \n  c\n", "a", "b c", "", "");
         headTest("a :  b  \n  c\nd:", "a", "b c", "", "d:");
-       
+
     }
-    
-    public void responseTest(String lineS, String proto, String status, 
+
+    public void responseTest(String lineS, String proto, String status,
             String msg) throws IOException {
         protoB.recycle();
         statusB.recycle();
         msgB.recycle();
         BBuffer line = BBuffer.wrapper(lineS);
-        con.parseResponseLine(line, 
+        con.parseResponseLine(line,
                 protoB, statusB, msgB);
         assertEquals(proto, protoB.toString());
         assertEquals(status, statusB.toString());
         assertEquals(msg, msgB.toString());
     }
-    
+
     public void testResponse() throws Exception {
         responseTest("HTTP/1.1 200 OK", "HTTP/1.1", "200", "OK");
         responseTest("HTTP/1.1  200 OK", "HTTP/1.1", "200", "OK");

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpsTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpsTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpsTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/HttpsTest.java Sat Oct 22 21:30:59 2011
@@ -23,39 +23,39 @@ import org.apache.tomcat.lite.TestMain;
 import org.apache.tomcat.lite.io.BBuffer;
 
 public class HttpsTest extends TestCase {
-    
+
     static int port = 8443;
-    
+
     public void testSimpleClient() throws Exception {
         final HttpConnector httpClient = TestMain.shared().getClient();
         checkResponse(httpClient);
     }
-    
+
     public void testSimpleServer() throws Exception {
         final HttpConnector httpClient = TestMain.shared().getClient();
         BBuffer res = TestMain.getUrl("https://localhost:8443/hello");
         assertTrue(res.toString().indexOf("Hello") >= 0);
-    }       
+    }
+
 
-    
     private void checkResponse(HttpConnector httpCon) throws Exception {
         HttpRequest ch = httpCon.request("localhost", port).setSecure(true);
-        
+
         ch.setRequestURI("/hello");
         ch.setProtocol("HTTP/1.0"); // to force close
         ch.send();
         BBuffer res = ch.readAll();
-        
+
         assertTrue(res.toString().indexOf("Hello") >= 0);
-    }    
-    
+    }
+
     public void testSimpleClient20() throws Exception {
         final HttpConnector httpClient = TestMain.shared().getClient();
         for (int i = 0; i < 10; i++) {
             checkResponse(httpClient);
         }
     }
-    
+
     public void testSimpleRequestGoogle() throws Exception {
         for (int i = 0; i < 40; i++) {
         final HttpConnector httpClient = TestMain.shared().getClient();
@@ -64,11 +64,11 @@ public class HttpsTest extends TestCase 
         client.getHttpChannel().setIOTimeout(2000000);
         client.setRequestURI("/accounts/ServiceLogin");
         client.send();
-        
+
         BBuffer res = client.readAll();
         assertTrue(res.toString().indexOf("<title>Google Accounts</title>") > 0);
         }
     }
-        
+
 
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java Sat Oct 22 21:30:59 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,7 +24,7 @@ import org.apache.tomcat.lite.TestMain;
 import org.apache.tomcat.lite.io.BBuffer;
 
 public class LiveHttp1Test extends TestCase {
-    // Proxy tests extend this class, run same tests via proxy on 8903 
+    // Proxy tests extend this class, run same tests via proxy on 8903
     protected int clientPort = 8802;
 
     HttpRequest httpReq;
@@ -38,7 +38,7 @@ public class LiveHttp1Test extends TestC
         // DefaultHttpConnector.get().setDebugHttp(true);
         TestMain.getTestServer();
 
-        httpReq = HttpClient.newClient().request("localhost", 
+        httpReq = HttpClient.newClient().request("localhost",
                 clientPort);
 
         bodyRecvBuffer.recycle();
@@ -145,7 +145,7 @@ public class LiveHttp1Test extends TestC
         httpReq.requestURI().set("/hello");
 
         httpReq.send();
-        
+
         httpReq.readAll(bodyRecvBuffer, to);
         assertEquals(0, bodyRecvBuffer.remaining());
     }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/MultiMapTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/MultiMapTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/MultiMapTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/MultiMapTest.java Sat Oct 22 21:30:59 2011
@@ -10,7 +10,7 @@ public class MultiMapTest extends TestCa
 
     MultiMap map = new MultiMap();
     MultiMap lmap = new MultiMap().insensitive();
-    
+
     public void testAdd() {
         map.add("foo", "bar");
         assertEquals("bar", map.get("foo").toString());
@@ -43,7 +43,7 @@ public class MultiMapTest extends TestCa
         lmap.add("B", "bar4");
         assertEquals(4, lmap.count);
         assertEquals(3, lmap.map.size());
-        
+
         assertEquals("bar3", lmap.getString("a"));
         assertEquals("bar3", lmap.getString("A"));
         assertEquals("bar1", lmap.getString("Foo"));

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/SpdyTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/SpdyTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/SpdyTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/SpdyTest.java Sat Oct 22 21:30:59 2011
@@ -15,68 +15,68 @@ import org.apache.tomcat.lite.io.SocketC
 
 public class SpdyTest extends TestCase {
     HttpConnector http11Con = TestMain.shared().getClient();
-    
+
     static HttpConnector spdyCon = HttpClient.newClient();
 
-    static HttpConnector spdyConSsl = HttpClient.newClient(); 
-    
+    static HttpConnector spdyConSsl = HttpClient.newClient();
+
     HttpConnector memSpdyCon = new HttpConnector(null);
-    
+
     public void testClient() throws IOException {
-        HttpRequest req = 
+        HttpRequest req =
             spdyCon.request("http://localhost:8802/echo/test1");
-        
+
         // Force SPDY - no negotiation
         req.setProtocol("SPDY/1.0");
-        
+
         HttpResponse res = req.waitResponse();
-        
+
         assertEquals(200, res.getStatus());
         //assertEquals("", res.getHeader(""));
-        
+
         BufferedReader reader = res.getReader();
         String line1 = reader.readLine();
-        //assertEquals("", line1);        
+        //assertEquals("", line1);
     }
-    
+
     public void testSslClient() throws IOException {
-        
-        HttpRequest req = 
+
+        HttpRequest req =
             spdyConSsl.request("http://localhost:8443/echo/test1");
         // Enable SSL for the connection.
-        // TODO: this must be done on the first request, all will be 
+        // TODO: this must be done on the first request, all will be
         // encrypted.
         req.setSecure(true);
         // Force SPDY - no negotiation
         req.setProtocol("SPDY/1.0");
-        
+
         HttpResponse res = req.waitResponse();
-        
+
         assertEquals(200, res.getStatus());
         //assertEquals("", res.getHeader(""));
-        
+
         res.setReadTimeout(2000);
         BufferedReader reader = res.getReader();
         String line1 = reader.readLine();
-        //assertEquals("", line1);        
+        //assertEquals("", line1);
     }
 
-    
+
     // Initial frame generated by Chrome
     public void testParse() throws IOException {
-            InputStream is = 
+            InputStream is =
             getClass().getClassLoader().getResourceAsStream("org/apache/tomcat/lite/http/spdyreq0.bin");
-        
+
         IOBuffer iob = new IOBuffer();
         iob.append(is);
-        
+
         SpdyConnection con = new SpdyConnection(memSpdyCon, new RemoteServer());
-        
-        // By default it has a dispatcher buit-in 
+
+        // By default it has a dispatcher buit-in
         con.serverMode = true;
-        
+
         con.dataReceived(iob);
-        
+
         HttpChannel spdyChannel = con.channels.get(1);
 
         assertEquals(1, con.lastFrame.version);
@@ -88,24 +88,24 @@ public class SpdyTest extends TestCase {
         // TODO: test req, headers
         HttpRequest req = spdyChannel.getRequest();
         assertTrue(req.getHeader("accept").indexOf("application/xml") >= 0);
-        
+
     }
-    
+
     // Initial frame generated by Chrome
     public void testParseCompressed() throws IOException {
-        InputStream is = 
+        InputStream is =
             getClass().getClassLoader().getResourceAsStream("org/apache/tomcat/lite/http/spdyreqCompressed.bin");
-        
+
         IOBuffer iob = new IOBuffer();
         iob.append(is);
-        
+
         SpdyConnection con = new SpdyConnection(memSpdyCon, new RemoteServer());
-        
-        // By default it has a dispatcher buit-in 
+
+        // By default it has a dispatcher buit-in
         con.serverMode = true;
-        
+
         con.dataReceived(iob);
-        
+
         HttpChannel spdyChannel = con.channels.get(1);
 
         assertEquals(1, con.lastFrame.version);
@@ -115,12 +115,12 @@ public class SpdyTest extends TestCase {
         // TODO: test req, headers
         HttpRequest req = spdyChannel.getRequest();
         assertTrue(req.getHeader("accept").indexOf("application/xml") >= 0);
-        
+
     }
-    
+
     // Does int parsing works ?
     public void testLargeInt() throws Exception {
-        
+
         IOBuffer iob = new IOBuffer();
         iob.append(0x80);
         iob.append(0x01);
@@ -138,12 +138,12 @@ public class SpdyTest extends TestCase {
         assertEquals(0xFFFF, con.currentInFrame.type);
         assertEquals(0xFF, con.currentInFrame.flags);
         assertEquals(0xFFFFFF, con.currentInFrame.length);
-        
+
     }
 
     // Does int parsing works ?
     public void testBad() throws Exception {
-        
+
             IOBuffer iob = new IOBuffer();
             iob.append(0xFF);
             iob.append(0xFF);
@@ -157,9 +157,9 @@ public class SpdyTest extends TestCase {
 
             SpdyConnection con = new SpdyConnection(memSpdyCon, new RemoteServer());
             con.dataReceived(iob);
-            
+
             assertEquals(1, con.streamErrors.get());
-        
+
     }
 
 }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/EchoCallback.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/EchoCallback.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/EchoCallback.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/EchoCallback.java Sat Oct 22 21:30:59 2011
@@ -30,7 +30,7 @@ import org.apache.tomcat.lite.io.IOBuffe
  */
 public class EchoCallback implements HttpService {
     Logger log = Logger.getLogger("coyote.static");
-    
+
     String contentType = "text/plain";
 
 
@@ -42,20 +42,20 @@ public class EchoCallback implements Htt
         HttpChannel sproc = req.getHttpChannel();
         res.setStatus(200);
         res.setContentType(contentType);
-        
+
         IOBuffer tmp = new IOBuffer(null);
         Http11Connection.serialize(req, tmp);
-        
+
         sproc.getOut().append("REQ HEAD:\n");
         sproc.getOut().append(tmp.readAll(null));
         IOBuffer reqBuf = sproc.getOut();
-        
+
         reqBuf.append("\nCONTENT_LENGTH:")
             .append(Long.toString(req.getContentLength()))
             .append("\n");
-//      
+//
 //        sproc.release();
     }
 
-    
+
 }
\ No newline at end of file

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/SleepCallback.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/SleepCallback.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/SleepCallback.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/services/SleepCallback.java Sat Oct 22 21:30:59 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ public class SleepCallback extends Stati
   long t2;
   long t3;
   long t4;
-  
+
   public SleepCallback() {
   }
 
@@ -44,7 +44,7 @@ public class SleepCallback extends Stati
     this.t4 = t4;
     return this;
   }
-    
+
   public SleepCallback sleep(long t1) {
     return sleep(t1, t1, t1, t1);
   }

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/BBufferTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/BBufferTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/BBufferTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/BBufferTest.java Sat Oct 22 21:30:59 2011
@@ -25,7 +25,7 @@ public class BBufferTest extends TestCas
     BBuffer l10 = BBuffer.wrapper("GET /a?b HTTP/1.0\n");
     BBuffer l11 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b");
     BBuffer l12 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\n");
-    
+
     BBuffer f1 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\n\n");
     BBuffer f2 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\r\n\r\n");
     BBuffer f3 = BBuffer.wrapper("GET /a?b HTTP/1.0\na:b\r\r");
@@ -43,7 +43,7 @@ public class BBufferTest extends TestCas
     public void hashTest(String s) {
         assertEquals(s.hashCode(), BBuffer.wrapper(s).hashCode());
     }
-    
+
     public void testHash() {
         hashTest("");
         hashTest("a");
@@ -51,31 +51,31 @@ public class BBufferTest extends TestCas
         hashTest("123abc\0");
         // Fails for UTF chars - only ascii hashTest("123abc\u12345;");
     }
-    
+
     public void testReadToSpace() {
         assertEquals(3, l8.readToSpace(res));
         assertEquals("GET", res.toString());
-        assertEquals(" /\n", l8.toString());        
+        assertEquals(" /\n", l8.toString());
 
         assertEquals(0, l1.readToSpace(res));
         assertEquals("", res.toString());
-        assertEquals("", l1.toString());        
+        assertEquals("", l1.toString());
     }
-    
+
     public void testReadToDelim() {
         assertEquals(1, h1.readToDelimOrSpace((byte)'?', res));
         assertEquals("a", res.toString());
-        assertEquals("", h1.toString());        
-        
+        assertEquals("", h1.toString());
+
         assertEquals(1, h2.readToDelimOrSpace((byte)'?', res));
         assertEquals("a", res.toString());
-        assertEquals("?b", h2.toString());        
-        
+        assertEquals("?b", h2.toString());
+
         assertEquals(1, h3.readToDelimOrSpace((byte)'?', res));
         assertEquals("a", res.toString());
-        assertEquals(" b", h3.toString());        
+        assertEquals(" b", h3.toString());
     }
-    
+
     public void testGet() {
         assertEquals(0x20, s1.get(0));
         assertEquals(0x0a, s1.get(1));
@@ -86,24 +86,24 @@ public class BBufferTest extends TestCas
         }
         fail("Exception");
     }
-    
+
     public void testSkipSpace() {
         assertEquals(1, s1.skipSpace());
-        assertEquals("\n", s1.toString());        
+        assertEquals("\n", s1.toString());
 
         assertEquals(1, s2.skipSpace());
-        assertEquals("a", s2.toString());        
-        
+        assertEquals("a", s2.toString());
+
         assertEquals(2, s3.skipSpace());
-        assertEquals("", s3.toString());        
+        assertEquals("", s3.toString());
 
         assertEquals(3, s4.skipSpace());
-        assertEquals("a", s4.toString());        
-        
+        assertEquals("a", s4.toString());
+
         assertEquals(0, l1.skipSpace());
-        assertEquals("", l1.toString());        
+        assertEquals("", l1.toString());
     }
-    
+
     public void testLFLF() {
         assertTrue(f1.hasLFLF());
         assertTrue(f2.hasLFLF());
@@ -118,21 +118,21 @@ public class BBufferTest extends TestCas
         assertFalse(l11.hasLFLF());
         assertFalse(l12.hasLFLF());
     }
-        
+
     public void testReadLine() {
         assertEquals(-1, l1.readLine(res));
         assertEquals("", res.toString());
-        assertEquals("", l1.toString());        
-        
+        assertEquals("", l1.toString());
+
         assertEquals(-1, l1a.readLine(res));
         assertEquals("", res.toString());
-        assertEquals("a", l1a.toString());        
-        
+        assertEquals("a", l1a.toString());
+
         assertEquals(0, l2.readLine(res));
-        assertEquals("", l2.toString());        
+        assertEquals("", l2.toString());
         assertEquals("", res.toString());
         assertEquals(0, l3.readLine(res));
-        assertEquals("", l3.toString());        
+        assertEquals("", l3.toString());
         assertEquals("", res.toString());
         assertEquals(0, l4.readLine(res));
         assertEquals("", res.toString());
@@ -146,7 +146,7 @@ public class BBufferTest extends TestCas
         assertEquals(0, l5_a.readLine(res));
         assertEquals("", res.toString());
         assertEquals("a", l5_a.toString());
-        
+
         assertEquals(1, l6.readLine(res));
         assertEquals("a", res.toString());
 

Modified: tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/CBufferTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/CBufferTest.java?rev=1187812&r1=1187811&r2=1187812&view=diff
==============================================================================
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/CBufferTest.java (original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/io/CBufferTest.java Sat Oct 22 21:30:59 2011
@@ -7,12 +7,12 @@ import junit.framework.TestCase;
 public class CBufferTest extends TestCase {
 
     CBuffer ext = CBuffer.newInstance();
-    
+
     public void extTest(String path, String exp) {
         CBuffer.newInstance().append(path).getExtension(ext, '/', '.');
         assertEquals(exp, ext.toString());
     }
-    
+
     public void testExt() {
         extTest("foo.jsp", "jsp");
         extTest("foo.j", "j");
@@ -25,8 +25,8 @@ public class CBufferTest extends TestCas
         extTest("/abc/", "");
         extTest("/abc/d", "");
     }
-    
+
     public void testLastIndexOf() {
-        
+
     }
 }



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


Mime
View raw message