geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pra...@apache.org
Subject svn commit: r494156 - in /geronimo/server/trunk/testsuite/web-testsuite: ./ test-2.5-servlets/ test-2.5-servlets/src/main/java/com/test/servlet/ test-2.5-servlets/src/main/webapp/WEB-INF/ test-2.5-servlets/src/test/java/org/apache/geronimo/testsuite/se...
Date Mon, 08 Jan 2007 19:06:35 GMT
Author: prasad
Date: Mon Jan  8 11:06:34 2007
New Revision: 494156

URL: http://svn.apache.org/viewvc?view=rev&rev=494156
Log:
=> adding tests for multiple (*) filtering. Thanx Krish and Anitha
=> tests fail. Geronimo-2664 opened.

Added:
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
  (with props)
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
  (with props)
Modified:
    geronimo/server/trunk/testsuite/web-testsuite/pom.xml
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/pom.xml
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet.java
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/geronimo-web.xml
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/web.xml
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/java/org/apache/geronimo/testsuite/servlets/TestServlets.java
    geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/resources/testng.xml

Modified: geronimo/server/trunk/testsuite/web-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/pom.xml?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/web-testsuite/pom.xml Mon Jan  8 11:06:34 2007
@@ -32,11 +32,11 @@
     </parent>
     
     <artifactId>web-testsuite</artifactId>
-    <name>Geronimo TestSuite, web-tier</name>
+    <name>Geronimo TestSuite :: Web-tier Testsuite</name>
     <packaging>pom</packaging>
     
     <description>
-        Geronimo web tier testsuite. 
+        Geronimo web tier testsuite.
         Use this testsuite to test the webcontainer.
          - Servlet 2.5
          - JSP 2.1
@@ -44,7 +44,7 @@
          - JSF
          - JSTL
     </description>
-    
+
     <build>
         <plugins>
             <plugin>
@@ -86,10 +86,15 @@
                         <artifactId>geronimo-maven-plugin</artifactId>
                     </plugin>
                     
+                    <!-- Skipping this for now until Geronimo-2664 gets fixed.
+                     It hangs the jetty testrun.
+                     
                     <plugin>
                         <groupId>org.apache.geronimo.genesis.plugins</groupId>
                         <artifactId>maven-maven-plugin</artifactId>
                     </plugin>
+                    -->
+
                 </plugins>
             </build>
         </profile>

Modified: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/pom.xml?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/pom.xml (original)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/pom.xml Mon Jan  8 11:06:34
2007
@@ -32,7 +32,7 @@
     </parent>
     
     <artifactId>test-2.5-servlets</artifactId>
-    <name>Geronimo TestSuite, Web :: Test Servlets</name>
+    <name>Geronimo TestSuite :: Web Testsuite :: Test Servlets</name>
     <packaging>war</packaging>
     
 
@@ -106,7 +106,7 @@
                                     <goal>undeploy-module</goal>
                                 </goals>
                                 <configuration>
-                                    <moduleId>Samples/SampleServlet/1.1/car</moduleId>
+                                    <moduleId>Samples/SampleServlet/2.0/car</moduleId>
                                 </configuration>
                             </execution>
                         </executions>

Added: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java?view=auto&rev=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
(added)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
Mon Jan  8 11:06:34 2007
@@ -0,0 +1,26 @@
+package com.test.servlet;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class SampleFilter implements Filter {
+
+	public void destroy() {
+	}
+
+	public void doFilter(ServletRequest arg0, ServletResponse arg1,
+			FilterChain arg2) throws IOException, ServletException {
+		System.out.print ("Inside Sample Filter ... \n");
+		arg2.doFilter(arg0, arg1);
+	}
+
+	public void init(FilterConfig arg0) throws ServletException {
+	}
+
+}

Propchange: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleFilter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet.java?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet.java
(original)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet.java
Mon Jan  8 11:06:34 2007
@@ -60,7 +60,8 @@
 		PrintWriter out = response.getWriter();
 		out.println("<html><head><title>Sample application with Servlets 2.5</title></head></html>");
 		out.println("<body>");
-		out.println("<font align=Center face=\"Garamond\"> Welcome to Servlets 2.5 samples..!!!</font>");
+		out.println("<font align=Center face=\"Garamond\">Welcome to Servlets 2.5 samples.</font>");
+		out.println("<font align=Center face=\"Garamond\">Sample Servlet!</font>");
 		out.println("</body></html>");
 
 	}

