@Test public void findDevice() throws Exception{ registry.setCommManager(dmCommManagerMock); String result1 = registry.addDevice(device_1, CSSNodeID); assertTrue(null != result1); String result2 = registry.addDevice(device_2, CSSNodeID); assertTrue(null != result2); String result3 = registry.addDevice(device_3, CSSNodeID); assertTrue(null != result3); assertEquals(3, registry.registrySize()); DeviceCommonInfo retrievedevice = registry.findDevice(deviceId2); System.out.println("retrievedevice ID is = " + retrievedevice.getDeviceID()); System.out.println("retrievedevice Name is = " + retrievedevice.getDeviceName()); System.out.println("retrievedevice Type is = " + retrievedevice.getDeviceType()); System.out.println("retrievedevice Description is = " + retrievedevice.getDeviceDescription()); assertTrue(null != retrievedevice); assertTrue(retrievedevice instanceof DeviceCommonInfo); }
public DeviceCommonInfo findDevice(String deviceID) { DeviceCommonInfo device = null; LOG.info("+++ DeviceRegistry findDevice method has been called looking for: " +deviceID); String key = deviceID; if (registry.containsKey(key)) { device = registry.get(key); } return device; }
DeviceRegistry implements IDeviceRegistry { public DeviceCommonInfo findDevice(String deviceID) { DeviceCommonInfo device = null; LOG.info("+++ DeviceRegistry findDevice method has been called looking for: " +deviceID); String key = deviceID; if (registry.containsKey(key)) { device = registry.get(key); } return device; } }
DeviceRegistry implements IDeviceRegistry { public DeviceCommonInfo findDevice(String deviceID) { DeviceCommonInfo device = null; LOG.info("+++ DeviceRegistry findDevice method has been called looking for: " +deviceID); String key = deviceID; if (registry.containsKey(key)) { device = registry.get(key); } return device; } private  DeviceRegistry(); }
DeviceRegistry implements IDeviceRegistry { public DeviceCommonInfo findDevice(String deviceID) { DeviceCommonInfo device = null; LOG.info("+++ DeviceRegistry findDevice method has been called looking for: " +deviceID); String key = deviceID; if (registry.containsKey(key)) { device = registry.get(key); } return device; } private  DeviceRegistry(); static DeviceRegistry getInstance(); Collection<DeviceCommonInfo> findAllDevices(); Collection<DeviceCommonInfo> findByDeviceType(String deviceType); DeviceCommonInfo findDevice(String deviceID); boolean unregisterDevice(String deviceID); void clearRegistry(); int registrySize(); String addDevice(DeviceCommonInfo device, String CSSNodeID); boolean deleteDevice(DeviceCommonInfo device, String CSSNodeID); Collection<Object> getDeviceList(Object deviceID); void fireNewDeviceConnected(String deviceID,
			DeviceCommonInfo deviceCommonInfo); void fireDeviceDisconnected(String deviceID,
			DeviceCommonInfo deviceCommonInfo); void fireDeviceDataChanged(String deviceId,
			DeviceCommonInfo deviceCommonInfo, String key, String value); DmCommManager getdmCommManager(); void setCommManager(DmCommManager dmCommManager); }
DeviceRegistry implements IDeviceRegistry { public DeviceCommonInfo findDevice(String deviceID) { DeviceCommonInfo device = null; LOG.info("+++ DeviceRegistry findDevice method has been called looking for: " +deviceID); String key = deviceID; if (registry.containsKey(key)) { device = registry.get(key); } return device; } private  DeviceRegistry(); static DeviceRegistry getInstance(); Collection<DeviceCommonInfo> findAllDevices(); Collection<DeviceCommonInfo> findByDeviceType(String deviceType); DeviceCommonInfo findDevice(String deviceID); boolean unregisterDevice(String deviceID); void clearRegistry(); int registrySize(); String addDevice(DeviceCommonInfo device, String CSSNodeID); boolean deleteDevice(DeviceCommonInfo device, String CSSNodeID); Collection<Object> getDeviceList(Object deviceID); void fireNewDeviceConnected(String deviceID,
			DeviceCommonInfo deviceCommonInfo); void fireDeviceDisconnected(String deviceID,
			DeviceCommonInfo deviceCommonInfo); void fireDeviceDataChanged(String deviceId,
			DeviceCommonInfo deviceCommonInfo, String key, String value); DmCommManager getdmCommManager(); void setCommManager(DmCommManager dmCommManager);  }