@Test public void testLookupNodeExisting() throws Exception { MasterServer mockMaster = mock(MasterServer.class); final GraphName nodeName = GraphName.of("/foo"); final URI nodeSlaveUri = new URI("http: when(mockMaster.lookupNode(eq(nodeName))).thenReturn(nodeSlaveUri); MasterXmlRpcEndpointImpl master = new MasterXmlRpcEndpointImpl(mockMaster); List<Object> response = master.lookupNode("/caller", nodeName.toString()); assertEquals(StatusCode.SUCCESS.toInt(), response.get(0)); assertEquals(nodeSlaveUri.toString(), response.get(2)); }
@Override public List<Object> lookupNode(String callerId, String nodeName) { URI nodeSlaveUri = master.lookupNode(GraphName.of(nodeName)); if (nodeSlaveUri != null) { return Response.newSuccess("Success", nodeSlaveUri.toString()).toList(); } else { return Response.newError("No such node", null).toList(); } }
MasterXmlRpcEndpointImpl implements MasterXmlRpcEndpoint,
    ParameterServerXmlRpcEndpoint { @Override public List<Object> lookupNode(String callerId, String nodeName) { URI nodeSlaveUri = master.lookupNode(GraphName.of(nodeName)); if (nodeSlaveUri != null) { return Response.newSuccess("Success", nodeSlaveUri.toString()).toList(); } else { return Response.newError("No such node", null).toList(); } } }
MasterXmlRpcEndpointImpl implements MasterXmlRpcEndpoint,
    ParameterServerXmlRpcEndpoint { @Override public List<Object> lookupNode(String callerId, String nodeName) { URI nodeSlaveUri = master.lookupNode(GraphName.of(nodeName)); if (nodeSlaveUri != null) { return Response.newSuccess("Success", nodeSlaveUri.toString()).toList(); } else { return Response.newError("No such node", null).toList(); } } MasterXmlRpcEndpointImpl(MasterServer master); }
MasterXmlRpcEndpointImpl implements MasterXmlRpcEndpoint,
    ParameterServerXmlRpcEndpoint { @Override public List<Object> lookupNode(String callerId, String nodeName) { URI nodeSlaveUri = master.lookupNode(GraphName.of(nodeName)); if (nodeSlaveUri != null) { return Response.newSuccess("Success", nodeSlaveUri.toString()).toList(); } else { return Response.newError("No such node", null).toList(); } } MasterXmlRpcEndpointImpl(MasterServer master); @Override List<Object> getPid(String callerId); @Override List<Object> getPublishedTopics(String callerId, String subgraph); @Override List<Object> getTopicTypes(String callerId); @Override List<Object> getSystemState(String callerId); @Override List<Object> getUri(String callerId); @Override List<Object> lookupNode(String callerId, String nodeName); @Override List<Object> registerPublisher(String callerId, String topicName, String topicMessageType,
      String callerSlaveUri); @Override List<Object> unregisterPublisher(String callerId, String topicName, String callerSlaveUri); @Override List<Object> registerSubscriber(String callerId, String topicName,
      String topicMessageType, String callerSlaveUri); @Override List<Object> unregisterSubscriber(String callerId, String topicName, String callerSlaveUri); @Override List<Object> lookupService(String callerId, String serviceName); @Override List<Object> registerService(String callerId, String serviceName, String serviceUri,
      String callerSlaveUri); @Override List<Object> unregisterService(String callerId, String serviceName, String serviceUri); @Override List<Object> setParam(String callerId, String key, Boolean value); @Override List<Object> setParam(String callerId, String key, Integer value); @Override List<Object> setParam(String callerId, String key, Double value); @Override List<Object> setParam(String callerId, String key, String value); @Override List<Object> setParam(String callerId, String key, List<?> value); @Override List<Object> setParam(String callerId, String key, Map<?, ?> value); @Override List<Object> getParam(String callerId, String key); @Override List<Object> searchParam(String callerId, String key); @Override List<Object> subscribeParam(String callerId, String callerSlaveUri, String key); @Override List<Object> unsubscribeParam(String callerId, String callerSlaveUri, String key); @Override List<Object> deleteParam(String callerId, String key); @Override List<Object> hasParam(String callerId, String key); @Override List<Object> getParamNames(String callerId); }
MasterXmlRpcEndpointImpl implements MasterXmlRpcEndpoint,
    ParameterServerXmlRpcEndpoint { @Override public List<Object> lookupNode(String callerId, String nodeName) { URI nodeSlaveUri = master.lookupNode(GraphName.of(nodeName)); if (nodeSlaveUri != null) { return Response.newSuccess("Success", nodeSlaveUri.toString()).toList(); } else { return Response.newError("No such node", null).toList(); } } MasterXmlRpcEndpointImpl(MasterServer master); @Override List<Object> getPid(String callerId); @Override List<Object> getPublishedTopics(String callerId, String subgraph); @Override List<Object> getTopicTypes(String callerId); @Override List<Object> getSystemState(String callerId); @Override List<Object> getUri(String callerId); @Override List<Object> lookupNode(String callerId, String nodeName); @Override List<Object> registerPublisher(String callerId, String topicName, String topicMessageType,
      String callerSlaveUri); @Override List<Object> unregisterPublisher(String callerId, String topicName, String callerSlaveUri); @Override List<Object> registerSubscriber(String callerId, String topicName,
      String topicMessageType, String callerSlaveUri); @Override List<Object> unregisterSubscriber(String callerId, String topicName, String callerSlaveUri); @Override List<Object> lookupService(String callerId, String serviceName); @Override List<Object> registerService(String callerId, String serviceName, String serviceUri,
      String callerSlaveUri); @Override List<Object> unregisterService(String callerId, String serviceName, String serviceUri); @Override List<Object> setParam(String callerId, String key, Boolean value); @Override List<Object> setParam(String callerId, String key, Integer value); @Override List<Object> setParam(String callerId, String key, Double value); @Override List<Object> setParam(String callerId, String key, String value); @Override List<Object> setParam(String callerId, String key, List<?> value); @Override List<Object> setParam(String callerId, String key, Map<?, ?> value); @Override List<Object> getParam(String callerId, String key); @Override List<Object> searchParam(String callerId, String key); @Override List<Object> subscribeParam(String callerId, String callerSlaveUri, String key); @Override List<Object> unsubscribeParam(String callerId, String callerSlaveUri, String key); @Override List<Object> deleteParam(String callerId, String key); @Override List<Object> hasParam(String callerId, String key); @Override List<Object> getParamNames(String callerId);  }