You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2019/10/28 15:35:55 UTC

[aries-rsa] 01/02: ARIES-1780 - Use logback in itests

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

cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git

commit f9ad1bb090b5027d99a923e5cd5d4a800757cfd9
Author: Christian Schneider <cs...@adobe.com>
AuthorDate: Mon Oct 28 16:23:31 2019 +0100

    ARIES-1780 - Use logback in itests
---
 .../apache/aries/rsa/itests/felix/RsaTestBase.java |  8 ++++++
 itests/felix/src/test/resources/exam.properties    |  1 +
 itests/felix/src/test/resources/logback.xml        | 30 ++++++++++++++++++++++
 3 files changed, 39 insertions(+)

diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
index c08bfce..8e3e371 100644
--- a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
+++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
@@ -124,6 +124,7 @@ public class RsaTestBase {
     protected static Option rsaCore() {
         return composite(junit(), 
                          localRepo(),
+                         logback(),
                          systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
                          systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
                          systemProperty("aries.rsa.hostname").value("localhost"),
@@ -139,6 +140,13 @@ public class RsaTestBase {
         );
     }
     
+    public static Option logback() {
+        return composite(systemProperty("logback.configurationFile").value("src/test/resources/logback.xml"),
+                mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version("1.7.6"),
+                mavenBundle().groupId("ch.qos.logback").artifactId("logback-core").version("1.0.13"),
+                mavenBundle().groupId("ch.qos.logback").artifactId("logback-classic").version("1.0.13"));
+    }
+    
     protected static Option debug() {
         return CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005");
     }
diff --git a/itests/felix/src/test/resources/exam.properties b/itests/felix/src/test/resources/exam.properties
new file mode 100644
index 0000000..88239dd
--- /dev/null
+++ b/itests/felix/src/test/resources/exam.properties
@@ -0,0 +1 @@
+pax.exam.logging = none
\ No newline at end of file
diff --git a/itests/felix/src/test/resources/logback.xml b/itests/felix/src/test/resources/logback.xml
new file mode 100644
index 0000000..f4696e4
--- /dev/null
+++ b/itests/felix/src/test/resources/logback.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<configuration>
+  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%date %level %logger [%file : %line] %msg - %mdc %n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="info">
+    <appender-ref ref="console"/>
+  </root>
+</configuration>
\ No newline at end of file