Search in sources :

Example 11 with Device

use of org.osgi.service.device.Device in project felix by apache.

the class UtilTest method VerifyValidIsDeviceInstanceValidationThrowsException.

@Test
public void VerifyValidIsDeviceInstanceValidationThrowsException() throws InvalidSyntaxException {
    Properties p = new Properties();
    p.put(org.osgi.framework.Constants.OBJECTCLASS, new String[] { Device.class.getName() });
    ServiceReference ref = createReference(p);
    Assert.assertTrue("Incorrectly determined as no device", Util.isDeviceInstance(ref));
}
Also used : Device(org.osgi.service.device.Device) Properties(java.util.Properties) ServiceReference(org.osgi.framework.ServiceReference) Test(org.junit.Test)

Aggregations

Device (org.osgi.service.device.Device)11 Test (org.junit.Test)9 CountDownLatch (java.util.concurrent.CountDownLatch)8 Driver (org.osgi.service.device.Driver)6 DriverLocator (org.osgi.service.device.DriverLocator)5 ServiceReference (org.osgi.framework.ServiceReference)4 Properties (java.util.Properties)3 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 Answer (org.mockito.stubbing.Answer)3 Dictionary (java.util.Dictionary)2 BundleException (org.osgi.framework.BundleException)2 InputStream (java.io.InputStream)1 Ignore (org.junit.Ignore)1 Bundle (org.osgi.framework.Bundle)1 DriverSelector (org.osgi.service.device.DriverSelector)1