This is the mail archive of the
mauve-patches@sources.redhat.com
mailing list for the Mauve project.
Patch: Add URL.getUserInfo() tests...
- From: David Daney <ddaney at avtrex dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Thu, 23 Sep 2004 09:52:58 -0700
- Subject: 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()