Commit 0e9c6f1d authored by Administrator's avatar Administrator

Adds JaCoCo and Wildfly plugins

The JaCoCo plugin has been added to perform the coverage test, while the
Wildfly plugins allows the automatic deployment of the project on a
Wildfly server using the 10990 port as the administration port.
parent 9663e093
......@@ -270,4 +270,23 @@ When executed, the REST resources can be found in
`http://localhost:8080/jsf/faces/index.html`.
## Sample 6: Additional Testing Tools
Coming soon...
### Test coverage with JaCoCo
Test coverage is a very useful tool that shows the parts of the source code that
are covered by the tests. The coverage analysis is done during the tests
execution, making it very precise.
The JaCoCo plugin is now part or the project, analyzing the test execution. This
plugin generates a HTML report in the `target/site/jacoco` folder. This report
is very useful to check if some part of the code is missing some tests.
## Wildfly Deployment
The Wildfly Maven plugin is now part of the project. This plugin allows the
automatic deployment of the project in a Wildfly server running with a port
offset of 1000 (this means that the Wildfly uses the 9080 port as the HTTP port
and the 10990 as the management port).
The offset of a Wildfly server can be changed using the system property `jboss.socket.binding.port-offset`. For example, starting Wildfly with the
command:
```bash
$WILDFLY_HOME/bin/standalone.sh -Djboss.socket.binding.port-offset=1000
```
......@@ -36,4 +36,13 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
......@@ -46,6 +46,14 @@
<defaultLibBundleDir>lib/</defaultLibBundleDir>
<skinnyWars>true</skinnyWars>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
<port>10990</port>
</configuration>
</plugin>
</plugins>
</build>
......
......@@ -63,4 +63,13 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -8,6 +8,19 @@
<name>Sample</name>
<distributionManagement>
<repository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://sing.ei.uvigo.es/dt/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>deployment</id>
<name>Internal SNAPSHOT Releases</name>
<url>http://sing.ei.uvigo.es/dt/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<modules>
<module>domain</module>
<module>tests</module>
......@@ -38,10 +51,12 @@
<!-- Testing dependecies versions -->
<junit.version>4.12</junit.version>
<hamcrest.version>2.0.0.0</hamcrest.version>
<easymock.version>3.4</easymock.version>
<jacoco.version>0.7.5.201505241946</jacoco.version>
<arquillian.jacoco.version>1.0.0.Alpha8</arquillian.jacoco.version>
<arquillian.persistence.dbunit.version>1.0.0.Alpha7</arquillian.persistence.dbunit.version>
<mysql.connector.java.version>5.1.21</mysql.connector.java.version>
<slf4j.version>1.5.10</slf4j.version>
<easymock.version>3.4</easymock.version>
<mysql.connector.java.version>5.1.21</mysql.connector.java.version>
<resteasy.version>3.0.13.Final</resteasy.version>
<graphene.webdrive.version>2.1.0.Alpha3</graphene.webdrive.version>
......@@ -149,6 +164,16 @@
<version>${graphene.webdrive.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-jacoco</artifactId>
<version>${arquillian.jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
......@@ -183,6 +208,15 @@
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<deployAtEnd>true</deployAtEnd>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
......@@ -204,12 +238,54 @@
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly.maven.plugin.version}</version>
<configuration>
<!-- Avoids the execution of the wildfly:* goals in the subproject
unless the plugin is activated in the subproject. -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>${maven.ear.plugin}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<classDumpDir>${session.executionRootDirectory}/target/classes</classDumpDir>
</configuration>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
......@@ -329,7 +405,7 @@
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-mysql-ds</id>
<id>copy-wildfly-resources</id>
<phase>process-test-classes</phase>
<goals>
<goal>copy-resources</goal>
......@@ -448,7 +524,7 @@
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-mysql-ds</id>
<id>copy-wildfly-resources</id>
<phase>process-test-classes</phase>
<goals>
<goal>copy-resources</goal>
......
......@@ -67,4 +67,13 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -56,4 +56,13 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment