Author: ron.sigal(a)jboss.com
Date: 2008-05-02 01:07:05 -0400 (Fri, 02 May 2008)
New Revision: 4119
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java
Log:
JBREM-930: Ignores extraneous servers.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java 2008-05-02
03:31:16 UTC (rev 4118)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java 2008-05-02
05:07:05 UTC (rev 4119)
@@ -59,13 +59,28 @@
System.out.println("instance = " + instances);
System.out.println("force detection took " + (end - start) + "
milliseconds.");
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+
// assertEquals(1, instances.length);
// now create a client
- NetworkInstance ni = instances[0];
- InvokerLocator[] locator = ni.getLocators();
- InvokerLocator serverLocator = locator[0];
+ InvokerLocator serverLocator = null;
+ for (int i = 0; i < instances.length; i++)
+ {
+ NetworkInstance ni = instances[i];
+ InvokerLocator[] locator = ni.getLocators();
+ for (int j = 0; j < locator.length; j++)
+ {
+ if (locator[j].getHost().equals(bindAddr))
+ {
+ serverLocator = locator[j];
+ break;
+ }
+ }
+ }
+ System.out.println("client connecting to " + serverLocator);
Map config = new HashMap();
config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
String trustStoreFilePath =
this.getClass().getResource("ssl/.truststore").getFile();
@@ -79,8 +94,6 @@
remotingClient = new Client(serverLocator, config);
remotingClient.connect();
- String host = InetAddress.getLocalHost().getHostAddress();
- String bindAddr = System.getProperty("jrunit.bind_addr", host);
String invokerLocatorurl = "sslsocket://" + bindAddr +
":8700";
connector = new Connector(invokerLocatorurl, config);
connector.create();
Show replies by date