You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2022/12/19 10:29:31 UTC

[jackrabbit-oak] branch OAK-10039 updated: OAK-10039: CompositeTestSupport: improve diagnostics

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

reschke pushed a commit to branch OAK-10039
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/OAK-10039 by this push:
     new 952afe5d2f OAK-10039: CompositeTestSupport: improve diagnostics
952afe5d2f is described below

commit 952afe5d2fe5c96903c1faf0500c2b5059ff9563
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Mon Dec 19 11:29:20 2022 +0100

    OAK-10039: CompositeTestSupport: improve diagnostics
---
 .../jackrabbit/oak/composite/it/CompositeTestSupport.java | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/it/CompositeTestSupport.java b/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/it/CompositeTestSupport.java
index 94fef859cf..b66288a3f5 100644
--- a/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/it/CompositeTestSupport.java
+++ b/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/it/CompositeTestSupport.java
@@ -18,8 +18,13 @@
  */
 package org.apache.jackrabbit.oak.composite.it;
 
+import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.apache.sling.testing.paxexam.SlingOptions;
 import org.apache.sling.testing.paxexam.TestSupport;
+import org.junit.BeforeClass;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.options.ModifiableCompositeOption;
 
@@ -46,6 +51,13 @@ public abstract class CompositeTestSupport extends TestSupport {
 
     @Override
     protected ModifiableCompositeOption baseConfiguration() {
+        String bundlePath = System.getProperty("bundle.filename");
+        if (bundlePath == null) {
+            throw new IllegalArgumentException("This IT has to be called with system property 'bundle.filename' set to the path of this bundle jar");
+        }
+        if (!Files.exists(Paths.get(bundlePath))) {
+            throw new IllegalArgumentException("The bundle jar to be tested needs to be built first with 'mvn package'");
+        }
         return composite(
             super.baseConfiguration(),
             logging("INFO"),
@@ -90,7 +102,8 @@ public abstract class CompositeTestSupport extends TestSupport {
     protected static Option logging(String level) {
         return composite(
             mavenBundle("org.ops4j.pax.logging", "pax-logging-api", "1.11.13"),
-            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(level)
+            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(level),
+            SlingOptions.logback()
         );
     }