Search in sources :

Example 1 with SimpleDiscoveryListener

use of org.eclipse.smarthome.binding.homematic.test.util.SimpleDiscoveryListener in project smarthome by eclipse.

the class HomematicDeviceDiscoveryServiceTest method testDiscoveryResultIsReportedForNewDevice.

@Test
public void testDiscoveryResultIsReportedForNewDevice() {
    SimpleDiscoveryListener discoveryListener = new SimpleDiscoveryListener();
    homematicDeviceDiscoveryService.addDiscoveryListener(discoveryListener);
    HmDevice hmDevice = createDimmerHmDevice();
    homematicDeviceDiscoveryService.deviceDiscovered(hmDevice);
    assertThat(discoveryListener.discoveredResults.size(), is(1));
    discoveryResultMatchesHmDevice(discoveryListener.discoveredResults.element(), hmDevice);
}
Also used : HmDevice(org.eclipse.smarthome.binding.homematic.internal.model.HmDevice) DimmerHelper.createDimmerHmDevice(org.eclipse.smarthome.binding.homematic.test.util.DimmerHelper.createDimmerHmDevice) SimpleDiscoveryListener(org.eclipse.smarthome.binding.homematic.test.util.SimpleDiscoveryListener) Test(org.junit.Test) JavaTest(org.eclipse.smarthome.test.java.JavaTest)

Aggregations

HmDevice (org.eclipse.smarthome.binding.homematic.internal.model.HmDevice)1 DimmerHelper.createDimmerHmDevice (org.eclipse.smarthome.binding.homematic.test.util.DimmerHelper.createDimmerHmDevice)1 SimpleDiscoveryListener (org.eclipse.smarthome.binding.homematic.test.util.SimpleDiscoveryListener)1 JavaTest (org.eclipse.smarthome.test.java.JavaTest)1 Test (org.junit.Test)1