StrutsCactusTest

HomePage | RecentChanges | Preferences

How to run the Struts Taglib Integration Tests with Maven 2.

<?xml version="1.0"?>
<!--
/* 
 * Copyright 2005-2006 The Apache Software Foundation.
 * 
 * Licensed 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.
 *
 * $Id: pom.xml 392431 2006-04-07 21:56:19Z wsmoak $
 */
-->

<!-- 
             Experimental Maven 2 Build for Apache Struts
             ============================================

To run the Cactus tests for Struts Taglib:

   $ mvn integration-test -Dcactus.contextURL=http://localhost:8080/taglib-it
                          -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

-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

   <parent>
      <groupId>org.apache.struts.action</groupId>
      <artifactId>struts-action-it</artifactId>
      <version>1.3.2-SNAPSHOT</version>
   </parent>

   <modelVersion>4.0.0</modelVersion>
   <artifactId>taglib-it</artifactId>
   <packaging>pom</packaging>
   <name>Struts Action - Integration - Taglib Tests</name>

   <dependencies>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>3.8.1</version>
      </dependency>
      <dependency>
         <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>
         <artifactId>httpunit</artifactId>
         <version>1.5.4</version>
      </dependency>
      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>servlet-api</artifactId>
         <version>2.3</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.struts.action</groupId>
         <artifactId>struts-taglib</artifactId>
         <version>${version}</version>
      </dependency>
      <dependency>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-core-uberjar</artifactId>
         <version>0.8</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-ant</artifactId>
         <version>0.8</version>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>

      <sourceDirectory>src/test/java</sourceDirectory>
      <testSourceDirectory>src/test/java</testSourceDirectory>

      <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>
            <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>

      <finalName>${pom.artifactId}</finalName>

   </build>

   <!--profiles>
      <profile>
         <id>taglib-cactus-config</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <properties>
            <cactus.contextURL>http://localhost:8080/${artifactId}</cactus.contextURL>
         </properties>
      </profile>
   </profiles-->

   <!--properties>
       <cactus.contextURL>http://localhost:8080/${artifactId}</cactus.contextURL>
   </properties-->

</project>


Struts Action 1.3.0 Release

Test matrix for the 1.3.0 release:

Tomcat 4.1.31 Tomcat 5.0.30
JDK 1.4 OK r373830
JDK 1.5 OK r373830


The tests were run on an old working copy. Since then, something changed-- my bet is on the JSPs or some XML having been reformatted.

/svn/struts/current/taglib
$ svn info
Path: .
URL: https://svn.apache.org/repos/asf/struts/taglib/trunk
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 373830
Node Kind: directory
Schedule: normal
Last Changed Author: wsmoak
Last Changed Rev: 366394
Last Changed Date: 2006-01-05 19:33:24 -0700 (Thu, 05 Jan 2006)
Properties Last Updated: 2006-01-31 08:13:11 -0700 (Tue, 31 Jan 2006)

/svn/struts/current/taglib
$ cat build.properties
cactus.home.tomcat5x=c:\\java\\cactus\\jakarta-tomcat-5.0.30

/svn/struts/current/taglib
$ echo $JAVA_HOME
c:\j2sdk1.4.2_03

/svn/struts/current/taglib
$ maven clean cactus:test
...
    [cactus] Testcase: testParameterPresent took 0.016 sec
    [cactus] Testcase: testParameterNotPresent took 0 sec
BUILD SUCCESSFUL
Total time: 5 minutes 31 seconds

/svn/struts/current/taglib
$ echo $JAVA_HOME
c:\Program Files\Java\jdk1.5.0_06

/svn/struts/current/taglib
$ cat build.properties
cactus.home.tomcat5x=c:\\java\\cactus\\jakarta-tomcat-5.0.30


/svn/struts/current/taglib
$ maven clean cactus:test
...
    [cactus] Testcase: testParameterPresent took 0.016 sec
    [cactus] Testcase: testParameterNotPresent took 0 sec
BUILD SUCCESSFUL
Total time: 5 minutes 14 seconds


HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited April 8, 2006 1:08 am by WendySmoak (diff)
Search: