Author: ron.sigal(a)jboss.com
Date: 2008-04-29 04:41:39 -0400 (Tue, 29 Apr 2008)
New Revision: 4093
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lifecycle/InvokerLifecycleTestCase.java
Log:
JBREM-930: Eliminated hard coded host and port.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lifecycle/InvokerLifecycleTestCase.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lifecycle/InvokerLifecycleTestCase.java 2008-04-29
07:21:54 UTC (rev 4092)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lifecycle/InvokerLifecycleTestCase.java 2008-04-29
08:41:39 UTC (rev 4093)
@@ -26,6 +26,7 @@
import org.jboss.remoting.InvalidConfigurationException;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.transport.PortUtil;
import java.net.InetAddress;
import java.net.ServerSocket;
@@ -70,7 +71,10 @@
public void testNonConcurrentConnectors() throws Exception
{
- InvokerLocator serverLocator = new
InvokerLocator("socket://localhost:2222");
+ String defaultHost = InetAddress.getLocalHost().getHostName();
+ String host = System.getProperty("jrunit.bind_addr", defaultHost);
+ int port = PortUtil.findFreePort(host);
+ InvokerLocator serverLocator = new InvokerLocator("socket://" + host +
":" + port);
Connector connector1 = new Connector();
connector1.setInvokerLocator(serverLocator.getLocatorURI());
connector1.start();