test/sun/net/www/AuthHeaderTest.java
Print this page
*** 23,33 ****
/**
* @test
* @bug 4804309
* @library ../../../sun/net/www/httptest/
! * @build HttpCallback HttpServer ClosedChannelList HttpTransaction
* @run main AuthHeaderTest
* @summary AuthHeaderTest bug
*/
import java.io.*;
--- 23,33 ----
/**
* @test
* @bug 4804309
* @library ../../../sun/net/www/httptest/
! * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction
* @run main AuthHeaderTest
* @summary AuthHeaderTest bug
*/
import java.io.*;
*** 88,104 ****
InputStream is = urlc.getInputStream ();
read (is);
is.close();
}
! static HttpServer server;
public static void main (String[] args) throws Exception {
MyAuthenticator auth = new MyAuthenticator ();
Authenticator.setDefault (auth);
try {
! server = new HttpServer (new AuthHeaderTest(), 1, 10, 0);
System.out.println ("Server: listening on port: " + server.getLocalPort());
client ("http://localhost:"+server.getLocalPort()+"/d1/foo.html");
} catch (Exception e) {
if (server != null) {
server.terminate();
--- 88,104 ----
InputStream is = urlc.getInputStream ();
read (is);
is.close();
}
! static TestHttpServer server;
public static void main (String[] args) throws Exception {
MyAuthenticator auth = new MyAuthenticator ();
Authenticator.setDefault (auth);
try {
! server = new TestHttpServer (new AuthHeaderTest(), 1, 10, 0);
System.out.println ("Server: listening on port: " + server.getLocalPort());
client ("http://localhost:"+server.getLocalPort()+"/d1/foo.html");
} catch (Exception e) {
if (server != null) {
server.terminate();