From 87023da9e3b224811d1819bb2556d78ebe008547 Mon Sep 17 00:00:00 2001 From: J-N-K Date: Fri, 27 May 2022 09:07:15 +0200 Subject: [PATCH] Fix issues with tests after core-changes (#12817) Signed-off-by: Jan N. Klug --- .../irobot/internal/handler/RoombaHandlerTest.java | 13 +++++-------- .../src/test/java/main/Main.java | 3 --- .../org.openhab.binding.avmfritz.tests/itest.bndrun | 4 +++- itests/org.openhab.binding.feed.tests/itest.bndrun | 4 +++- itests/org.openhab.binding.hue.tests/itest.bndrun | 9 ++++++--- itests/org.openhab.binding.max.tests/itest.bndrun | 4 +++- .../itest.bndrun | 4 +++- .../org.openhab.binding.modbus.tests/itest.bndrun | 4 +++- .../itest.bndrun | 5 ++++- .../itest.bndrun | 5 ++++- itests/org.openhab.binding.nest.tests/itest.bndrun | 7 +++++-- itests/org.openhab.binding.ntp.tests/itest.bndrun | 4 +++- .../itest.bndrun | 4 +++- .../org.openhab.binding.tradfri.tests/itest.bndrun | 4 +++- itests/org.openhab.binding.wemo.tests/itest.bndrun | 4 +++- .../itest.bndrun | 4 +++- 16 files changed, 54 insertions(+), 28 deletions(-) diff --git a/bundles/org.openhab.binding.irobot/src/test/java/org/openhab/binding/irobot/internal/handler/RoombaHandlerTest.java b/bundles/org.openhab.binding.irobot/src/test/java/org/openhab/binding/irobot/internal/handler/RoombaHandlerTest.java index 59eb414dc..b1ed5515d 100644 --- a/bundles/org.openhab.binding.irobot/src/test/java/org/openhab/binding/irobot/internal/handler/RoombaHandlerTest.java +++ b/bundles/org.openhab.binding.irobot/src/test/java/org/openhab/binding/irobot/internal/handler/RoombaHandlerTest.java @@ -15,7 +15,6 @@ package org.openhab.binding.irobot.internal.handler; import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; -import java.lang.reflect.Field; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -38,9 +37,10 @@ import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.thing.ThingUID; import org.openhab.core.thing.binding.ThingHandlerCallback; import org.openhab.core.thing.internal.ThingImpl; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.spi.LocationAwareLogger; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; /** * Test the MQTT protocol with local iRobot (without openhab running). @@ -66,11 +66,8 @@ public class RoombaHandlerTest { @BeforeEach void setUp() throws Exception { - Logger logger = LoggerFactory.getLogger(RoombaHandler.class); - Field logLevelField = logger.getClass().getDeclaredField("currentLogLevel"); - logLevelField.setAccessible(true); - logLevelField.set(logger, LocationAwareLogger.TRACE_INT); - + final Logger logger = (Logger) LoggerFactory.getLogger(RoombaHandler.class); + logger.setLevel(Level.TRACE); Configuration config = new Configuration(); config.put("ipaddress", RoombaHandlerTest.IP_ADDRESS); config.put("password", RoombaHandlerTest.PASSWORD); diff --git a/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java b/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java index ba1e6dd0e..3236947b9 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java @@ -53,9 +53,6 @@ public class Main { try { scheduler = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors()); - logger.info("System properties={}", - System.getProperties().get(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY)); - ParadoxBuilderFactory factory = new ParadoxBuilderFactory(); ICommunicatorBuilder builder = factory.createBuilder(PanelType.EVO192); communicator = builder.withIp150Password(ip150Password).withPcPassword(pcPassword).withIpAddress(ipAddress) diff --git a/itests/org.openhab.binding.avmfritz.tests/itest.bndrun b/itests/org.openhab.binding.avmfritz.tests/itest.bndrun index 40c13172a..5ba945eb9 100644 --- a/itests/org.openhab.binding.avmfritz.tests/itest.bndrun +++ b/itests/org.openhab.binding.avmfritz.tests/itest.bndrun @@ -75,4 +75,6 @@ Fragment-Host: org.openhab.binding.avmfritz org.eclipse.jetty.websocket.common;version='[9.4.46,9.4.47)',\ org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ org.ops4j.pax.web.pax-web-api;version='[7.3.25,7.3.26)',\ - org.jupnp;version='[2.6.1,2.6.2)' + org.jupnp;version='[2.6.1,2.6.2)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.feed.tests/itest.bndrun b/itests/org.openhab.binding.feed.tests/itest.bndrun index 7a5f4a562..5440a7ad8 100644 --- a/itests/org.openhab.binding.feed.tests/itest.bndrun +++ b/itests/org.openhab.binding.feed.tests/itest.bndrun @@ -75,4 +75,6 @@ Fragment-Host: org.openhab.binding.feed org.ops4j.pax.web.pax-web-api;version='[7.3.25,7.3.26)',\ org.ops4j.pax.web.pax-web-jetty;version='[7.3.25,7.3.26)',\ org.ops4j.pax.web.pax-web-runtime;version='[7.3.25,7.3.26)',\ - org.ops4j.pax.web.pax-web-spi;version='[7.3.25,7.3.26)' + org.ops4j.pax.web.pax-web-spi;version='[7.3.25,7.3.26)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.hue.tests/itest.bndrun b/itests/org.openhab.binding.hue.tests/itest.bndrun index 6f3b03fef..fa1fcbce6 100644 --- a/itests/org.openhab.binding.hue.tests/itest.bndrun +++ b/itests/org.openhab.binding.hue.tests/itest.bndrun @@ -6,7 +6,8 @@ Fragment-Host: org.openhab.binding.hue -runrequires: \ bnd.identity;id='org.openhab.binding.hue.tests',\ bnd.identity;id='org.openhab.core.binding.xml',\ - bnd.identity;id='org.openhab.core.thing.xml' + bnd.identity;id='org.openhab.core.thing.xml',\ + bnd.identity;id='org.eclipse.jdt.annotation' # We would like to use the "volatile" storage only -runblacklist: \ @@ -21,7 +22,6 @@ Fragment-Host: org.openhab.binding.hue org.osgi.service.event;version='[1.4.0,1.4.1)',\ org.hamcrest;version='[2.2.0,2.2.1)',\ org.opentest4j;version='[1.2.0,1.2.1)',\ - org.eclipse.jdt.annotation;version='[2.2.100,2.2.101)',\ com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\ jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\ org.apache.servicemix.specs.activation-api-1.2.1;version='[1.2.1,1.2.2)',\ @@ -79,4 +79,7 @@ Fragment-Host: org.openhab.binding.hue org.eclipse.jetty.websocket.common;version='[9.4.46,9.4.47)',\ org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ org.ops4j.pax.web.pax-web-api;version='[7.3.25,7.3.26)',\ - org.jupnp;version='[2.6.1,2.6.2)' + org.jupnp;version='[2.6.1,2.6.2)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)',\ + org.eclipse.jdt.annotation;version='[2.2.100,2.2.101)' diff --git a/itests/org.openhab.binding.max.tests/itest.bndrun b/itests/org.openhab.binding.max.tests/itest.bndrun index 34bca81f5..41e73a17e 100644 --- a/itests/org.openhab.binding.max.tests/itest.bndrun +++ b/itests/org.openhab.binding.max.tests/itest.bndrun @@ -66,4 +66,6 @@ Fragment-Host: org.openhab.binding.max org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.mielecloud.tests/itest.bndrun b/itests/org.openhab.binding.mielecloud.tests/itest.bndrun index d0782c6e6..6aedeead0 100644 --- a/itests/org.openhab.binding.mielecloud.tests/itest.bndrun +++ b/itests/org.openhab.binding.mielecloud.tests/itest.bndrun @@ -85,4 +85,6 @@ Fragment-Host: org.openhab.binding.mielecloud org.ops4j.pax.web.pax-web-api;version='[7.3.25,7.3.26)',\ org.ops4j.pax.web.pax-web-jetty;version='[7.3.25,7.3.26)',\ org.ops4j.pax.web.pax-web-runtime;version='[7.3.25,7.3.26)',\ - org.ops4j.pax.web.pax-web-spi;version='[7.3.25,7.3.26)' + org.ops4j.pax.web.pax-web-spi;version='[7.3.25,7.3.26)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.modbus.tests/itest.bndrun b/itests/org.openhab.binding.modbus.tests/itest.bndrun index 199cff7ae..b53c6b0fa 100644 --- a/itests/org.openhab.binding.modbus.tests/itest.bndrun +++ b/itests/org.openhab.binding.modbus.tests/itest.bndrun @@ -75,4 +75,6 @@ Fragment-Host: org.openhab.binding.modbus org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.mqtt.homeassistant.tests/itest.bndrun b/itests/org.openhab.binding.mqtt.homeassistant.tests/itest.bndrun index cd2239b2e..c7b79f2d8 100644 --- a/itests/org.openhab.binding.mqtt.homeassistant.tests/itest.bndrun +++ b/itests/org.openhab.binding.mqtt.homeassistant.tests/itest.bndrun @@ -109,4 +109,7 @@ Import-Package: \ org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)',\ + jakarta.ws.rs-api;version='[2.1.6,2.1.7)' diff --git a/itests/org.openhab.binding.mqtt.homie.tests/itest.bndrun b/itests/org.openhab.binding.mqtt.homie.tests/itest.bndrun index d2bc41421..9ac976218 100644 --- a/itests/org.openhab.binding.mqtt.homie.tests/itest.bndrun +++ b/itests/org.openhab.binding.mqtt.homie.tests/itest.bndrun @@ -109,5 +109,8 @@ Import-Package: \ org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)',\ + jakarta.ws.rs-api;version='[2.1.6,2.1.7)' diff --git a/itests/org.openhab.binding.nest.tests/itest.bndrun b/itests/org.openhab.binding.nest.tests/itest.bndrun index 0ee4d2744..8e6785a24 100644 --- a/itests/org.openhab.binding.nest.tests/itest.bndrun +++ b/itests/org.openhab.binding.nest.tests/itest.bndrun @@ -10,7 +10,8 @@ Fragment-Host: org.openhab.binding.nest # We would like to use the "volatile" storage only -runblacklist: \ - bnd.identity;id='org.openhab.core.storage.json' + bnd.identity;id='org.openhab.core.storage.json',\ + bnd.identity;id='jakarta.ws.rs-api' # # done @@ -104,4 +105,6 @@ Fragment-Host: org.openhab.binding.nest org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ org.ops4j.pax.web.pax-web-api;version='[7.3.25,7.3.26)',\ org.ops4j.pax.web.pax-web-jetty;version='[7.3.25,7.3.26)',\ - org.ops4j.pax.web.pax-web-spi;version='[7.3.25,7.3.26)' + org.ops4j.pax.web.pax-web-spi;version='[7.3.25,7.3.26)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.ntp.tests/itest.bndrun b/itests/org.openhab.binding.ntp.tests/itest.bndrun index 153108d0c..28b897208 100644 --- a/itests/org.openhab.binding.ntp.tests/itest.bndrun +++ b/itests/org.openhab.binding.ntp.tests/itest.bndrun @@ -70,4 +70,6 @@ Fragment-Host: org.openhab.binding.ntp org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.systeminfo.tests/itest.bndrun b/itests/org.openhab.binding.systeminfo.tests/itest.bndrun index 07d1c69b3..628987564 100644 --- a/itests/org.openhab.binding.systeminfo.tests/itest.bndrun +++ b/itests/org.openhab.binding.systeminfo.tests/itest.bndrun @@ -73,4 +73,6 @@ Fragment-Host: org.openhab.binding.systeminfo org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.tradfri.tests/itest.bndrun b/itests/org.openhab.binding.tradfri.tests/itest.bndrun index 6c2337eaa..eaffabca0 100644 --- a/itests/org.openhab.binding.tradfri.tests/itest.bndrun +++ b/itests/org.openhab.binding.tradfri.tests/itest.bndrun @@ -76,4 +76,6 @@ Fragment-Host: org.openhab.binding.tradfri org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.binding.wemo.tests/itest.bndrun b/itests/org.openhab.binding.wemo.tests/itest.bndrun index 575fc56ee..609e81fd6 100644 --- a/itests/org.openhab.binding.wemo.tests/itest.bndrun +++ b/itests/org.openhab.binding.wemo.tests/itest.bndrun @@ -83,4 +83,6 @@ Fragment-Host: org.openhab.binding.wemo org.eclipse.jetty.websocket.common;version='[9.4.46,9.4.47)',\ org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ org.ops4j.pax.web.pax-web-api;version='[7.3.25,7.3.26)',\ - org.jupnp;version='[2.6.1,2.6.2)' + org.jupnp;version='[2.6.1,2.6.2)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)' diff --git a/itests/org.openhab.persistence.mapdb.tests/itest.bndrun b/itests/org.openhab.persistence.mapdb.tests/itest.bndrun index 079aac391..407518896 100644 --- a/itests/org.openhab.persistence.mapdb.tests/itest.bndrun +++ b/itests/org.openhab.persistence.mapdb.tests/itest.bndrun @@ -57,4 +57,6 @@ Fragment-Host: org.openhab.persistence.mapdb org.eclipse.jetty.servlet;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util;version='[9.4.46,9.4.47)',\ org.eclipse.jetty.util.ajax;version='[9.4.46,9.4.47)',\ - org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)' + org.ops4j.pax.logging.pax-logging-api;version='[2.0.16,2.0.17)',\ + ch.qos.logback.classic;version='[1.2.11,1.2.12)',\ + ch.qos.logback.core;version='[1.2.11,1.2.12)'