public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
* More URLConnectionTest testlet fixes
@ 2002-04-14 15:26 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2002-04-14 15:26 UTC (permalink / raw)
  To: mauve-discuss

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

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

[-- Attachment #2: URLConnectionTest.diff2 --]
[-- Type: text/plain, Size: 973 bytes --]

--- 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 ");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-04-14 22:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-14 15:26 More URLConnectionTest testlet fixes Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).