test/java/net/ProxySelector/ProxyTest.java
Print this page
@@ -24,21 +24,21 @@
/*
* @test
* @bug 4696512
* @summary HTTP client: Improve proxy server configuration and selection
* @library ../../../sun/net/www/httptest/
- * @build ClosedChannelList HttpServer HttpTransaction HttpCallback
+ * @build ClosedChannelList TestHttpServer HttpTransaction HttpCallback
* @compile ProxyTest.java
* @run main/othervm -Dhttp.proxyHost=inexistant -Dhttp.proxyPort=8080 ProxyTest
*/
import java.net.*;
import java.io.*;
import java.util.ArrayList;
public class ProxyTest implements HttpCallback {
- static HttpServer server;
+ static TestHttpServer server;
public ProxyTest() {
}
public void request (HttpTransaction req) {
@@ -72,11 +72,11 @@
ProxySelector defSelector = ProxySelector.getDefault();
if (defSelector == null)
throw new RuntimeException("Default ProxySelector is null");
ProxySelector.setDefault(new MyProxySelector());
try {
- server = new HttpServer (new ProxyTest(), 1, 10, 0);
+ server = new TestHttpServer (new ProxyTest(), 1, 10, 0);
URL url = new URL("http://localhost:"+server.getLocalPort());
System.out.println ("client opening connection to: " + url);
HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
InputStream is = urlc.getInputStream ();
is.close();