You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2022/07/25 14:52:23 UTC
[unomi] branch migrationTests updated: UNOMI-203: improve integration test to use KarafTestSupport
This is an automated email from the ASF dual-hosted git repository.
jkevan pushed a commit to branch migrationTests
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/migrationTests by this push:
new c99c24e48 UNOMI-203: improve integration test to use KarafTestSupport
c99c24e48 is described below
commit c99c24e48fffac1ae6122aa2f14cd7662d5effdc
Author: Kevan <ke...@jahia.com>
AuthorDate: Mon Jul 25 16:52:17 2022 +0200
UNOMI-203: improve integration test to use KarafTestSupport
---
itests/src/test/java/org/apache/unomi/itests/BaseIT.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
index ea632da58..228b16845 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
@@ -61,6 +61,7 @@ import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
+import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerSuite;
import org.ops4j.pax.exam.util.Filter;
@@ -79,6 +80,9 @@ import javax.net.ssl.X509TrustManager;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@@ -253,6 +257,18 @@ public abstract class BaseIT extends KarafTestSupport {
karafOptions.add(0, debugConfiguration(port, hold));
}
+ // Jacoco setup
+ final String agentFile = System.getProperty("user.dir") + "/target/jacoco/lib/jacocoagent.jar";
+ Path path = Paths.get(agentFile);
+ if (Files.exists(path)) {
+ final String jacocoOption = "-javaagent:" + agentFile + "=destfile=" + System.getProperty("user.dir")
+ + "/target/jacoco.exec,includes=org.apache.unomi.*";
+ LOGGER.info("set jacoco java agent: {}", jacocoOption);
+ karafOptions.add(new VMOption(jacocoOption));
+ } else {
+ LOGGER.warn("Unable to set jacoco agent as {} was not found", agentFile);
+ }
+
String customLogging = System.getProperty("it.karaf.customLogging");
if (customLogging != null) {
String[] customLoggingParts = customLogging.split(":");