RCodeComponent extends DefaultComponent { @Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { RCodeConfiguration newConfiguration; if (null == configuration) { newConfiguration = new RCodeConfiguration(new URI(uri)); } else { newConfiguration = configuration.copy(); } String operation = remaining.substring(remaining.indexOf('/') + 1); RCodeOperation rCodeOperation = RCodeOperation.valueOf(operation.toUpperCase()); RCodeEndpoint endpoint = new RCodeEndpoint(uri, this, newConfiguration, rCodeOperation); setProperties(endpoint.getConfiguration(), parameters); return endpoint; }  RCodeConfiguration getConfiguration(); void setConfiguration(RCodeConfiguration configuration); String getHost(); void setHost(String host); int getPort(); void setPort(int port); String getUser(); void setUser(String user); String getPassword(); void setPassword(String password); long getBufferSize(); void setBufferSize(long bufferSize);  }
@Test public void testRCodeComponentCreateEndpoint() throws Exception { Map<String, Object> params = createParameters(); String uri = "rcode: Endpoint endpoint = component.createEndpoint(uri, "/eval", params); assertNotNull(endpoint); assertEquals(uri, endpoint.getEndpointUri()); assertEquals(params.get("user"), endpoint.getEndpointConfiguration().getParameter("user")); assertEquals(params.get("password"), endpoint.getEndpointConfiguration().getParameter("password")); assertEquals(params.get("bufferSize"), endpoint.getEndpointConfiguration().getParameter("bufferSize")); }