equal
deleted
inserted
replaced
23 |
23 |
24 /** |
24 /** |
25 * @test |
25 * @test |
26 * @bug 5049976 |
26 * @bug 5049976 |
27 * @library ../../httptest/ |
27 * @library ../../httptest/ |
28 * @build HttpCallback HttpServer ClosedChannelList HttpTransaction |
28 @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction |
29 * @run main SetChunkedStreamingMode |
29 * @run main SetChunkedStreamingMode |
30 * @summary Unspecified NPE is thrown when streaming output mode is enabled |
30 * @summary Unspecified NPE is thrown when streaming output mode is enabled |
31 */ |
31 */ |
32 |
32 |
33 import java.io.*; |
33 import java.io.*; |
58 } |
58 } |
59 System.out.println (""); |
59 System.out.println (""); |
60 System.out.println ("finished reading"); |
60 System.out.println ("finished reading"); |
61 } |
61 } |
62 |
62 |
63 static HttpServer server; |
63 static TestHttpServer server; |
64 |
64 |
65 public static void main (String[] args) throws Exception { |
65 public static void main (String[] args) throws Exception { |
66 try { |
66 try { |
67 server = new HttpServer (new SetChunkedStreamingMode(), 1, 10, 0); |
67 server = new TestHttpServer (new SetChunkedStreamingMode(), 1, 10, 0); |
68 System.out.println ("Server: listening on port: " + server.getLocalPort()); |
68 System.out.println ("Server: listening on port: " + server.getLocalPort()); |
69 URL url = new URL ("http://127.0.0.1:"+server.getLocalPort()+"/"); |
69 URL url = new URL ("http://127.0.0.1:"+server.getLocalPort()+"/"); |
70 System.out.println ("Client: connecting to " + url); |
70 System.out.println ("Client: connecting to " + url); |
71 HttpURLConnection urlc = (HttpURLConnection)url.openConnection(); |
71 HttpURLConnection urlc = (HttpURLConnection)url.openConnection(); |
72 urlc.setChunkedStreamingMode (0); |
72 urlc.setChunkedStreamingMode (0); |