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/26 19:14:38 UTC

[sling-org-apache-sling-commons-clam] 02/02: SLING-9698 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-commons-clam.git

commit e8547d4b5cc0c9c3dac082015f3d214d91c5598c
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Aug 26 21:14:13 2020 +0200

    SLING-9698 Enable code coverage with JaCoCo
---
 pom.xml                                            | 26 ++++++++++++++++++++++
 .../commons/clam/it/tests/ClamTestSupport.java     |  4 +++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 95b68a9..1f69430 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,9 +88,35 @@
               <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>
     </plugins>
   </build>
 
diff --git a/src/test/java/org/apache/sling/commons/clam/it/tests/ClamTestSupport.java b/src/test/java/org/apache/sling/commons/clam/it/tests/ClamTestSupport.java
index dd6bf08..b25a0f4 100644
--- a/src/test/java/org/apache/sling/commons/clam/it/tests/ClamTestSupport.java
+++ b/src/test/java/org/apache/sling/commons/clam/it/tests/ClamTestSupport.java
@@ -34,6 +34,7 @@ import static org.apache.sling.testing.paxexam.SlingOptions.testcontainers;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
 public abstract class ClamTestSupport extends TestSupport {
@@ -71,7 +72,8 @@ public abstract class ClamTestSupport extends TestSupport {
             scr(),
             // testing
             testcontainers(),
-            junitBundles()
+            junitBundles(),
+            vmOption(System.getProperty("jacoco.command"))
         );
     }