Author: wsmoak Date: Tue Jun 6 23:49:19 2006 New Revision: 412306 URL: http://svn.apache.org/viewvc?rev=412306&view=rev Log: Move the integration test under src/test and configure Surefire to include/exclude tests depending on which phase it's running in. Thanks to David DeWolf for this idea. Configure the Cargo plugin to start and stop Tomcat for the integration tests. This requires 'cargo.tomcat5x.home' to be set either on the command line or in settings.xml. The tests should work with 'mvn install -Pmyfaces,itest' but Cargo is complaining that it can't delete a log file.
Added: struts/shale/branches/mvn_reorg/shale-apps/shale-blank/src/test/java/org/apache/shale/blank/systest/ - copied from r412295, struts/shale/branches/mvn_reorg/shale-apps/shale-blank/src/systest/org/apache/shale/blank/systest/ Removed: struts/shale/branches/mvn_reorg/shale-apps/shale-blank/src/systest/ Modified: struts/shale/branches/mvn_reorg/shale-apps/shale-blank/pom.xml Modified: struts/shale/branches/mvn_reorg/shale-apps/shale-blank/pom.xml URL: http://svn.apache.org/viewvc/struts/shale/branches/mvn_reorg/shale-apps/shale-blank/pom.xml?rev=412306&r1=412305&r2=412306&view=diff ============================================================================== --- struts/shale/branches/mvn_reorg/shale-apps/shale-blank/pom.xml (original) +++ struts/shale/branches/mvn_reorg/shale-apps/shale-blank/pom.xml Tue Jun 6 23:49:19 2006 @@ -75,6 +75,102 @@ <artifactId>junit</artifactId> </dependency> + <dependency> + <groupId>htmlunit</groupId> + <artifactId>htmlunit</artifactId> + <version>1.7</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>javax.xml</groupId> + <artifactId>jsr173</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/systest/**</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>itest</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-maven2-plugin</artifactId> + <version>0.2</version> + <executions> + <execution> + <id>cargo-start</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + <configuration> + <wait>false</wait> + <container> + <containerId>tomcat5x</containerId> + <home>${cargo.tomcat5x.home}</home> + <log>${project.build.directory}/tomcat5x.log</log> + <output>${project.build.directory}/tomcat5x.out</output> + </container> + <configuration> + <home>${project.build.directory}/tomcat5x</home> + </configuration> + </configuration> + </execution> + <execution> + <id>cargo-stop</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</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> + <configuration> + <excludes> + <exclude>none</exclude> + </excludes> + <includes> + <include>**/systest/**</include> + </includes> + <systemProperties> + <property> + <name>url</name> + <value>http://localhost:8080/shale-blank</value> + </property> + </systemProperties> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project>