tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r807112 - /tomcat/trunk/test/org/apache/catalina/startup/TestTomcatBase.java
Date Mon, 24 Aug 2009 08:20:12 GMT
Author: markt
Date: Mon Aug 24 08:20:12 2009
New Revision: 807112

URL: http://svn.apache.org/viewvc?rev=807112&view=rev
Log:
Add a simple Hello World Servlet that can be used for testing.

Modified:
    tomcat/trunk/test/org/apache/catalina/startup/TestTomcatBase.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TestTomcatBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestTomcatBase.java?rev=807112&r1=807111&r2=807112&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TestTomcatBase.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TestTomcatBase.java Mon Aug 24 08:20:12
2009
@@ -17,6 +17,13 @@
 package org.apache.catalina.startup;
 
 import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import junit.framework.TestCase;
 
@@ -62,4 +69,18 @@
         ExpandWar.delete(tempDir);
     }
     
+    /**
+     * Simple Hello World servlet for use by test cases
+     */
+    public static final class HelloWorldServlet extends HttpServlet {
+
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+                throws ServletException, IOException {
+            PrintWriter out = resp.getWriter();
+            out.print("<html><body><p>Hello World</p></body></html>");
+        }
+    }
 }



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


Mime
View raw message