mx4j/src/test/test/javax/management/remote JMXServiceURLTest.java,1.6,1.7
Simone Bordet <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27119/test/test/javax/management/remote
Modified Files:
JMXServiceURLTest.java
Log Message:
Fixed bugs in case of the several parameters constructor when arguments are null
Index: JMXServiceURLTest.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXServiceURLTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** JMXServiceURLTest.java 23 Sep 2003 18:39:22 -0000 1.6
--- JMXServiceURLTest.java 18 Jul 2004 21:18:59 -0000 1.7
***************
*** 147,151 ****
assertEquals(host, url.getHost());
assertEquals(0, url.getPort());
! assertEquals(null, url.getURLPath());
}
--- 147,151 ----
assertEquals(host, url.getHost());
assertEquals(0, url.getPort());
! assertEquals("", url.getURLPath());
}
***************
*** 160,164 ****
assertEquals(host, url.getHost());
assertEquals(port, url.getPort());
! assertEquals(null, url.getURLPath());
}
--- 160,164 ----
assertEquals(host, url.getHost());
assertEquals(port, url.getPort());
! assertEquals("", url.getURLPath());
}
***************
*** 198,200 ****
--- 198,233 ----
assertEquals(url, reference);
}
+
+ public void testDifferentConstructorsYieldEqualJMXServiceURL() throws Exception
+ {
+ JMXServiceURL one = new JMXServiceURL("service:jmx:rmi://");
+ JMXServiceURL two = new JMXServiceURL("rmi", null, 0, null);
+ assertEquals(one, two);
+ assertEquals(one.hashCode(), two.hashCode());
+ assertEquals(one.getURLPath(), two.getURLPath());
+
+ one = new JMXServiceURL("service:jmx:rmi://myhost");
+ two = new JMXServiceURL("rmi", "myhost", 0, null);
+ assertEquals(one, two);
+ assertEquals(one.hashCode(), two.hashCode());
+ assertEquals(one.getURLPath(), two.getURLPath());
+
+ one = new JMXServiceURL("service:jmx:rmi://myhost/");
+ two = new JMXServiceURL("rmi", "myhost", 0, null);
+ assertEquals(one, two);
+ assertEquals(one.hashCode(), two.hashCode());
+ assertEquals(one.getURLPath(), two.getURLPath());
+
+ one = new JMXServiceURL("service:jmx:rmi://myhost/mypath");
+ two = new JMXServiceURL("rmi", "myhost", 0, "mypath");
+ assertEquals(one, two);
+ assertEquals(one.hashCode(), two.hashCode());
+ assertEquals(one.getURLPath(), two.getURLPath());
+
+ one = new JMXServiceURL("service:jmx:rmi://myhost/mypath");
+ two = new JMXServiceURL("rmi", "myhost", 0, "/mypath");
+ assertEquals(one, two);
+ assertEquals(one.hashCode(), two.hashCode());
+ assertEquals(one.getURLPath(), two.getURLPath());
+ }
}
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click