jdk/test/sun/net/www/protocol/http/SetChunkedStreamingMode.java
changeset 13788 3f38e525f30a
parent 5506 202f599c92aa
child 14342 8435a30053c1
equal deleted inserted replaced
13787:19d54bca65d7 13788:3f38e525f30a
    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);