TARGET_HOST = System.getProperty("httpclient.test.localHost", "localhost");
TARGET_PORT = Integer.parseInt(System.getProperty("httpclient.test.localPort", "8080"));
}
public void testSimpleGet() throws Exception {
SimpleProxy proxy = new SimpleProxy();
HttpClient client = new HttpClient();
HostConfiguration hc = new HostConfiguration();
hc.setHost(TARGET_HOST, TARGET_PORT, Protocol.getProtocol("http"));
hc.setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
client.setHostConfiguration(hc);
GetMethod get = new GetMethod("/");
client.executeMethod(get);
assertEquals(200, get.getStatusCode());