.append("<attach uriPattern=\"/efgh\" targetClass=\"org.restlet.test.component.HelloWorldApplication\" /> ");
config.append("</host>");
config.append("</component>");
final Component component = new Component(config);
component.start();
final Client client = new Client(Protocol.HTTP);
Response response = client.handle(new Request(Method.GET,
"http://localhost:" + this.port + "/efgh"));
assertTrue(response.getStatus().isSuccess());
assertTrue(response.isEntityAvailable());
response = client.handle(new Request(Method.GET, "http://localhost:"
+ this.port + "/abcd"));
assertTrue(response.getStatus().isClientError());
response = client.handle(new Request(Method.GET, "http://localhost:"
+ this.port2 + "/abcd"));
assertTrue(response.getStatus().isSuccess());
assertTrue(response.isEntityAvailable());
response = client.handle(new Request(Method.GET, "http://localhost:"
+ this.port2 + "/efgh"));
assertTrue(response.getStatus().isClientError());
component.stop();
client.stop();
}