Skip to content

Instantly share code, notes, and snippets.

@jpbriend
Created December 13, 2012 14:57
Show Gist options
  • Save jpbriend/4276903 to your computer and use it in GitHub Desktop.
Save jpbriend/4276903 to your computer and use it in GitHub Desktop.
Maven : Integration Tests with SoapUI and Sonar Code Coverage. See http://blog.infin-it.fr/2012/12/13/maven-integration-tests-with-soapui-and-sonar-code-coverage for more details.
<dependencies>
<!-- needed to execute Integration tests instrumented with Cobertura -->
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<version>1.9.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>4.5.1</version>
<configuration>
<junitReport>true</junitReport>
<exportAll>true</exportAll>
<projectFile>${project.build.directory}/test-classes/my-soapui-project.xml</projectFile>
<outputFolder>${project.build.directory}/surefire-reports</outputFolder>
<testSuite>myIntegrationTests</testSuite>
<testFailIgnore>true</testFailIgnore>
</configuration>
<executions>
<execution>
<id>wsn-server-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-it-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<formats>
<format>xml</format>
<format>html</format>
</formats>
<check>
<haltOnFailure>false</haltOnFailure>
</check>
</configuration>
<executions>
<execution>
<id>cobertura-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<id>cobertura-instrument</id>
<phase>process-classes</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>cobertura-report</id>
<phase>pre-site</phase>
<goals>
<goal>report-only</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.2.v20120308</version>
<configuration>
<stopPort>18043</stopPort>
<stopKey>STOP</stopKey>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>18042</port>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<!-- Needed in order to to code coverage on SoapUI tests -->
<classesDirectory>${project.build.directory}/generated-classes/cobertura</classesDirectory>
<useTestScope>true</useTestScope>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
<contextPath>/myIntegrationTestsContext</contextPath>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-it-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment