test/sun/net/www/protocol/http/ResponseCacheStream.java
Print this page
*** 23,33 ****
/*
* @test
* @bug 6262486
* @library ../../httptest/
! * @build HttpCallback HttpServer ClosedChannelList HttpTransaction
* @run main/othervm -Dhttp.keepAlive=false ResponseCacheStream
* @summary COMPATIBILITY: jagex_com - Monkey Puzzle applet fails to load
*/
import java.net.*;
--- 23,33 ----
/*
* @test
* @bug 6262486
* @library ../../httptest/
! * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction
* @run main/othervm -Dhttp.keepAlive=false ResponseCacheStream
* @summary COMPATIBILITY: jagex_com - Monkey Puzzle applet fails to load
*/
import java.net.*;
*** 89,105 ****
public byte[] getBuffer() {
return buf.toByteArray();
}
}
! static HttpServer server;
public static void main(String[] args) throws Exception {
MyResponseCache cache = new MyResponseCache();
try {
ResponseCache.setDefault(cache);
! server = new HttpServer (new ResponseCacheStream());
System.out.println ("Server: listening on port: " + server.getLocalPort());
URL url = new URL ("http://127.0.0.1:"+server.getLocalPort()+"/");
System.out.println ("Client: connecting to " + url);
HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
InputStream is = urlc.getInputStream();
--- 89,105 ----
public byte[] getBuffer() {
return buf.toByteArray();
}
}
! static TestHttpServer server;
public static void main(String[] args) throws Exception {
MyResponseCache cache = new MyResponseCache();
try {
ResponseCache.setDefault(cache);
! server = new TestHttpServer (new ResponseCacheStream());
System.out.println ("Server: listening on port: " + server.getLocalPort());
URL url = new URL ("http://127.0.0.1:"+server.getLocalPort()+"/");
System.out.println ("Client: connecting to " + url);
HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
InputStream is = urlc.getInputStream();