[jboss-remoting-commits] JBoss Remoting SVN: r3746 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/locator.
jboss-remoting-commits at lists.jboss.org
jboss-remoting-commits at lists.jboss.org
Tue Mar 25 05:08:27 EDT 2008
Author: ron.sigal at jboss.com
Date: 2008-03-25 05:08:27 -0400 (Tue, 25 Mar 2008)
New Revision: 3746
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
Log:
JBREM-936: Added testNullHost().
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java 2008-03-25 09:02:21 UTC (rev 3745)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java 2008-03-25 09:08:27 UTC (rev 3746)
@@ -22,6 +22,7 @@
package org.jboss.test.remoting.locator;
+import java.net.InetAddress;
import java.net.MalformedURLException;
import java.util.List;
@@ -470,4 +471,35 @@
l = new InvokerLocator("socket://multihome:11/?connecthomes=a.b!c.d:12&" + InvokerLocator.DEFAULT_PORT + "=13&" + InvokerLocator.DEFAULT_CONNECT_PORT + "=14");
assertEquals("a.b:14!c.d:12", l.getConnectHomes());
}
+
+
+ /**
+ * For JBREM-936.
+ */
+ public void testNullHost() throws Exception
+ {
+ InvokerLocator locator = new InvokerLocator("socket://:7777");
+
+ String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+ boolean byHost = true;
+ String host = null;
+
+ try
+ {
+ byHost = Boolean.getBoolean(bindByHost);
+ }
+ catch(Exception e)
+ {
+ }
+ if(byHost)
+ {
+ host = InetAddress.getLocalHost().getHostName();
+ }
+ else
+ {
+ host = InetAddress.getLocalHost().getHostAddress();
+ }
+
+ assertEquals(host, locator.getHost());
+ }
}
\ No newline at end of file
More information about the jboss-remoting-commits
mailing list