test/sun/net/www/protocol/http/B6299712.java

Print this page

        

*** 23,33 **** /* * @test * @bug 6299712 * @library ../../httptest/ ! * @build HttpCallback HttpServer ClosedChannelList HttpTransaction * @run main/othervm B6299712 * @summary NullPointerException in sun.net.www.protocol.http.HttpURLConnection.followRedirect */ import java.net.*; --- 23,33 ---- /* * @test * @bug 6299712 * @library ../../httptest/ ! * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction * @run main/othervm B6299712 * @summary NullPointerException in sun.net.www.protocol.http.HttpURLConnection.followRedirect */ import java.net.*;
*** 47,57 **** * automatically by HttpURLConnection, which will be served by DeployCacheResponse. * The NPE will be thrown on the second round if the bug is there. */ public class B6299712 { static SimpleHttpTransaction httpTrans; ! static HttpServer server; public static void main(String[] args) throws Exception { ResponseCache.setDefault(new DeployCacheHandler()); startHttpServer(); --- 47,57 ---- * automatically by HttpURLConnection, which will be served by DeployCacheResponse. * The NPE will be thrown on the second round if the bug is there. */ public class B6299712 { static SimpleHttpTransaction httpTrans; ! static TestHttpServer server; public static void main(String[] args) throws Exception { ResponseCache.setDefault(new DeployCacheHandler()); startHttpServer();
*** 59,69 **** } public static void startHttpServer() { try { httpTrans = new SimpleHttpTransaction(); ! server = new HttpServer(httpTrans, 1, 10, 0); } catch (IOException e) { e.printStackTrace(); } } --- 59,69 ---- } public static void startHttpServer() { try { httpTrans = new SimpleHttpTransaction(); ! server = new TestHttpServer(httpTrans, 1, 10, 0); } catch (IOException e) { e.printStackTrace(); } }