/** * Sets the host reference using an URI string. * * @param hostUri * The host URI. * @see Request#setHostRef(String) */ public void setHostRef(String hostUri) { getRequest().setHostRef(hostUri); }
/** * Sets the host reference. * * @param hostRef * The host reference. * @see Request#setHostRef(Reference) */ public void setHostRef(Reference hostRef) { getRequest().setHostRef(hostRef); }
/** * Sets the host reference. * * @param hostRef * The host reference. */ @Override public void setHostRef(Reference hostRef) { getWrappedRequest().setHostRef(hostRef); }
/** * Sets the host reference using an URI string. * * @param hostUri * The host URI. */ @Override public void setHostRef(String hostUri) { getWrappedRequest().setHostRef(hostUri); }
/** * Sets the host reference using an URI string. Note that when used with * HTTP connectors, this property maps to the "Host" header. * * @param hostUri * The host URI. */ public void setHostRef(String hostUri) { setHostRef(new Reference(hostUri)); }
/** * Unit test for virtual hosts. * * @throws Exception */ public void testVirtualHost() throws Exception { // Instantiate our Restlet component MailServerComponent component = new MailServerComponent(); // Prepare a mock HTTP call Request request = new Request(); request.setMethod(Method.GET); request.setResourceRef("http://www.rmep.org/accounts/"); request.setHostRef("http://www.rmep.org"); Response response = new Response(request); response.getServerInfo().setAddress("1.2.3.10"); response.getServerInfo().setPort(80); component.handle(request, response); // Test if response was successful assertTrue(response.getStatus().isSuccess()); }