Added: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java?view=auto&rev=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
(added)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
Mon Jan  8 11:06:34 2007
@@ -0,0 +1,74 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  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.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.test.servlet;
+
+import java.io.*;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet implementation class for Servlet: SampleServlet
+ *
+ * @web.servlet
+ *   name="SampleServlet"
+ *   display-name="SampleServlet"
+ *
+ * @web.servlet-mapping
+ *   url-pattern="/SampleServlet"
+ *
+ */
+ public class  SampleServlet2 extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet
{
+    /* (non-Java-doc)
+	 * @see javax.servlet.http.HttpServlet#HttpServlet()
+	 */
+	public  SampleServlet2() {
+		super();
+
+	}
+
+	/* (non-Java-doc)
+	 * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
response)
+	 */
+	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
+		// TODO Auto-generated method stub
+	   doPost(request,response);
+	}
+
+	/* (non-Java-doc)
+	 * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
response)
+	 */
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
+		// TODO Auto-generated method stub
+
+		PrintWriter out = response.getWriter();
+		out.println("<html><head><title>Sample application with Servlets 2.5</title></head></html>");
+		out.println("<body>");
+		out.println("<font align=Center face=\"Garamond\">Welcome to Servlets 2.5 samples.</font>");
+		out.println("<font align=Center face=\"Garamond\">Another Sample Servlet!</font>");
+		out.println("</body></html>");
+
+	}
+	
+	public void init(ServletConfig config)
+	{
+		System.out.println("Initializing servlet");
+	}
+	
+}
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/java/com/test/servlet/SampleServlet2.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/geronimo-web.xml?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/geronimo-web.xml
(original)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/geronimo-web.xml
Mon Jan  8 11:06:34 2007
@@ -20,9 +20,9 @@
     <dep:moduleId>
       <dep:groupId>Samples</dep:groupId>
       <dep:artifactId>SampleServlet</dep:artifactId>
-      <dep:version>1.1</dep:version>
+      <dep:version>2.0</dep:version>
       <dep:type>car</dep:type>
     </dep:moduleId>
   </dep:environment>
-  <context-root>/SampleServlet</context-root>
+  <context-root>/servlet25</context-root>
 </web-app>

Modified: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/web.xml?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/main/webapp/WEB-INF/web.xml
Mon Jan  8 11:06:34 2007
@@ -18,17 +18,38 @@
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"
 	metadata-complete="true">
 	<display-name>SampleServlet</display-name>
+	<filter>
+  	  <filter-name>Sample Filter</filter-name>
+    	<filter-class>com.test.servlet.SampleFilter</filter-class>
+    </filter>
 	<servlet>
 		<description></description>
 		<display-name>SampleServlet</display-name>
 		<servlet-name>SampleServlet</servlet-name>
 		<servlet-class>com.test.servlet.SampleServlet</servlet-class>
 	</servlet>
+	<servlet>
+		<description></description>
+		<display-name>SampleServlet2</display-name>
+		<servlet-name>SampleServlet2</servlet-name>
+		<servlet-class>com.test.servlet.SampleServlet2</servlet-class>
+	</servlet>
 	<servlet-mapping>
 		<servlet-name>SampleServlet</servlet-name>
-		<url-pattern>/</url-pattern>
-		<url-pattern>/*</url-pattern>
+		<url-pattern>/SampleServlet</url-pattern>
+		<url-pattern>/SampleServlet/*</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+		<servlet-name>SampleServlet2</servlet-name>
+		<url-pattern>/SampleServlet2</url-pattern>
+		<url-pattern>/SampleServlet2/*</url-pattern>
 	</servlet-mapping>
+	<filter-mapping>
+	   <filter-name>Sample Filter</filter-name>
+        <servlet-name>*</servlet-name>
+ 		<!-- servlet-name>SampleServlet</servlet-name>
+ 		<servlet-name>SampleServlet2</servlet-name  -->
+    </filter-mapping> 
 	<welcome-file-list>
 		<welcome-file>index.html</welcome-file>
 		<welcome-file>index.htm</welcome-file>

Modified: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/java/org/apache/geronimo/testsuite/servlets/TestServlets.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/java/org/apache/geronimo/testsuite/servlets/TestServlets.java?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/java/org/apache/geronimo/testsuite/servlets/TestServlets.java
(original)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/java/org/apache/geronimo/testsuite/servlets/TestServlets.java
Mon Jan  8 11:06:34 2007
@@ -27,9 +27,19 @@
 {
     @Test
     public void testIndexContent() throws Exception {
-        selenium.open("/SampleServlet");
+        selenium.open("/servlet25/SampleServlet");
         selenium.waitForPageToLoad("30000");
         assertEquals("Sample application with Servlets 2.5", selenium.getTitle());
-        assertEquals("Welcome to Servlets 2.5 samples..!!!", selenium.getText("xpath=/html/body"));
+        assertEquals("Welcome to Servlets 2.5 samples. Sample Servlet!", selenium.getText("xpath=/html/body"));
+    }
+
+
+    @Test
+    public void testIndexContent2() throws Exception {
+        selenium.open("/servlet25/SampleServlet2");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Sample application with Servlets 2.5", selenium.getTitle());
+        assertEquals("Welcome to Servlets 2.5 samples. Another Sample Servlet!", selenium.getText("xpath=/html/body"));
+
     }
 }

Modified: geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/resources/testng.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/resources/testng.xml?view=diff&rev=494156&r1=494155&r2=494156
==============================================================================
--- geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/resources/testng.xml
(original)
+++ geronimo/server/trunk/testsuite/web-testsuite/test-2.5-servlets/src/test/resources/testng.xml
Mon Jan  8 11:06:34 2007
@@ -23,7 +23,7 @@
 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
 
 <suite name="Suite1" verbose="5">
-    <test name="deployment-testsuite.servlets">
+    <test name="web-testsuite.servlets">
         <packages>
             <package name="org.apache.geronimo.testsuite.servlets"/>
         </packages>



Mime
View raw message