protected void readDevice(String invalidXMLFile, UpnpService upnpService) throws Exception { RemoteDevice device = new RemoteDevice(SampleData.createRemoteDeviceIdentity()); upnpService .getConfiguration() .getDeviceDescriptorBinderUDA10() .describe(device, IO.readLines(getClass().getResourceAsStream(invalidXMLFile))); }
public LocalDevice createTestDevice(Class serviceClass) throws Exception { LocalServiceBinder binder = new AnnotationLocalServiceBinder(); LocalService svc = binder.read(serviceClass); svc.setManager(new DefaultServiceManager(svc, serviceClass)); return new LocalDevice( SampleData.createLocalDeviceIdentity(), new DeviceType("mydomain", "CustomDevice", 1), new DeviceDetails("A Custom Device"), svc); }