int port = this.localServer.getServicePort();
String host = "localhost";
UriListeningService listener = new UriListeningService();
this.localServer.register("*", listener);
DefaultHttpClient client = new DefaultHttpClient();
HttpResponse response;
if(!relative) {
String request = "http://" + host + ":" + port + uri;
HttpGet httpget = new HttpGet(request);
response = client.execute(httpget);
response.getEntity().consumeContent();
} else {
HttpHost target = new HttpHost(host, port);
HttpGet httpget = new HttpGet(uri);
response = client.execute(target, httpget);
response.getEntity().consumeContent();
}
assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
assertEquals(uri, listener.getRequestedUri());