This is the mail archive of the mauve-patches@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]

Patch: Add URL.getUserInfo() tests...


Tom Tromey asked me (off list) to check in the attached patch.

Baring objections, I will do so in a couple of hours.

David Daney.
2004-09-23  David Daney  <ddaney@avtrex.com>

	* gnu/testlet/java/net/URL/URLTest.java: Add tests for getUserInfo().


Index: gnu/testlet/java/net/URL/URLTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/net/URL/URLTest.java,v
retrieving revision 1.10
diff -c -p -r1.10 URLTest.java
*** gnu/testlet/java/net/URL/URLTest.java	3 Jun 2004 14:31:12 -0000	1.10
--- gnu/testlet/java/net/URL/URLTest.java	23 Sep 2004 16:49:48 -0000
*************** public class URLTest implements Testlet
*** 117,122 ****
--- 117,139 ----
  				harness.fail(" Error in test_Basics  - 21 " + 
  					" exception should not be thrown here");
  		}
+ 
+                 try {
+                         URL u1 = new URL("http://foo@some.nice.place/bar/";);
+                         URL u2 = new URL("http://some.nice.place/bar/";);
+                         URL u3 = new URL(u1, "more/path", null);
+ 
+                         harness.check (u1.getUserInfo(), "foo");
+                         harness.check (u2.getUserInfo(), null);
+                         harness.check (u3.getUserInfo(), "foo");
+                         harness.check (u3.getProtocol(), "http");
+                         harness.check (u3.getHost(), "some.nice.place");
+                 }
+                 catch ( MalformedURLException e ){
+ 				harness.fail(" Error in test_Basics  - 27 " + 
+                                              " exception should not be thrown here");
+                 }
+                 
  	}
  
  	public void test_openConnection()

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