This is the mail archive of the mauve-discuss@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]