Author: ron.sigal(a)jboss.com
Date: 2008-03-23 05:01:46 -0400 (Sun, 23 Mar 2008)
New Revision: 3736
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
Log:
JBREM-915: Added testNullHost().
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
===================================================================
---
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java 2008-03-23
09:00:39 UTC (rev 3735)
+++
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java 2008-03-23
09:01:46 UTC (rev 3736)
@@ -22,6 +22,8 @@
package org.jboss.test.remoting.locator;
+import java.net.InetAddress;
+
import junit.framework.TestCase;
import org.jboss.remoting.InvokerLocator;
@@ -109,5 +111,32 @@
assertEquals("socket://myhost", origUrl);
}
+
+ 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
Show replies by date