You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ws...@apache.org on 2006/04/09 01:17:26 UTC

svn commit: r392629 - in /struts/action/trunk/integration: pom.xml taglib-it/pom.xml taglib-it/src/main/webapp/WEB-INF/web.xml taglib-it/src/main/webapp/index.jsp taglib-it/src/main/webapp/jspRedirector.jsp taglib-webapp/

Author: wsmoak
Date: Sat Apr  8 16:17:23 2006
New Revision: 392629

URL: http://svn.apache.org/viewcvs?rev=392629&view=rev
Log:
Add manual Cactus configuration to the Struts Taglib test webapp.  (There is no Cactus plugin for Maven 2.)
Bind executions of compiler, surefire, war and cargo plugins to appropriate build lifecycle phases.
Remove the taglib-webapp module, files were moved to taglib-it in r392482.


Added:
    struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp   (with props)
    struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp   (with props)
Removed:
    struts/action/trunk/integration/taglib-webapp/
Modified:
    struts/action/trunk/integration/pom.xml
    struts/action/trunk/integration/taglib-it/pom.xml
    struts/action/trunk/integration/taglib-it/src/main/webapp/WEB-INF/web.xml

Modified: struts/action/trunk/integration/pom.xml
URL: http://svn.apache.org/viewcvs/struts/action/trunk/integration/pom.xml?rev=392629&r1=392628&r2=392629&view=diff
==============================================================================
--- struts/action/trunk/integration/pom.xml (original)
+++ struts/action/trunk/integration/pom.xml Sat Apr  8 16:17:23 2006
@@ -46,12 +46,7 @@
    <name>Struts Action - Integration Tests</name>
 
    <modules>
-      <module>taglib-webapp</module>
       <module>taglib-it</module>
    </modules>
-   
-  <build>
-   <finalName>${pom.artifactId}</finalName>
-  </build>
 
 </project>

Modified: struts/action/trunk/integration/taglib-it/pom.xml
URL: http://svn.apache.org/viewcvs/struts/action/trunk/integration/taglib-it/pom.xml?rev=392629&r1=392628&r2=392629&view=diff
==============================================================================
--- struts/action/trunk/integration/taglib-it/pom.xml (original)
+++ struts/action/trunk/integration/taglib-it/pom.xml Sat Apr  8 16:17:23 2006
@@ -23,11 +23,13 @@
              Experimental Maven 2 Build for Apache Struts
              ============================================
 
-To build and install this module into your local repo:
+To run the Cactus tests for Struts Taglib:
 
-   $ mvn install
-   
-For more information, see:  http://wiki.apache.org/struts/StrutsMaven2Plan
+   $ mvn integration-test -Dcargo.tomcat5x.home=c:/java/apache-tomcat-5.5.16
+
+   (The cargo.tomcat5x.home property may be configured in settings.xml)
+
+For more information, see:  http://wiki.apache.org/struts/StrutsMaintenanceMaven
 
 -->
 
@@ -50,19 +52,22 @@
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
-         <scope>test</scope>
       </dependency>
       <dependency>
-        <groupId>cactus</groupId>
-        <artifactId>cactus</artifactId>
-        <version>13-1.7</version>
-        <scope>test</scope>
-        <exclusions>
-          <exclusion>
-            <groupId>j2ee</groupId>
-            <artifactId>j2ee</artifactId>
-          </exclusion>
-        </exclusions>
+         <groupId>cactus</groupId>
+         <artifactId>cactus</artifactId>
+         <version>13-1.7</version>
+         <exclusions>
+            <exclusion>
+               <groupId>j2ee</groupId>
+               <artifactId>j2ee</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>aspectj</groupId>
+         <artifactId>aspectjrt</artifactId>
+         <version>1.2.1</version>
       </dependency>
       <dependency>
          <groupId>httpunit</groupId>
@@ -93,34 +98,108 @@
          <scope>test</scope>
       </dependency>
    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>compiler-it</id>
