Author: ron.sigal(a)jboss.com
Date: 2010-11-13 11:29:03 -0500 (Sat, 13 Nov 2010)
New Revision: 6146
Modified:
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/ClientConnectorMisuseTestCase.java
Log:
JBREM-1256: Uses Random from RemotingRootTestBase and
Remoting.getConfiguredEndpoint(OptionMap optionMap).
Modified:
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/ClientConnectorMisuseTestCase.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/ClientConnectorMisuseTestCase.java 2010-11-13
16:26:02 UTC (rev 6145)
+++
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/ClientConnectorMisuseTestCase.java 2010-11-13
16:29:03 UTC (rev 6146)
@@ -38,6 +38,7 @@
import org.jboss.remoting3.RequestContext;
import org.jboss.remoting3.RequestListener;
import org.jboss.remoting3.spi.RemotingServiceDescriptor;
+import org.jboss.xnio.OptionMap;
import org.jboss.xnio.log.Logger;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
@@ -57,8 +58,6 @@
private static final Logger log =
Logger.getLogger(ClientConnectorMisuseTestCase.class);
- private static int counter;
-
@BeforeMethod
public void setUp() {
ServiceLoader.load(RemotingServiceDescriptor.class);
@@ -79,7 +78,7 @@
Client<Object, Object> client = null;
try {
- int id = counter++;
+ int id = Math.abs(random.nextInt());
// Set up services.
TestRequestListener testRequestListener = new TestRequestListener(id);
@@ -122,7 +121,10 @@
}
protected Connection setupConnection(int port) throws IOException, URISyntaxException
{
- Endpoint endpoint = Remoting.getConfiguredEndpoint();
+ String s = "xnio" + String.valueOf(Math.abs(random.nextInt()));
+ log.info(this + " creating xnio: " + s);
+ OptionMap optionMap = OptionMap.builder().set(XNIO_ID, s).getMap();
+ Endpoint endpoint = Remoting.getConfiguredEndpoint(optionMap);
URI uri = new URI(getRemotingScheme() + "://localhost:" + port);
Connection connection = getFutureResult(endpoint.connect(uri,
getConnectionOptionMap(), "user", null, "password".toCharArray()),
"unable to connect to " + uri);
return connection;
Show replies by date