@Test public void isDiscovered() throws Exception { System.out.println("--- " + Thread.currentThread().getStackTrace()[1].getMethodName()); ZigBeeNode node = new ZigBeeNode(getMocketNetworkManager(), new IeeeAddress("1234567890")); ZigBeeNetworkEndpointListener listener = Mockito.mock(ZigBeeNetworkEndpointListener.class); node.addNetworkEndpointListener(listener); assertFalse(node.isDiscovered()); assertNotNull(node.getEndpoints()); NodeDescriptor descriptor = new NodeDescriptor(0, 3333, 74, true, 6666, 0, 6, 4444, true, 8); node.setNodeDescriptor(descriptor); assertFalse(node.isDiscovered()); ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, 1); node.addEndpoint(endpoint); assertTrue(node.isDiscovered()); Mockito.verify(listener, Mockito.timeout(TIMEOUT)).deviceAdded(endpoint); assertEquals(endpoint, node.getEndpoint(1)); assertEquals(1, node.getEndpoints().size()); node.removeEndpoint(1); assertEquals(0, node.getEndpoints().size()); Mockito.verify(listener, Mockito.timeout(TIMEOUT)).deviceRemoved(endpoint); node.removeNetworkEndpointListener(listener); }
public boolean isDiscovered() { return nodeDescriptor != null && nodeDescriptor.getLogicalType() != LogicalType.UNKNOWN && endpoints.size() != 0; }
ZigBeeNode { public boolean isDiscovered() { return nodeDescriptor != null && nodeDescriptor.getLogicalType() != LogicalType.UNKNOWN && endpoints.size() != 0; } }
ZigBeeNode { public boolean isDiscovered() { return nodeDescriptor != null && nodeDescriptor.getLogicalType() != LogicalType.UNKNOWN && endpoints.size() != 0; } ZigBeeNode(ZigBeeNetworkManager networkManager, IeeeAddress ieeeAddress);  ZigBeeNode(ZigBeeNetworkManager networkManager, IeeeAddress ieeeAddress, Integer networkAddress); }
ZigBeeNode { public boolean isDiscovered() { return nodeDescriptor != null && nodeDescriptor.getLogicalType() != LogicalType.UNKNOWN && endpoints.size() != 0; } ZigBeeNode(ZigBeeNetworkManager networkManager, IeeeAddress ieeeAddress);  ZigBeeNode(ZigBeeNetworkManager networkManager, IeeeAddress ieeeAddress, Integer networkAddress); void shutdown(); IeeeAddress getIeeeAddress(); boolean setNetworkAddress(Integer networkAddress); Integer getNetworkAddress(); void setNodeDescriptor(NodeDescriptor nodeDescriptor); NodeDescriptor getNodeDescriptor(); void setPowerDescriptor(PowerDescriptor powerDescriptor); PowerDescriptor getPowerDescriptor(); void permitJoin(final int duration); void permitJoin(final boolean enable); @Deprecated boolean isFullFuntionDevice(); boolean isFullFunctionDevice(); @Deprecated boolean isReducedFuntionDevice(); boolean isReducedFunctionDevice(); boolean isSecurityCapable(); boolean isPrimaryTrustCenter(); LogicalType getLogicalType(); Set<BindingTable> getBindingTable(); Future<ZigBeeStatus> updateBindingTable(); Collection<ZigBeeEndpoint> getEndpoints(); ZigBeeEndpoint getEndpoint(final int endpointId); void addEndpoint(final ZigBeeEndpoint endpoint); void updateEndpoint(final ZigBeeEndpoint endpoint); void removeEndpoint(final int endpointId); void addNetworkEndpointListener(final ZigBeeNetworkEndpointListener networkDeviceListener); void removeNetworkEndpointListener(final ZigBeeNetworkEndpointListener networkDeviceListener); Set<NeighborTable> getNeighbors(); boolean setNeighbors(Set<NeighborTable> neighbors); Set<Integer> getAssociatedDevices(); boolean setAssociatedDevices(Set<Integer> associatedDevices); Collection<RoutingTable> getRoutes(); boolean setRoutes(Set<RoutingTable> routes); void setLastUpdateTime(); Date getLastUpdateTime(); void commandReceived(ZigBeeCommand command, Integer rssi, Integer lqi); boolean isDiscovered(); ZigBeeNodeDao getDao(); void setDao(ZigBeeNodeDao dao); void sendTransaction(ZigBeeCommand command); Future<CommandResult> sendTransaction(ZigBeeCommand command, ZigBeeTransactionMatcher responseMatcher); boolean setNodeState(ZigBeeNodeState state); ZigBeeNodeState getNodeState(); NotificationService getNotificationService(); ZigBeeLinkQualityStatistics getLinkQualityStatistics(); @Override String toString(); }
ZigBeeNode { public boolean isDiscovered() { return nodeDescriptor != null && nodeDescriptor.getLogicalType() != LogicalType.UNKNOWN && endpoints.size() != 0; } ZigBeeNode(ZigBeeNetworkManager networkManager, IeeeAddress ieeeAddress);  ZigBeeNode(ZigBeeNetworkManager networkManager, IeeeAddress ieeeAddress, Integer networkAddress); void shutdown(); IeeeAddress getIeeeAddress(); boolean setNetworkAddress(Integer networkAddress); Integer getNetworkAddress(); void setNodeDescriptor(NodeDescriptor nodeDescriptor); NodeDescriptor getNodeDescriptor(); void setPowerDescriptor(PowerDescriptor powerDescriptor); PowerDescriptor getPowerDescriptor(); void permitJoin(final int duration); void permitJoin(final boolean enable); @Deprecated boolean isFullFuntionDevice(); boolean isFullFunctionDevice(); @Deprecated boolean isReducedFuntionDevice(); boolean isReducedFunctionDevice(); boolean isSecurityCapable(); boolean isPrimaryTrustCenter(); LogicalType getLogicalType(); Set<BindingTable> getBindingTable(); Future<ZigBeeStatus> updateBindingTable(); Collection<ZigBeeEndpoint> getEndpoints(); ZigBeeEndpoint getEndpoint(final int endpointId); void addEndpoint(final ZigBeeEndpoint endpoint); void updateEndpoint(final ZigBeeEndpoint endpoint); void removeEndpoint(final int endpointId); void addNetworkEndpointListener(final ZigBeeNetworkEndpointListener networkDeviceListener); void removeNetworkEndpointListener(final ZigBeeNetworkEndpointListener networkDeviceListener); Set<NeighborTable> getNeighbors(); boolean setNeighbors(Set<NeighborTable> neighbors); Set<Integer> getAssociatedDevices(); boolean setAssociatedDevices(Set<Integer> associatedDevices); Collection<RoutingTable> getRoutes(); boolean setRoutes(Set<RoutingTable> routes); void setLastUpdateTime(); Date getLastUpdateTime(); void commandReceived(ZigBeeCommand command, Integer rssi, Integer lqi); boolean isDiscovered(); ZigBeeNodeDao getDao(); void setDao(ZigBeeNodeDao dao); void sendTransaction(ZigBeeCommand command); Future<CommandResult> sendTransaction(ZigBeeCommand command, ZigBeeTransactionMatcher responseMatcher); boolean setNodeState(ZigBeeNodeState state); ZigBeeNodeState getNodeState(); NotificationService getNotificationService(); ZigBeeLinkQualityStatistics getLinkQualityStatistics(); @Override String toString();  }