From 0e9c6f1d448c2e27ae947f0dfee7813e84342244 Mon Sep 17 00:00:00 2001 From: Miguel Reboiro-Jato Date: Sun, 8 Nov 2015 02:48:04 +0100 Subject: [PATCH] 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. --- README.md | 21 ++++++++++++- domain/pom.xml | 9 ++++++ ear/pom.xml | 8 +++++ jsf/pom.xml | 9 ++++++ pom.xml | 84 ++++++++++++++++++++++++++++++++++++++++++++++--- rest/pom.xml | 9 ++++++ service/pom.xml | 9 ++++++ 7 files changed, 144 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4f2275d..69bdc9b 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/domain/pom.xml b/domain/pom.xml index 567fa10..be0c312 100644 --- a/domain/pom.xml +++ b/domain/pom.xml @@ -36,4 +36,13 @@ test + + + + + org.jacoco + jacoco-maven-plugin + + + diff --git a/ear/pom.xml b/ear/pom.xml index ae65dca..429246c 100644 --- a/ear/pom.xml +++ b/ear/pom.xml @@ -47,6 +47,14 @@ true + + org.wildfly.plugins + wildfly-maven-plugin + + false + 10990 + + diff --git a/jsf/pom.xml b/jsf/pom.xml index c6ebde4..22496da 100644 --- a/jsf/pom.xml +++ b/jsf/pom.xml @@ -63,4 +63,13 @@ test + + + + + org.jacoco + jacoco-maven-plugin + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 84bcdb0..9304961 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,19 @@ pom Sample + + + + deployment + Internal Releases + http://sing.ei.uvigo.es/dt/nexus/content/repositories/releases/ + + + deployment + Internal SNAPSHOT Releases + http://sing.ei.uvigo.es/dt/nexus/content/repositories/snapshots/ + + domain @@ -38,10 +51,12 @@ 4.12 2.0.0.0 + 3.4 + 0.7.5.201505241946 + 1.0.0.Alpha8 1.0.0.Alpha7 - 5.1.21 1.5.10 - 3.4 + 5.1.21 3.0.13.Final 2.1.0.Alpha3 @@ -149,6 +164,16 @@ ${graphene.webdrive.version} pom + + org.jboss.arquillian.extension + arquillian-jacoco + ${arquillian.jacoco.version} + + + org.jacoco + org.jacoco.core + ${jacoco.version} + mysql mysql-connector-java @@ -183,6 +208,15 @@ + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + @@ -204,12 +238,54 @@ org.wildfly.plugins wildfly-maven-plugin ${wildfly.maven.plugin.version} + + + true + org.apache.maven.plugins maven-ear-plugin ${maven.ear.plugin} + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + ${session.executionRootDirectory}/target/classes + + + + pre-unit-test + + prepare-agent + + + + post-unit-test + test + + report + + + + pre-integration-test + pre-integration-test + + prepare-agent + + + + post-integration-test + post-integration-test + + report + + + + @@ -329,7 +405,7 @@ maven-resources-plugin - copy-mysql-ds + copy-wildfly-resources process-test-classes copy-resources @@ -448,7 +524,7 @@ maven-resources-plugin - copy-mysql-ds + copy-wildfly-resources process-test-classes copy-resources diff --git a/rest/pom.xml b/rest/pom.xml index 51fbe20..307dfd7 100644 --- a/rest/pom.xml +++ b/rest/pom.xml @@ -67,4 +67,13 @@ test + + + + + org.jacoco + jacoco-maven-plugin + + + \ No newline at end of file diff --git a/service/pom.xml b/service/pom.xml index 65877b2..1479b2b 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -56,4 +56,13 @@ test + + + + + org.jacoco + jacoco-maven-plugin + + + \ No newline at end of file -- 2.18.1