java_net_URLConnection_methods is failing in the nightly build of 1.0beta2 JDK.
------- java_net_URLConnection_methods java_run FAIL --------
2,34c2,17
< y4.getContent()
< Test
<
<
< y1.getContentEncoding() null
< y1.getContentLength() 4170
< y1.getContentType() text/html
< y1.getDate() passed
< y1.getDefaultAllowUserInteraction() true
< y1.getDefaultAllowUserInteraction() false
< y1.getDefaultRequestProperty(MYVAR) null
< y1.getDefaultUseCaches() true
< y1.getDefaultUseCaches() false
< y2.getDoInput() false
< y2.getDoInput() true
< y2.getDoOutput() true
< y2.getDoOutput() false
< y1.getExpiration() 0
< y1.getHeaderField(content-length) 4170
< y1.getHeaderField(1) null
< y1.getHeaderFieldDate(date, 2) passedy1.getHeaderFieldInt(content-length, 2) 4170
< y1.getHeaderFieldKey(1) null
< y1.getIfModifiedSince() 0
< y1.getInputStream() java/io/InputStream.java/io/FilterInputStream.sun/net/www/MeteredStream[expected=4170, count=0, url=java/net/URL, closed=?00000000, in=java/io/InputStream.java/io/FilterInputStream.java/io/BufferedInputStream]
< y1.getLastModified() passed
< y2.getRequestProperty(MYVAR) null
< y1.getURL() http://tachyon/
< y2.getUseCaches() true
< y2.getUseCaches() false
< y2.getAllowUserInteraction() true
< y2.getAllowUserInteraction() false
< y2.getIfModifiedSince() 10
< y1.toString() sun.net.www.protocol.http.HttpURLConnection:http://tachyon/
---
> java.lang.NullPointerException
> at java.lang.Runtime.initializeLinker(Runtime.java)
> at java.lang.Runtime.loadLibrary(Runtime.java)
> at java.lang.System.loadLibrary(System.java)
> at java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:43)
> at java.net.Socket.<init>(Socket.java:49)
> at java.net.Socket.<init>(Socket.java:75)
> at java.net.Socket.<init>(Socket.java:62)
> at sun.net.NetworkClient.openServer(NetworkClient.java:47)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:127)
> at sun.net.www.http.HttpClient.<init>(HttpClient.java:412)
> at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:70)
> at java_net_URLConnection_methods.main(java_net_URLConnection_methods.java:26)
> java.io.IOException: java.lang.UnsatisfiedLinkError: socketCreate
> at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:109)
> at java_net_URLConnection_methods.main(java_net_URLConnection_methods.java:26)
Code:
// Test case for class java.net.URLConnection methods
import java.util.Properties;
import java.net.*;
class java_net_URLConnection_methods {
public static void main (String args[]) throws Exception {
URL x1 = new URL("http://tachyon/");
URL x2 = new URL("http://tachyon/");
URL x3 = new URL("file:///net/tachyon/export/disk1/Mosaic/docs/java.sun.com/JDK-prebeta1/converting/alpha/NervousText.java");
URL x4 = new URL("http://tachyon/~hew/test");
URLConnection y1;
URLConnection y2;
URLConnection y3;
URLConnection y4;
Properties p = new Properties();
p.put("MYVAR","VAL");
System.setProperties(p);
System.out.print("x1.openConnection() \\n");
y1 = x1.openConnection();
y2 = x2.openConnection();
y4 = x4.openConnection();
y1.connect();
y4.connect();
System.out.print("y4.getContent() " + y4.getContent().toString() + " \\n");
System.out.print("y1.getContentEncoding() " + y1.getContentEncoding() + " \\n");
System.out.print("y1.getContentLength() " + y1.getContentLength() + " \\n");
System.out.print("y1.getContentType() " + y1.getContentType() + " \\n");
if ( y1.getDate() > 0) {
System.out.print("y1.getDate() passed \\n");
}
y1.setDefaultAllowUserInteraction(true);
System.out.print("y1.getDefaultAllowUserInteraction() " + y1.getDefaultAllowUserInteraction() + " \\n");
y1.setDefaultAllowUserInteraction(false);
System.out.print("y1.getDefaultAllowUserInteraction() " + y1.getDefaultAllowUserInteraction() + " \\n");
y1.setDefaultRequestProperty("MYVAR","VAL3");
System.out.print("y1.getDefaultRequestProperty(MYVAR) " + y1.getDefaultRequestProperty("MYVAR") + " \\n");
y1.setDefaultUseCaches(true);
System.out.print("y1.getDefaultUseCaches() " + y1.getDefaultUseCaches() + " \\n");
y1.setDefaultUseCaches(false);
System.out.print("y1.getDefaultUseCaches() " + y1.getDefaultUseCaches() + " \\n");
y2.setDoInput(false);
System.out.print("y2.getDoInput() " + y2.getDoInput() + " \\n"); y2.setDoInput(true);
System.out.print("y2.getDoInput() " + y2.getDoInput() + " \\n");
y2.setDoOutput(true);
System.out.print("y2.getDoOutput() " + y2.getDoOutput() + " \\n");
y2.setDoOutput(false);
System.out.print("y2.getDoOutput() " + y2.getDoOutput() + " \\n");
System.out.print("y1.getExpiration() " + y1.getExpiration() + " \\n");
System.out.print("y1.getHeaderField(content-length) " + y1.getHeaderField("content-length") + " \\n");
System.out.print("y1.getHeaderField(1) " + y1.getHeaderField(1) + " \\n");
if ( y1.getHeaderFieldDate("date", 2) > 0) {
System.out.print("y1.getHeaderFieldDate(date, 2) passed");
}
System.out.print("y1.getHeaderFieldInt(content-length, 2) " + y1.getHeaderFieldInt("content-length", 2) + " \\n");
System.out.print("y1.getHeaderFieldKey(1) " + y1.getHeaderFieldKey(1) + " \\n");
System.out.print("y1.getIfModifiedSince() " + y1.getIfModifiedSince() + " \\n");
System.out.print("y1.getInputStream() " + y1.getInputStream() + " \\n");
if ( y1.getLastModified() > 0) {
System.out.print("y1.getLastModified() passed \\n");
}
// System.out.print("y1.getOutputStream() " + y1.getOutputStream() + " \\n");
y2.setRequestProperty("MYVAR", "VAL2");
System.out.print("y2.getRequestProperty(MYVAR) " + y2.getRequestProperty("MYVAR") + " \\n");
System.out.print("y1.getURL() " + y1.getURL() + " \\n");
y2.setUseCaches(true);
System.out.print("y2.getUseCaches() " + y2.getUseCaches() + " \\n");
y2.setUseCaches(false);
System.out.print("y2.getUseCaches() " + y2.getUseCaches() + " \\n");
y2.setAllowUserInteraction(true);
System.out.print("y2.getAllowUserInteraction() " + y2.getAllowUserInteraction() + " \\n");
y2.setAllowUserInteraction(false);
System.out.print("y2.getAllowUserInteraction() " + y2.getAllowUserInteraction() + " \\n");
// System.out.print("y1.guessContentTypeFromName(x.au) " + y1.guessContentTypeFromName("x.au") + " \\n");
// System.out.print("y1.guessContentTypeFromStream(getInputStream) " + y1.guessContentTypeFromStream(y1.getInputStream()) + " \\n");
// System.out.print("y1.setContentHandlerFactory(java.net.ContentHandlerFactory) " + y1.setContentHandlerFactory(java.net.ContentHandlerFactory) + " \\n");
y2.setIfModifiedSince(10);
System.out.print("y2.getIfModifiedSince() " + y2.getIfModifiedSince() + " \\n");
System.out.print("y1.toString() " + y1.toString() + " \\n");
}
}
------- java_net_URLConnection_methods java_run FAIL --------
2,34c2,17
< y4.getContent()
< Test
<
<
< y1.getContentEncoding() null
< y1.getContentLength() 4170
< y1.getContentType() text/html
< y1.getDate() passed
< y1.getDefaultAllowUserInteraction() true
< y1.getDefaultAllowUserInteraction() false
< y1.getDefaultRequestProperty(MYVAR) null
< y1.getDefaultUseCaches() true
< y1.getDefaultUseCaches() false
< y2.getDoInput() false
< y2.getDoInput() true
< y2.getDoOutput() true
< y2.getDoOutput() false
< y1.getExpiration() 0
< y1.getHeaderField(content-length) 4170
< y1.getHeaderField(1) null
< y1.getHeaderFieldDate(date, 2) passedy1.getHeaderFieldInt(content-length, 2) 4170
< y1.getHeaderFieldKey(1) null
< y1.getIfModifiedSince() 0
< y1.getInputStream() java/io/InputStream.java/io/FilterInputStream.sun/net/www/MeteredStream[expected=4170, count=0, url=java/net/URL, closed=?00000000, in=java/io/InputStream.java/io/FilterInputStream.java/io/BufferedInputStream]
< y1.getLastModified() passed
< y2.getRequestProperty(MYVAR) null
< y1.getURL() http://tachyon/
< y2.getUseCaches() true
< y2.getUseCaches() false
< y2.getAllowUserInteraction() true
< y2.getAllowUserInteraction() false
< y2.getIfModifiedSince() 10
< y1.toString() sun.net.www.protocol.http.HttpURLConnection:http://tachyon/
---
> java.lang.NullPointerException
> at java.lang.Runtime.initializeLinker(Runtime.java)
> at java.lang.Runtime.loadLibrary(Runtime.java)
> at java.lang.System.loadLibrary(System.java)
> at java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:43)
> at java.net.Socket.<init>(Socket.java:49)
> at java.net.Socket.<init>(Socket.java:75)
> at java.net.Socket.<init>(Socket.java:62)
> at sun.net.NetworkClient.openServer(NetworkClient.java:47)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:127)
> at sun.net.www.http.HttpClient.<init>(HttpClient.java:412)
> at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:70)
> at java_net_URLConnection_methods.main(java_net_URLConnection_methods.java:26)
> java.io.IOException: java.lang.UnsatisfiedLinkError: socketCreate
> at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:109)
> at java_net_URLConnection_methods.main(java_net_URLConnection_methods.java:26)
Code:
// Test case for class java.net.URLConnection methods
import java.util.Properties;
import java.net.*;
class java_net_URLConnection_methods {
public static void main (String args[]) throws Exception {
URL x1 = new URL("http://tachyon/");
URL x2 = new URL("http://tachyon/");
URL x3 = new URL("file:///net/tachyon/export/disk1/Mosaic/docs/java.sun.com/JDK-prebeta1/converting/alpha/NervousText.java");
URL x4 = new URL("http://tachyon/~hew/test");
URLConnection y1;
URLConnection y2;
URLConnection y3;
URLConnection y4;
Properties p = new Properties();
p.put("MYVAR","VAL");
System.setProperties(p);
System.out.print("x1.openConnection() \\n");
y1 = x1.openConnection();
y2 = x2.openConnection();
y4 = x4.openConnection();
y1.connect();
y4.connect();
System.out.print("y4.getContent() " + y4.getContent().toString() + " \\n");
System.out.print("y1.getContentEncoding() " + y1.getContentEncoding() + " \\n");
System.out.print("y1.getContentLength() " + y1.getContentLength() + " \\n");
System.out.print("y1.getContentType() " + y1.getContentType() + " \\n");
if ( y1.getDate() > 0) {
System.out.print("y1.getDate() passed \\n");
}
y1.setDefaultAllowUserInteraction(true);
System.out.print("y1.getDefaultAllowUserInteraction() " + y1.getDefaultAllowUserInteraction() + " \\n");
y1.setDefaultAllowUserInteraction(false);
System.out.print("y1.getDefaultAllowUserInteraction() " + y1.getDefaultAllowUserInteraction() + " \\n");
y1.setDefaultRequestProperty("MYVAR","VAL3");
System.out.print("y1.getDefaultRequestProperty(MYVAR) " + y1.getDefaultRequestProperty("MYVAR") + " \\n");
y1.setDefaultUseCaches(true);
System.out.print("y1.getDefaultUseCaches() " + y1.getDefaultUseCaches() + " \\n");
y1.setDefaultUseCaches(false);
System.out.print("y1.getDefaultUseCaches() " + y1.getDefaultUseCaches() + " \\n");
y2.setDoInput(false);
System.out.print("y2.getDoInput() " + y2.getDoInput() + " \\n"); y2.setDoInput(true);
System.out.print("y2.getDoInput() " + y2.getDoInput() + " \\n");
y2.setDoOutput(true);
System.out.print("y2.getDoOutput() " + y2.getDoOutput() + " \\n");
y2.setDoOutput(false);
System.out.print("y2.getDoOutput() " + y2.getDoOutput() + " \\n");
System.out.print("y1.getExpiration() " + y1.getExpiration() + " \\n");
System.out.print("y1.getHeaderField(content-length) " + y1.getHeaderField("content-length") + " \\n");
System.out.print("y1.getHeaderField(1) " + y1.getHeaderField(1) + " \\n");
if ( y1.getHeaderFieldDate("date", 2) > 0) {
System.out.print("y1.getHeaderFieldDate(date, 2) passed");
}
System.out.print("y1.getHeaderFieldInt(content-length, 2) " + y1.getHeaderFieldInt("content-length", 2) + " \\n");
System.out.print("y1.getHeaderFieldKey(1) " + y1.getHeaderFieldKey(1) + " \\n");
System.out.print("y1.getIfModifiedSince() " + y1.getIfModifiedSince() + " \\n");
System.out.print("y1.getInputStream() " + y1.getInputStream() + " \\n");
if ( y1.getLastModified() > 0) {
System.out.print("y1.getLastModified() passed \\n");
}
// System.out.print("y1.getOutputStream() " + y1.getOutputStream() + " \\n");
y2.setRequestProperty("MYVAR", "VAL2");
System.out.print("y2.getRequestProperty(MYVAR) " + y2.getRequestProperty("MYVAR") + " \\n");
System.out.print("y1.getURL() " + y1.getURL() + " \\n");
y2.setUseCaches(true);
System.out.print("y2.getUseCaches() " + y2.getUseCaches() + " \\n");
y2.setUseCaches(false);
System.out.print("y2.getUseCaches() " + y2.getUseCaches() + " \\n");
y2.setAllowUserInteraction(true);
System.out.print("y2.getAllowUserInteraction() " + y2.getAllowUserInteraction() + " \\n");
y2.setAllowUserInteraction(false);
System.out.print("y2.getAllowUserInteraction() " + y2.getAllowUserInteraction() + " \\n");
// System.out.print("y1.guessContentTypeFromName(x.au) " + y1.guessContentTypeFromName("x.au") + " \\n");
// System.out.print("y1.guessContentTypeFromStream(getInputStream) " + y1.guessContentTypeFromStream(y1.getInputStream()) + " \\n");
// System.out.print("y1.setContentHandlerFactory(java.net.ContentHandlerFactory) " + y1.setContentHandlerFactory(java.net.ContentHandlerFactory) + " \\n");
y2.setIfModifiedSince(10);
System.out.print("y2.getIfModifiedSince() " + y2.getIfModifiedSince() + " \\n");
System.out.print("y1.toString() " + y1.toString() + " \\n");
}
}