Skip to content
mrdon edited this page Sep 12, 2010 · 20 revisions

The Maven ITBlast Plugin allows you to run your integration tests on multiple application servers in one build using the Cargo and Surefire Maven 2 plugins internally. The motivations for this plugin were to eliminate hundreds of POM XML for integration tests and add a few features like multiple container runs.

The plugin works by iterating through the configured containers and using the Maven 2 Cargo Plugin and the Maven 2 Surefire plugin to start/stop the container and run the tests, respectively. Since the same integration tests will be ran multiple times, it also renames the surefire reports to include the container ID (requires JUnit 3-compatible reports).

Downloads

You can download the jars, source, and javadocs from the Maven 2 repository:
bq. http://twdata-m2-repository.googlecode.com/svn/org/twdata/maven/maven-itblast-plugin/

Example Usage

This example shows how integration tests and unit tests can sit side-by-side by placing integration tests in packages starting with “it.”. It also executes the integration tests against Tomcat 5.x, Jetty 6.x, JBoss 4.2.x, and Resin 3.×. This configuration would be placed in your project’s pom.xml file. As of 0.3, these are the only containers supported.

    <build>
    	<plugins>
            <plugin>
                <groupId>org.twdata.maven</groupId>
                <artifactId>maven-itblast-plugin</artifactId>
                <version>0.5</version>
                <executions>
                    <execution>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <containers>tomcat5x,jetty6x,jboss42x,resin3x</containers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>it/**</exclude>
                        <exclude>**/*$*</exclude>
                    </excludes>
                </configuration>
            </plugin>
    	</plugins>
    </build>

Configuration Parameters

Name Type CLI Parameter Description
containers String containers List of containers to test against. Defaults to “tomcat5x”.
httpPort Integer http.port HTTP port for the servlet containers. Defaults to 8080.
rmiPort Integer rmi.port RMI port for cargo to control the container. Defaults to 10232.
skip boolean maven.test.skip Skips tests. Defaults to false.
functionalTestPattern String functionalTestPattern Pattern for to use to find integration tests. Defaults to “it/**”.
wait boolean wait True if cargo should wait after starting servlet container. Defaults to false.

Maven Repository

Add this to your pom.xml:




twdata-m2-repository
twdata.org Maven 2 Repository
http://twdata-m2-repository.googlecode.com/svn/
Clone this wiki locally