@Test public void testLocalAddDevice() throws Exception { boolean retValue = false; RegManager regmanager = new RegManager( this.context); DeviceRegistry registry = DeviceRegistry.getInstance(); assertTrue(null != registry); registry.clearRegistry(); assertEquals(0, registry.registrySize()); try { retValue = LocalDevices.addDevice(device_1, CSSNodeID); assertTrue(retValue); retValue = LocalDevices.addDevice(device_2, CSSNodeID); assertTrue(retValue); } catch (Exception e) { e.printStackTrace(); } assertEquals(2, registry.registrySize()); assertEquals(2, registry.findAllDevices().size()); assertEquals(2, registry.registrySize()); assertEquals(2, registry.findAllDevices().size()); assertEquals(device_1, registry.findDevice(device_1.getDeviceID())); assertEquals(device_2, registry.findDevice(device_2.getDeviceID())); }
static boolean addDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { boolean retValue = false; LOG.info("+++ LocalDevices addDevice method has been called for: " +device.getDeviceID()); IDeviceRegistry deviceRegistry = DeviceRegistry.getInstance(); if (null != deviceRegistry) { if (null != deviceRegistry.addDevice(device, CSSNodeID)) { retValue = true; } } else { throw new Exception("No Device Registry available"); } return retValue; }
LocalDevices { static boolean addDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { boolean retValue = false; LOG.info("+++ LocalDevices addDevice method has been called for: " +device.getDeviceID()); IDeviceRegistry deviceRegistry = DeviceRegistry.getInstance(); if (null != deviceRegistry) { if (null != deviceRegistry.addDevice(device, CSSNodeID)) { retValue = true; } } else { throw new Exception("No Device Registry available"); } return retValue; } }
LocalDevices { static boolean addDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { boolean retValue = false; LOG.info("+++ LocalDevices addDevice method has been called for: " +device.getDeviceID()); IDeviceRegistry deviceRegistry = DeviceRegistry.getInstance(); if (null != deviceRegistry) { if (null != deviceRegistry.addDevice(device, CSSNodeID)) { retValue = true; } } else { throw new Exception("No Device Registry available"); } return retValue; }  }
LocalDevices { static boolean addDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { boolean retValue = false; LOG.info("+++ LocalDevices addDevice method has been called for: " +device.getDeviceID()); IDeviceRegistry deviceRegistry = DeviceRegistry.getInstance(); if (null != deviceRegistry) { if (null != deviceRegistry.addDevice(device, CSSNodeID)) { retValue = true; } } else { throw new Exception("No Device Registry available"); } return retValue; }   }
LocalDevices { static boolean addDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { boolean retValue = false; LOG.info("+++ LocalDevices addDevice method has been called for: " +device.getDeviceID()); IDeviceRegistry deviceRegistry = DeviceRegistry.getInstance(); if (null != deviceRegistry) { if (null != deviceRegistry.addDevice(device, CSSNodeID)) { retValue = true; } } else { throw new Exception("No Device Registry available"); } return retValue; }    }