You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2020/08/27 08:06:41 UTC

[sling-org-apache-sling-jcr-oak-server] branch master updated: SLING-9704 Enable code coverage with JaCoCo

This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-oak-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f5f359  SLING-9704 Enable code coverage with JaCoCo
2f5f359 is described below

commit 2f5f3597d9e1f7cfb3357faf9f3bf71d05a10ed1
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 27 10:04:05 2020 +0200

    SLING-9704 Enable code coverage with JaCoCo
---
 pom.xml                                            | 26 ++++++++++++++++++++++
 .../jcr/oak/server/it/OakServerTestSupport.java    |  4 +++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ae5a5eb..1573579 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,10 +75,36 @@
               <name>bundle.filename</name>
               <value>${basedir}/target/${project.build.finalName}.jar</value>
             </property>
+            <property>
+              <name>jacoco.command</name>
+              <value>${jacoco.command}</value>
+            </property>
           </systemProperties>
         </configuration>
       </plugin>
       <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>prepare-agent</id>
+            <configuration>
+              <propertyName>jacoco.command</propertyName>
+            </configuration>
+            <goals>
+              <goal>prepare-agent</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>report</id>
+            <phase>post-integration-test</phase>
+            <goals>
+              <goal>report</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <groupId>org.apache.servicemix.tooling</groupId>
         <artifactId>depends-maven-plugin</artifactId>
       </plugin>
diff --git a/src/test/java/org/apache/sling/jcr/oak/server/it/OakServerTestSupport.java b/src/test/java/org/apache/sling/jcr/oak/server/it/OakServerTestSupport.java
index a8b0d76..ba586b8 100644
--- a/src/test/java/org/apache/sling/jcr/oak/server/it/OakServerTestSupport.java
+++ b/src/test/java/org/apache/sling/jcr/oak/server/it/OakServerTestSupport.java
@@ -49,6 +49,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
@@ -156,7 +157,8 @@ public abstract class OakServerTestSupport extends TestSupport {
             // Sling JCR Oak Server
             testBundle("bundle.filename"),
             // testing
-            junitBundles()
+            junitBundles(),
+            vmOption(System.getProperty("jacoco.command"))
         };
     }