-                        <phase>pre-integration-test</phase>
-                        <goals>
-                            <goal>testCompile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>surefire-it</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
+
+   <build>
+
+      <sourceDirectory>src/test/java</sourceDirectory>
+      <testSourceDirectory>src/test/java</testSourceDirectory>
+
+      <finalName>${pom.artifactId}</finalName>
+
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-war-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>package-war</id>
+                  <phase>package</phase>
+                  <goals>
+                     <goal>war</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>compiler-for-webapp</id>
+                  <phase>compile</phase>
+                  <goals>
+                     <goal>compile</goal>
+                  </goals>
+               </execution>
+               <execution>
+                  <id>compiler-for-tests</id>
+                  <phase>test-compile</phase>
+                  <goals>
+                     <goal>testCompile</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+               <systemProperties>
+                  <property>
+                     <name>cactus.contextURL</name>
+                     <value>http://localhost:8080/${artifactId}</value>
+                  </property>
+               </systemProperties>
+            </configuration>
+            <executions>
+               <execution>
+                  <id>surefire-it</id>
+                  <phase>integration-test</phase>
+                  <goals>
+                     <goal>test</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+         <plugin>
+            <groupId>org.codehaus.cargo</groupId>
+            <artifactId>cargo-maven2-plugin</artifactId>
+            <configuration>
+               <wait>false</wait>
+               <container>
+                  <containerId>tomcat5x</containerId>
+                  <home>${cargo.tomcat5x.home}</home>
+                  <log>${project.build.directory}/tomcat5x.log</log>
+               </container>
+               <configuration>
+                  <home>${project.build.directory}/tomcat</home>
+                  <deployables>
+                     <deployable>
+                        <location>${project.build.directory}/${artifactId}.war</location>
+                        <type>war</type>
+                        <pingURL>http://localhost:8080/${artifactId}</pingURL>
+                     </deployable>
+                  </deployables>
+               </configuration>
+            </configuration>
+            <executions>
+               <execution>
+                  <id>start-container</id>
+                  <phase>pre-integration-test</phase>
+                  <goals>
+                     <goal>start</goal>
+                  </goals>
+               </execution>
+               <execution>
+                  <id>stop-container</id>
+                  <phase>post-integration-test</phase>
+                  <goals>
+                     <goal>stop</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+      </plugins>
+   </build>
+
 </project>

Modified: struts/action/trunk/integration/taglib-it/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/struts/action/trunk/integration/taglib-it/src/main/webapp/WEB-INF/web.xml?rev=392629&r1=392628&r2=392629&view=diff
==============================================================================
--- struts/action/trunk/integration/taglib-it/src/main/webapp/WEB-INF/web.xml (original)
+++ struts/action/trunk/integration/taglib-it/src/main/webapp/WEB-INF/web.xml Sat Apr  8 16:17:23 2006
@@ -6,4 +6,39 @@
 
 <web-app>
   <display-name>Struts Taglib Testing Application</display-name>
+
+    <filter>
+        <filter-name>FilterRedirector</filter-name>
+        <filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>FilterRedirector</filter-name>
+        <url-pattern>/FilterRedirector</url-pattern>
+    </filter-mapping>
+
+    <servlet>
+        <servlet-name>ServletRedirector</servlet-name>
+        <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
+    </servlet>
+
+    <servlet>
+        <servlet-name>JspRedirector</servlet-name>
+        <jsp-file>/jspRedirector.jsp</jsp-file>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>ServletRedirector</servlet-name>
+        <url-pattern>/ServletRedirector</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>JspRedirector</servlet-name>
+        <url-pattern>/JspRedirector</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+       <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+
 </web-app>

Added: struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewcvs/struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp?rev=392629&view=auto
==============================================================================
--- struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp (added)
+++ struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp Sat Apr  8 16:17:23 2006
@@ -0,0 +1,10 @@
+<html>
+  <head>
+    <title>Struts Taglib Test Webapp</title>
+  <head>
+  <body>
+    <p>Struts Taglib Test Webapp</p>
+    <p>This page is used by Cargo to verify that the webapp has started.</p>
+  </body>
+</html>
+  

Propchange: struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: struts/action/trunk/integration/taglib-it/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp
URL: http://svn.apache.org/viewcvs/struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp?rev=392629&view=auto
==============================================================================
--- struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp (added)
+++ struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp Sat Apr  8 16:17:23 2006
@@ -0,0 +1,28 @@
+<%@page import="org.apache.cactus.server.*,org.apache.cactus.internal.server.*" session="true" %><%
+
+    /**                                                
+     * Note:
+     * It is very important not to put any character between the end
+     * of the page tag and the beginning of the java code expression, otherwise,
+     * the generated servlet contains a 'out.println("\r\n");' and this breaks
+     * our mechanism !
+     */
+
+    /**
+     * This JSP is used as a proxy to call your server-side unit tests. We use
+     * a JSP rather than a servlet because for testing custom JSP tags for
+     * example we need access to JSP implicit objects (PageContext and
+     * JspWriter).
+     */
+
+    JspImplicitObjects objects = new JspImplicitObjects();
+    objects.setHttpServletRequest(request);
+    objects.setHttpServletResponse(response);
+    objects.setServletConfig(config);
+    objects.setServletContext(application);
+    objects.setJspWriter(out);
+    objects.setPageContext(pageContext);
+
+    JspTestRedirector redirector = new JspTestRedirector();
+    redirector.doGet(objects);
+%>
\ No newline at end of file

Propchange: struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: struts/action/trunk/integration/taglib-it/src/main/webapp/jspRedirector.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



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