This is the mail archive of the
mauve-discuss@sources.redhat.com
mailing list for the Mauve project.
More URLConnectionTest testlet fixes
- From: Mark Wielaard <mark at klomp dot org>
- To: mauve-discuss at sources dot redhat dot com
- Date: 15 Apr 2002 00:26:25 +0200
- Subject: More URLConnectionTest testlet fixes
Hi,
The following fixes the getInputStream and getOutputStream tests and
makes the toString test less strict.
2002-04-14 Mark Wielaard <mark@klomp.org>
* gnu/testlet/java/net/URLConnection/URLConnectionTest.java
(test_URLConnection): getInputStream() and getOutputStream() should
throw UnknownServiceException. Make toString check less strict.
Cheers,
Mark
--- gnu/testlet/java/net/URLConnection/URLConnectionTest.java 29 Apr 1999 15:05:29 -0000 1.1
+++ gnu/testlet/java/net/URLConnection/URLConnectionTest.java 14 Apr 2002 22:19:32 -0000
@@ -396,9 +369,25 @@
harness.check(true);
}
- conn.getInputStream();
- conn.getOutputStream();
- harness.check(conn.toString(), url.toString(),
+ try {
+ conn.getInputStream();
+ harness.fail("Error in test_URLConnection - getInputStream");
+ }
+ catch (UnknownServiceException e)
+ {
+ harness.check(true);
+ }
+
+ try {
+ conn.getOutputStream();
+ harness.fail("Error in test_URLConnection - getOutputStream");
+ }
+ catch (UnknownServiceException e)
+ {
+ harness.check(true);
+ }
+
+ harness.check(conn.toString().indexOf(url.toString()) != -1,
"Error in test_URLConnection - 12b ");
conn.setDoInput(true);
harness.check(conn.getDoInput(), "Error in test_URLConnection - 13 ");