[jboss-remoting-commits] JBoss Remoting SVN: r6159 - remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/security.
jboss-remoting-commits at lists.jboss.org
jboss-remoting-commits at lists.jboss.org
Sat Nov 13 11:52:28 EST 2010
Author: ron.sigal at jboss.com
Date: 2010-11-13 11:52:27 -0500 (Sat, 13 Nov 2010)
New Revision: 6159
Modified:
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/security/AuthenticationTestCase.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/security/AuthenticationTestCase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/security/AuthenticationTestCase.java 2010-11-13 16:51:06 UTC (rev 6158)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/security/AuthenticationTestCase.java 2010-11-13 16:52:27 UTC (rev 6159)
@@ -88,7 +88,6 @@
public class AuthenticationTestCase extends RemotingTestBase {
private static final Logger log = Logger.getLogger(AuthenticationTestCase.class);
- private static int counter;
protected static final String SERVICE = "service";
protected static final String INSTANCE = "instance";
@@ -180,9 +179,12 @@
}
};
- int id = counter++;
+ int id = Math.abs(random.nextInt());
setupServer(id, serverOptionMap, authenticationProvider);
- Endpoint clientEndpoint = 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 clientEndpoint = Remoting.getConfiguredEndpoint(optionMap);
URI uri = null;
Connection connection = null;
Client<Object, Object> client = null;
@@ -216,14 +218,17 @@
protected void doTest(OptionMap clientOptionMap, OptionMap serverOptionMap) throws Exception {
try {
- int id = counter++;
+ int id = Math.abs(random.nextInt());
String realm = "endpoint" + id;
SimpleServerAuthenticationProvider authenticationProvider = new SimpleServerAuthenticationProvider();
authenticationProvider.addUser("trustin", realm, "lee".toCharArray());
authenticationProvider.addUser("david", realm, "lloyd".toCharArray());
authenticationProvider.addUser("*", realm, "*".toCharArray());
setupServer(id, serverOptionMap, authenticationProvider);
- Endpoint clientEndpoint = 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 clientEndpoint = Remoting.getConfiguredEndpoint(optionMap);
URI uri = null;
Connection connection = null;
Client<Object, Object> client = null;
More information about the jboss-remoting-commits
mailing list