diff options
Diffstat (limited to 'libjava/classpath/testsuite/java.net/URLTest.java')
-rw-r--r-- | libjava/classpath/testsuite/java.net/URLTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libjava/classpath/testsuite/java.net/URLTest.java b/libjava/classpath/testsuite/java.net/URLTest.java new file mode 100644 index 0000000..026ea12 --- /dev/null +++ b/libjava/classpath/testsuite/java.net/URLTest.java @@ -0,0 +1,23 @@ +import java.net.*; +import java.io.*; + +public class URLTest +{ + public static void main(String args[]) + { + try { + URL url = new URL("http://www.hungry.com/"); + InputStream stream = url.openStream(); + + int size = 0; + + while (-1 != stream.read()) { size++; } + + stream.close(); + + System.out.println("PASSED: new URL() size=" + size ); + } catch (Exception e) { + System.out.println("FAILED: " + e); + } + } +} |