test/java/net/Authenticator/B4962064.java

Print this page

        

*** 23,33 **** /** * @test * @bug 4962064 * @library ../../../sun/net/www/httptest/ ! * @build HttpCallback HttpServer ClosedChannelList HttpTransaction * @run main/othervm B4962064 * @summary Extend Authenticator to provide access to request URI and server/proxy */ import java.io.*; --- 23,33 ---- /** * @test * @bug 4962064 * @library ../../../sun/net/www/httptest/ ! * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction * @run main/othervm B4962064 * @summary Extend Authenticator to provide access to request URI and server/proxy */ import java.io.*;
*** 83,98 **** InputStream is = urlc.getInputStream (); read (is); is.close(); } ! static HttpServer server; static URL urlsave; public static void main (String[] args) throws Exception { try { ! server = new HttpServer (new B4962064(), 1, 10, 0); int port = server.getLocalPort(); System.setProperty ("http.proxyHost", "localhost"); System.setProperty ("http.proxyPort", Integer.toString (port)); MyAuthenticator auth = new MyAuthenticator (); Authenticator.setDefault (auth); --- 83,98 ---- InputStream is = urlc.getInputStream (); read (is); is.close(); } ! static TestHttpServer server; static URL urlsave; public static void main (String[] args) throws Exception { try { ! server = new TestHttpServer (new B4962064(), 1, 10, 0); int port = server.getLocalPort(); System.setProperty ("http.proxyHost", "localhost"); System.setProperty ("http.proxyPort", Integer.toString (port)); MyAuthenticator auth = new MyAuthenticator (); Authenticator.setDefault (auth);