test/jdk/sun/net/www/protocol/http/6550798/test.java
changeset 54314 46cf212cdcca
parent 47216 71c04702a3d5
child 54787 7748aa47b4e2
equal deleted inserted replaced
54313:440cbcf3b268 54314:46cf212cdcca
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @test
    25  * @test
    26  * @bug 6550798
    26  * @bug 6550798
       
    27  * @library /test/lib
    27  * @summary Using InputStream.skip with ResponseCache will cause partial data to be cached
    28  * @summary Using InputStream.skip with ResponseCache will cause partial data to be cached
    28  * @modules jdk.httpserver
    29  * @modules jdk.httpserver
    29  * @run main/othervm test
    30  * @run main/othervm test
    30  */
    31  */
    31 
    32 
    32 import java.net.*;
    33 import java.net.*;
    33 import com.sun.net.httpserver.*;
    34 import com.sun.net.httpserver.*;
    34 import java.io.*;
    35 import java.io.*;
       
    36 
       
    37 import jdk.test.lib.net.URIBuilder;
    35 
    38 
    36 public class test {
    39 public class test {
    37 
    40 
    38     final static int LEN = 16 * 1024;
    41     final static int LEN = 16 * 1024;
    39 
    42 
    56             }
    59             }
    57         });
    60         });
    58         s.start();
    61         s.start();
    59 
    62 
    60         System.out.println("http request with cache hander");
    63         System.out.println("http request with cache hander");
    61         URL u = new URL("http://127.0.0.1:"+s.getAddress().getPort()+"/f");
    64         URL u = URIBuilder.newBuilder()
       
    65             .scheme("http")
       
    66             .loopback()
       
    67             .port(s.getAddress().getPort())
       
    68             .path("/f")
       
    69             .toURL();
       
    70         System.out.println("URL: " + u);
    62         URLConnection conn = u.openConnection();
    71         URLConnection conn = u.openConnection();
    63 
    72 
    64         InputStream is = null;
    73         InputStream is = null;
    65         try {
    74         try {
    66             // this calls into TestCache.get
    75             // this calls into TestCache.get