Skip to content

Commit

Permalink
use mock instead of real service implementation (#1221)
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Rathgeb <[email protected]>
  • Loading branch information
maggu2810 authored and wborn committed Nov 17, 2019
1 parent d51d6d2 commit 0abf994
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>="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
Expand Down

0 comments on commit 0abf994

Please sign in to comment.