@Test public void removeDevice() throws Exception { boolean retValue = false; RegManager regmanager = new RegManager( this.context); dmCommManagerMock = mock(DmCommManager.class); when(commManagerMock.getIdManager()).thenReturn(identityManagerMock); when(identityManagerMock.getThisNetworkNode()).thenReturn(iNetworkNodeMock); regmanager.setCommManager(commManagerMock); DeviceRegistry registry = DeviceRegistry.getInstance(); registry.setCommManager(dmCommManagerMock); assertTrue(null != registry); registry.clearRegistry(); assertEquals(0, registry.registrySize()); try { retValue = regmanager.addDevice(device_1, CSSNodeID); assertTrue(retValue); retValue = regmanager.addDevice(device_2, CSSNodeID); assertTrue(retValue); retValue = regmanager.addDevice(device_3, CSSNodeID); assertTrue(retValue); retValue = regmanager.removeDevice(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_3, registry.findDevice(device_3.getDeviceID())); }
public boolean removeDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { LOG.info("+++ RegManager removeDevice called to remove device: " +device.getDeviceID()); return LocalDevices.removeDevice(device, CSSNodeID); }
RegManager implements ILocalDevice, Subscriber, BundleContextAware { public boolean removeDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { LOG.info("+++ RegManager removeDevice called to remove device: " +device.getDeviceID()); return LocalDevices.removeDevice(device, CSSNodeID); } }
RegManager implements ILocalDevice, Subscriber, BundleContextAware { public boolean removeDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { LOG.info("+++ RegManager removeDevice called to remove device: " +device.getDeviceID()); return LocalDevices.removeDevice(device, CSSNodeID); } RegManager();  RegManager(BundleContext bundlecontext); }
RegManager implements ILocalDevice, Subscriber, BundleContextAware { public boolean removeDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { LOG.info("+++ RegManager removeDevice called to remove device: " +device.getDeviceID()); return LocalDevices.removeDevice(device, CSSNodeID); } RegManager();  RegManager(BundleContext bundlecontext); boolean addDevice(DeviceCommonInfo device, String CSSNodeID); boolean addDevices(Collection<DeviceCommonInfo> deviceCollection, String CSSNodeID); boolean removeDevice(DeviceCommonInfo device, String CSSNodeID); boolean removeDevices(
            Collection<DeviceCommonInfo> deviceCollection, String CSSNodeID); boolean clearRegistry(); @Override void setBundleContext(BundleContext arg0); boolean removedevice(String deviceID, String CSSNodeID); PubsubClient getPubSubManager(); void setPubSubManager(PubsubClient pubSubManager); ICommManager getCommManager(); void setCommManager(ICommManager commManager); @Override void pubsubEvent(IIdentity pubsubService, String node, String itemId, Object payload); }
RegManager implements ILocalDevice, Subscriber, BundleContextAware { public boolean removeDevice(DeviceCommonInfo device, String CSSNodeID) throws Exception { LOG.info("+++ RegManager removeDevice called to remove device: " +device.getDeviceID()); return LocalDevices.removeDevice(device, CSSNodeID); } RegManager();  RegManager(BundleContext bundlecontext); boolean addDevice(DeviceCommonInfo device, String CSSNodeID); boolean addDevices(Collection<DeviceCommonInfo> deviceCollection, String CSSNodeID); boolean removeDevice(DeviceCommonInfo device, String CSSNodeID); boolean removeDevices(
            Collection<DeviceCommonInfo> deviceCollection, String CSSNodeID); boolean clearRegistry(); @Override void setBundleContext(BundleContext arg0); boolean removedevice(String deviceID, String CSSNodeID); PubsubClient getPubSubManager(); void setPubSubManager(PubsubClient pubSubManager); ICommManager getCommManager(); void setCommManager(ICommManager commManager); @Override void pubsubEvent(IIdentity pubsubService, String node, String itemId, Object payload);  }