Search in sources :

Example 6 with RemoteDevice

use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.

the class FSInternetRadioDiscoveryParticipantJavaTest method validDiscoveryResultIfWithoutBaseUrl.

/**
 * Verify valid DiscoveryResult with FSInterntRadio device without base URL.
 *
 * @throws ValidationException
 */
@SuppressWarnings("null")
@Test
public void validDiscoveryResultIfWithoutBaseUrl() throws ValidationException {
    RemoteDevice fsInternetRadioDeviceWithoutUrl = createDefaultFSInternetRadioDevice(null);
    final DiscoveryResult result = discoveryParticipant.createResult(fsInternetRadioDeviceWithoutUrl);
    assertEquals(new ThingUID(DEFAULT_RADIO_THING_UID), result.getThingUID());
    assertEquals(FSInternetRadioBindingConstants.THING_TYPE_RADIO, result.getThingTypeUID());
    assertEquals(DEFAULT_RADIO_MANIFACTURER, result.getProperties().get(FSInternetRadioBindingConstants.PROPERTY_MANUFACTURER));
    assertEquals(DEFAULT_RADIO_MODEL_NUMBER, result.getProperties().get(FSInternetRadioBindingConstants.PROPERTY_MODEL));
}
Also used : DiscoveryResult(org.eclipse.smarthome.config.discovery.DiscoveryResult) ThingUID(org.eclipse.smarthome.core.thing.ThingUID) RemoteDevice(org.jupnp.model.meta.RemoteDevice) Test(org.junit.Test)

Example 7 with RemoteDevice

use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.

the class FSInternetRadioDiscoveryParticipantJavaTest method createDefaultFSInternetRadioDevice.

private RemoteDevice createDefaultFSInternetRadioDevice(URL baseURL) throws ValidationException {
    ManufacturerDetails manifacturerDetails = new ManufacturerDetails(DEFAULT_RADIO_MANIFACTURER);
    ModelDetails modelDetails = new ModelDetails(DEFAULT_RADIO_MODEL_NAME, DEFAULT_RADIO_MODEL_DESCRIPTION, DEFAULT_RADIO_MODEL_NUMBER);
    DeviceDetails deviceDetails = new DeviceDetails(baseURL, DEFAULT_RADIO_NAME, manifacturerDetails, modelDetails, DEFAULT_RADIO_SERIAL_NUMBER, DEFAULT_UPC, DEFAULT_URI);
    final RemoteService remoteService = null;
    return new RemoteDevice(DEFAULT_RADIO_IDENTITY, DEFAULT_TYPE, deviceDetails, remoteService);
}
Also used : DeviceDetails(org.jupnp.model.meta.DeviceDetails) ModelDetails(org.jupnp.model.meta.ModelDetails) RemoteService(org.jupnp.model.meta.RemoteService) RemoteDevice(org.jupnp.model.meta.RemoteDevice) ManufacturerDetails(org.jupnp.model.meta.ManufacturerDetails)

Example 8 with RemoteDevice

use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.

the class FSInternetRadioDiscoveryParticipantJavaTest method validDiscoveryResultWithComplete.

/**
 * Verify valid DiscoveryResult with completeFSInterntRadioDevice.
 *
 * @throws ValidationException
 */
@SuppressWarnings("null")
@Test
public void validDiscoveryResultWithComplete() throws ValidationException {
    RemoteDevice completeFSInternetRadioDevice = createDefaultFSInternetRadioDevice(DEFAULT_RADIO_BASE_URL);
    final DiscoveryResult result = discoveryParticipant.createResult(completeFSInternetRadioDevice);
    assertEquals(new ThingUID(DEFAULT_RADIO_THING_UID), result.getThingUID());
    assertEquals(FSInternetRadioBindingConstants.THING_TYPE_RADIO, result.getThingTypeUID());
    assertEquals(DEFAULT_RADIO_MANIFACTURER, result.getProperties().get(FSInternetRadioBindingConstants.PROPERTY_MANUFACTURER));
    assertEquals(DEFAULT_RADIO_MODEL_NUMBER, result.getProperties().get(FSInternetRadioBindingConstants.PROPERTY_MODEL));
}
Also used : DiscoveryResult(org.eclipse.smarthome.config.discovery.DiscoveryResult) ThingUID(org.eclipse.smarthome.core.thing.ThingUID) RemoteDevice(org.jupnp.model.meta.RemoteDevice) Test(org.junit.Test)

Aggregations

RemoteDevice (org.jupnp.model.meta.RemoteDevice)8 Test (org.junit.Test)4 DeviceDetails (org.jupnp.model.meta.DeviceDetails)3 ManufacturerDetails (org.jupnp.model.meta.ManufacturerDetails)3 ModelDetails (org.jupnp.model.meta.ModelDetails)3 RemoteService (org.jupnp.model.meta.RemoteService)3 URL (java.net.URL)2 DiscoveryResult (org.eclipse.smarthome.config.discovery.DiscoveryResult)2 ThingUID (org.eclipse.smarthome.core.thing.ThingUID)2 RemoteDeviceIdentity (org.jupnp.model.meta.RemoteDeviceIdentity)2 UDN (org.jupnp.model.types.UDN)2 MalformedURLException (java.net.MalformedURLException)1 HueBridgeDiscoveryParticipant (org.eclipse.smarthome.binding.hue.internal.discovery.HueBridgeDiscoveryParticipant)1 UpnpDiscoveryParticipant (org.eclipse.smarthome.config.discovery.upnp.UpnpDiscoveryParticipant)1 Before (org.junit.Before)1 ValidationException (org.jupnp.model.ValidationException)1 DeviceType (org.jupnp.model.types.DeviceType)1