From 0abf99405872ed65498e6fb59b1ff7d6460d722f Mon Sep 17 00:00:00 2001 From: Markus Rathgeb Date: Sun, 17 Nov 2019 16:20:24 +0100 Subject: [PATCH] use mock instead of real service implementation (#1221) Signed-off-by: Markus Rathgeb --- .../itest.bndrun | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/itests/org.openhab.core.config.discovery.usbserial.tests/itest.bndrun b/itests/org.openhab.core.config.discovery.usbserial.tests/itest.bndrun index 32a7465ae2a..638aaf59ff0 100644 --- a/itests/org.openhab.core.config.discovery.usbserial.tests/itest.bndrun +++ b/itests/org.openhab.core.config.discovery.usbserial.tests/itest.bndrun @@ -3,10 +3,17 @@ Bundle-SymbolicName: ${project.artifactId} Fragment-Host: org.openhab.core.config.discovery.usbserial --runrequires: bnd.identity;id='org.openhab.core.config.discovery.usbserial.tests' +# We would like to use a mock instead of a real "UsbSerialDiscovery" service +# implementation like the "PollingUsbSerialScanner" provided by the linuxsysfs bundle. +# Add the capability that we provide / mock such a service and +# additionally blacklist the linuxsysfs bundle to ensure our one is preferred. + +Provide-Capability: \ + osgi.service;objectClass:List="org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDiscovery" +-runblacklist: \ + bnd.identity;id='org.openhab.core.config.discovery.usbserial.linuxsysfs' -# We would like to use a mock instead of the "PollingUsbSerialScanner" in tests -# So make sure 'org.openhab.core.config.discovery.usbserial.linuxsysfs' is not in runbundles +-runrequires: bnd.identity;id='org.openhab.core.config.discovery.usbserial.tests' # # done