test/java/net/URLConnection/B5052093.java
Print this page
*** 23,42 ****
/*
* @test
* @bug 5052093
* @library ../../../sun/net/www/httptest/
! * @build HttpCallback HttpServer ClosedChannelList HttpTransaction
* @run main B5052093
* @summary URLConnection doesn't support large files
*/
import java.net.*;
import java.io.*;
import sun.net.www.protocol.file.FileURLConnection;
public class B5052093 implements HttpCallback {
! private static HttpServer server;
private static long testSize = ((long) (Integer.MAX_VALUE)) + 2;
public static class LargeFile extends File {
public LargeFile() {
super("/dev/zero");
--- 23,42 ----
/*
* @test
* @bug 5052093
* @library ../../../sun/net/www/httptest/
! * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction
* @run main B5052093
* @summary URLConnection doesn't support large files
*/
import java.net.*;
import java.io.*;
import sun.net.www.protocol.file.FileURLConnection;
public class B5052093 implements HttpCallback {
! private static TestHttpServer server;
private static long testSize = ((long) (Integer.MAX_VALUE)) + 2;
public static class LargeFile extends File {
public LargeFile() {
super("/dev/zero");
*** 61,71 ****
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception {
! server = new HttpServer(new B5052093(), 1, 10, 0);
try {
URL url = new URL("http://localhost:"+server.getLocalPort()+"/foo");
URLConnection conn = url.openConnection();
int i = conn.getContentLength();
long l = conn.getContentLengthLong();
--- 61,71 ----
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception {
! server = new TestHttpServer(new B5052093(), 1, 10, 0);
try {
URL url = new URL("http://localhost:"+server.getLocalPort()+"/foo");
URLConnection conn = url.openConnection();
int i = conn.getContentLength();
long l = conn.getContentLengthLong();