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 b59e9c0  fix JaCoCo VM option
b59e9c0 is described below

commit b59e9c013d4637d3e1001c8b6768fdbc7fdad8c2
Author: Oliver Lietz <[email protected]>
AuthorDate: Mon May 9 13:22:35 2022 +0200

    fix JaCoCo VM option
---
 .../sling/jcr/oak/server/it/OakServerTestSupport.java       | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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 ba586b8..66edd5c 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
@@ -20,6 +20,7 @@ package org.apache.sling.jcr.oak.server.it;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.inject.Inject;
@@ -37,6 +38,8 @@ import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.testing.paxexam.TestSupport;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.options.OptionalCompositeOption;
+import org.ops4j.pax.exam.options.extra.VMOption;
 import org.ops4j.pax.exam.util.PathUtils;
 import org.osgi.framework.BundleContext;
 
@@ -50,6 +53,7 @@ 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.CoreOptions.when;
 import static 
org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
@@ -158,10 +162,17 @@ public abstract class OakServerTestSupport extends 
TestSupport {
             testBundle("bundle.filename"),
             // testing
             junitBundles(),
-            vmOption(System.getProperty("jacoco.command"))
+            jacoco() // remove with Testing PaxExam 4.0
         };
     }
 
+    // remove with Testing PaxExam 4.0
+    protected OptionalCompositeOption jacoco() {
+        final String jacocoCommand = System.getProperty("jacoco.command");
+        final VMOption option = Objects.nonNull(jacocoCommand) && 
!jacocoCommand.trim().isEmpty() ? vmOption(jacocoCommand) : null;
+        return when(Objects.nonNull(option)).useOptions(option);
+    }
+
     protected Option launchpad() {
         final String repoinit = 
String.format("raw:file:%s/src/test/resources/repoinit.txt", 
PathUtils.getBaseDir());
         final String slingHome = String.format("%s/sling", workingDirectory());

Reply via email to