use of org.apache.commons.httpclient.server.SimpleSocketFactory in project ecf by eclipse.
the class HttpClientTestBase method setUp.
// ------------------------------------------------- TestCase setup/shutdown
public void setUp() throws IOException {
// Configure socket factories
SimpleSocketFactory serversocketfactory = null;
Protocol testhttp = null;
/* XXX removed because ssl test code not included
if (this.useSSL) {
serversocketfactory = new SimpleSSLSocketFactory();
testhttp = new Protocol("https",
(ProtocolSocketFactory)new SimpleSSLTestProtocolSocketFactory(), 443);
} else {
serversocketfactory = new SimplePlainSocketFactory();
testhttp = Protocol.getProtocol("http");
}
*/
// use arbitrary port
this.server = new SimpleHttpServer(serversocketfactory, 0);
this.server.setTestname(getName());
this.client = new HttpClient();
this.client.getHostConfiguration().setHost(this.server.getLocalAddress(), this.server.getLocalPort(), testhttp);
if (this.useProxy) {
this.proxy = new SimpleProxy();
client.getHostConfiguration().setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
}
}
Aggregations