mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Reenable org.openhab.core.config.discovery.usbserial*.tests (#1065)
Fixes #698 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
committed by
Christoph Weitkamp
parent
eda0af1cd2
commit
807593aa94
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.openhab.core.config.discovery.usbserial.linuxsysfs.tests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -9,87 +9,37 @@ Fragment-Host: org.openhab.core.config.discovery.usbserial.linuxsysfs
|
||||
# done
|
||||
#
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.0,1.2.1)',\
|
||||
ch.qos.logback.core;version='[1.2.0,1.2.1)',\
|
||||
com.google.gson;version='[2.7.0,2.7.1)',\
|
||||
com.google.guava;version='[15.0.0,15.0.1)',\
|
||||
com.google.inject;version='[3.0.0,3.0.1)',\
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
joda-time;version='[2.9.2,2.9.3)',\
|
||||
log4j;version='[1.2.17,1.2.18)',\
|
||||
org.antlr.runtime;version='[3.2.0,3.2.1)',\
|
||||
net.bytebuddy.byte-buddy-agent;version='[1.9.7,1.9.8)',\
|
||||
net.bytebuddy.byte-buddy;version='[1.9.7,1.9.8)',\
|
||||
org.apache.commons.collections;version='[3.2.1,3.2.2)',\
|
||||
org.apache.commons.exec;version='[1.1.0,1.1.1)',\
|
||||
org.apache.commons.io;version='[2.2.0,2.2.1)',\
|
||||
org.apache.commons.lang;version='[2.6.0,2.6.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
org.apache.felix.scr;version='[2.1.10,2.1.11)',\
|
||||
org.apache.servicemix.bundles.commons-codec;version='[1.3.0,1.3.1)',\
|
||||
org.apache.servicemix.bundles.commons-httpclient;version='[3.1.0,3.1.1)',\
|
||||
org.apache.xbean.bundleutils;version='[4.6.0,4.6.1)',\
|
||||
org.apache.xbean.finder;version='[4.6.0,4.6.1)',\
|
||||
org.eclipse.emf.common;version='[2.12.0,2.12.1)',\
|
||||
org.eclipse.emf.ecore;version='[2.12.0,2.12.1)',\
|
||||
org.eclipse.emf.ecore.xmi;version='[2.12.0,2.12.1)',\
|
||||
org.eclipse.equinox.common;version='[3.8.0,3.8.1)',\
|
||||
org.apache.servicemix.specs.activation-api-1.1;version='[2.9.0,2.9.1)',\
|
||||
org.apache.servicemix.specs.annotation-api-1.3;version='[1.3.0,1.3.1)',\
|
||||
org.apache.servicemix.specs.jaxb-api-2.2;version='[2.9.0,2.9.1)',\
|
||||
org.apache.servicemix.specs.stax-api-1.2;version='[2.9.0,2.9.1)',\
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
org.eclipse.jetty.client;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.http;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.io;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.proxy;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.security;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.server;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.servlet;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.util;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.websocket.api;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.websocket.client;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.websocket.common;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.xml;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.xtend.lib;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtend.lib.macro;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.common.types;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.util;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.xbase;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.xbase.lib;version='[2.14.0,2.14.1)',\
|
||||
org.glassfish.hk2.external.aopalliance-repackaged;version='[2.4.0,2.4.1)',\
|
||||
org.glassfish.hk2.external.javax.inject;version='[2.4.0,2.4.1)',\
|
||||
org.objectweb.asm;version='[6.1.1,6.1.2)',\
|
||||
org.objectweb.asm.commons;version='[6.1.1,6.1.2)',\
|
||||
org.objectweb.asm.tree;version='[6.1.1,6.1.2)',\
|
||||
org.openhab.core.compat1x;version='[2.5.0,2.5.1)',\
|
||||
org.ops4j.pax.swissbox.optional.jcl;version='[1.8.2,1.8.3)',\
|
||||
org.ops4j.pax.web.pax-web-api;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-jetty;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-runtime;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-spi;version='[7.2.3,7.2.4)',\
|
||||
org.mockito.mockito-core;version='[2.25.0,2.25.1)',\
|
||||
org.objenesis;version='[2.6.0,2.6.1)',\
|
||||
org.openhab.core.config.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery.usbserial.linuxsysfs.tests;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery.usbserial.linuxsysfs;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery.usbserial;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.console;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.storage.json;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.thing;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core;version='[2.5.0,2.5.1)',\
|
||||
org.osgi.service.event;version='[1.4.0,1.4.1)',\
|
||||
slf4j.api;version='[1.7.21,1.7.22)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.2,1.0.3)',\
|
||||
tec.uom.se;version='[1.0.8,1.0.9)',\
|
||||
osgi.enroute.hamcrest.wrapper;version='[1.3.0,1.3.1)',\
|
||||
osgi.enroute.junit.wrapper;version='[4.12.0,4.12.1)',\
|
||||
org.openhab.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.audio;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.compat1x.tests;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.console;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.http;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.net;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.item;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.persistence;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.script;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.script.runtime;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.sitemap;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.persistence;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.scheduler;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.thing;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.transform;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.ui;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.voice;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.persistence.runtime;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.rule;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.model.thing;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.storage.json;version='[2.5.0,2.5.1)'
|
||||
slf4j.api;version='[1.7.25,1.7.26)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
tec.uom.se;version='[1.0.10,1.0.11)'
|
||||
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ import java.util.HashSet;
|
||||
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDeviceInformation;
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs.internal.DeltaUsbSerialScanner.Delta;
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.testutil.UsbSerialDeviceInformationGenerator;
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs.testutil.UsbSerialDeviceInformationGenerator;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class DeltaUsbSerialScannerTest {
|
||||
|
||||
UsbSerialDeviceInformationGenerator usbDeviceInfoGenerator = new UsbSerialDeviceInformationGenerator();
|
||||
private UsbSerialDeviceInformationGenerator usbDeviceInfoGenerator = new UsbSerialDeviceInformationGenerator();
|
||||
|
||||
private UsbSerialScanner usbSerialScanner;
|
||||
private DeltaUsbSerialScanner deltaUsbSerialScanner;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDeviceInformation;
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDiscoveryListener;
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.testutil.UsbSerialDeviceInformationGenerator;
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs.testutil.UsbSerialDeviceInformationGenerator;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2019 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs.testutil;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDeviceInformation;
|
||||
|
||||
/**
|
||||
* Generate simple instances of {@link UsbSerialDeviceInformation} that can be used in tests.
|
||||
*
|
||||
* @author Henning Sudbrock - Initial contribution
|
||||
*/
|
||||
public class UsbSerialDeviceInformationGenerator {
|
||||
|
||||
private final AtomicInteger counter = new AtomicInteger(0);
|
||||
|
||||
public UsbSerialDeviceInformation generate() {
|
||||
int i = counter.getAndIncrement();
|
||||
return new UsbSerialDeviceInformation(i, i, "serialNumber-" + i, "manufacturer-" + i, "product-" + i, i,
|
||||
"interface-" + i, "ttyUSB" + i);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,20 +5,29 @@ 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 the "PollingUsbSerialScanner" in tests
|
||||
# So make sure 'org.openhab.core.config.discovery.usbserial.linuxsysfs' is not in runbundles
|
||||
|
||||
#
|
||||
# done
|
||||
#
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.0,1.2.1)',\
|
||||
ch.qos.logback.core;version='[1.2.0,1.2.1)',\
|
||||
com.google.gson;version='[2.7.0,2.7.1)',\
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
net.bytebuddy.byte-buddy-agent;version='[1.9.7,1.9.8)',\
|
||||
net.bytebuddy.byte-buddy;version='[1.9.7,1.9.8)',\
|
||||
org.apache.commons.collections;version='[3.2.1,3.2.2)',\
|
||||
org.apache.commons.io;version='[2.2.0,2.2.1)',\
|
||||
org.apache.commons.lang;version='[2.6.0,2.6.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
org.apache.felix.scr;version='[2.1.10,2.1.11)',\
|
||||
org.apache.servicemix.specs.activation-api-1.1;version='[2.9.0,2.9.1)',\
|
||||
org.apache.servicemix.specs.annotation-api-1.3;version='[1.3.0,1.3.1)',\
|
||||
org.apache.servicemix.specs.jaxb-api-2.2;version='[2.9.0,2.9.1)',\
|
||||
org.apache.servicemix.specs.stax-api-1.2;version='[2.9.0,2.9.1)',\
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
org.eclipse.jetty.http;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.io;version='[9.4.11,9.4.12)',\
|
||||
@@ -26,22 +35,21 @@ Fragment-Host: org.openhab.core.config.discovery.usbserial
|
||||
org.eclipse.jetty.server;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.servlet;version='[9.4.11,9.4.12)',\
|
||||
org.eclipse.jetty.util;version='[9.4.11,9.4.12)',\
|
||||
org.osgi.service.event;version='[1.4.0,1.4.1)',\
|
||||
slf4j.api;version='[1.7.21,1.7.22)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.2,1.0.3)',\
|
||||
tec.uom.se;version='[1.0.8,1.0.9)',\
|
||||
osgi.enroute.hamcrest.wrapper;version='[1.3.0,1.3.1)',\
|
||||
osgi.enroute.junit.wrapper;version='[4.12.0,4.12.1)',\
|
||||
org.openhab.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.console;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.thing;version='[2.5.0,2.5.1)',\
|
||||
net.bytebuddy.byte-buddy;version='[1.7.9,1.7.10)',\
|
||||
net.bytebuddy.byte-buddy-agent;version='[1.7.9,1.7.10)',\
|
||||
org.mockito.mockito-core;version='[2.25.0,2.25.1)',\
|
||||
org.objenesis;version='[2.6.0,2.6.1)',\
|
||||
org.openhab.core.config.discovery;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery.usbserial;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery.usbserial.linuxsysfs;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery.usbserial.tests;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.test;version='[2.5.0,2.5.1)'
|
||||
org.openhab.core.config.discovery.usbserial;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.discovery;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.console;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.storage.json;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.test;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.thing;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core;version='[2.5.0,2.5.1)',\
|
||||
org.osgi.service.event;version='[1.4.0,1.4.1)',\
|
||||
osgi.enroute.hamcrest.wrapper;version='[1.3.0,1.3.1)',\
|
||||
osgi.enroute.junit.wrapper;version='[4.12.0,4.12.1)',\
|
||||
slf4j.api;version='[1.7.25,1.7.26)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
tec.uom.se;version='[1.0.10,1.0.11)'
|
||||
|
||||
|
||||
+2
-3
@@ -18,7 +18,7 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.collection.IsEmptyCollection.empty;
|
||||
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -148,8 +148,7 @@ public class UsbSerialDiscoveryServiceTest extends JavaOSGiTest {
|
||||
assertThat(actualDiscoveryResultA.getProperties(),
|
||||
is(createUsbPropertiesMap(discoveryResultA.getProperties(), deviceInfoA)));
|
||||
reset(discoveryListener);
|
||||
|
||||
|
||||
|
||||
// when only the second discovery participant supports a newly discovered device, the device is also discovered
|
||||
UsbSerialDeviceInformation deviceInfoB = generateDeviceInfo();
|
||||
DiscoveryResult discoveryResultB = mock(DiscoveryResult.class);
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
<module>org.openhab.core.config.core.tests</module>
|
||||
<module>org.openhab.core.config.discovery.mdns.tests</module>
|
||||
<module>org.openhab.core.config.discovery.tests</module>
|
||||
<!-- <module>org.openhab.core.config.discovery.usbserial.tests</module> -->
|
||||
<module>org.openhab.core.config.discovery.usbserial.tests</module>
|
||||
<module>org.openhab.core.config.dispatch.tests</module>
|
||||
<module>org.openhab.core.config.xml.tests</module>
|
||||
<module>org.openhab.core.io.http.tests</module>
|
||||
@@ -107,7 +107,7 @@
|
||||
</os>
|
||||
</activation>
|
||||
<modules>
|
||||
<!-- <module>org.openhab.core.config.discovery.usbserial.linuxsysfs.tests</module> -->
|
||||
<module>org.openhab.core.config.discovery.usbserial.linuxsysfs.tests</module>
|
||||
</modules>
|
||||
</profile>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user