Author: ron.sigal(a)jboss.com
Date: 2008-05-01 03:08:01 -0400 (Thu, 01 May 2008)
New Revision: 4107
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java
Log:
JBREM-930: Allows for subsystems of extraneous servers.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java 2008-05-01
06:54:17 UTC (rev 4106)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java 2008-05-01
07:08:01 UTC (rev 4107)
@@ -50,6 +50,7 @@
import java.net.InetAddress;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.HashSet;
import java.util.List;
import java.util.Random;
@@ -62,9 +63,9 @@
public class MetadataTestCase extends TestCase implements NotificationListener
{
private static int secret = Math.abs(new Random().nextInt(2000));
-
- private String subSystem = null;
+ private HashSet subSystems = new HashSet();
+
public MetadataTestCase(String name)
{
super(name);
@@ -127,7 +128,7 @@
checkForConnector(reg2);
// now check to make sure got the subsystem as expected
- assertEquals("MOCK", subSystem);
+ assertTrue(subSystems.contains("MOCK"));
}
finally
{
@@ -208,8 +209,14 @@
{
NetworkNotification netNot = (NetworkNotification) notification;
ServerInvokerMetadata[] serverMetadata = netNot.getServerInvokers();
- if (serverMetadata.length > 0)
- subSystem = serverMetadata[0].getSubSystems()[0];
+ for (int i = 0; i < serverMetadata.length; i++)
+ {
+ String[] ss = serverMetadata[i].getSubSystems();
+ for (int j = 0; j < ss.length; j++)
+ {
+ subSystems.add(ss[j]);
+ }
+ }
}
}