Author: ron.sigal(a)jboss.com
Date: 2010-11-13 11:51:06 -0500 (Sat, 13 Nov 2010)
New Revision: 6158
Modified:
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/remote/RemoteMessageHandlerTestCase.java
Log:
JBREM-1256: Uses Random from RemotingRootTestBase to create unique XNIO name.
Modified:
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/remote/RemoteMessageHandlerTestCase.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/remote/RemoteMessageHandlerTestCase.java 2010-11-13
16:50:16 UTC (rev 6157)
+++
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/remote/RemoteMessageHandlerTestCase.java 2010-11-13
16:51:06 UTC (rev 6158)
@@ -29,8 +29,6 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.URISyntaxException;
-import java.util.Date;
-import java.util.Random;
import org.jboss.remoting3.Client;
import org.jboss.remoting3.Connection;
@@ -61,7 +59,6 @@
private static final String WRITE_EXCEPTION_MSG = "can't write this";
private static final Logger log =
Logger.getLogger(RemoteMessageHandlerTestCase.class);
- private static int counter = new Random(new Date().getTime()).nextInt();
private boolean useBadOption;
@@ -85,8 +82,8 @@
try {
useBadOption = true;
- int id0 = counter++;
- int id1 = counter++;
+ int id0 = Math.abs(random.nextInt());
+ int id1 = Math.abs(random.nextInt());
// Set up services.
sp0 = setupServer(null, id0, new TestRequestListener(), SERVICE_TYPE,
INSTANCE_NAME);
@@ -136,8 +133,8 @@
Client<Object, Object> client = null;
try {
- int id0 = counter++;
- int id1 = counter++;
+ int id0 = Math.abs(random.nextInt());
+ int id1 = Math.abs(random.nextInt());
// Set up services.
sp0 = setupServer(null, id0, new TestRequestListener(), SERVICE_TYPE,
INSTANCE_NAME);
@@ -187,8 +184,8 @@
Client<Object, Object> client = null;
try {
- int id0 = counter++;
- int id1 = counter++;
+ int id0 = Math.abs(random.nextInt());
+ int id1 = Math.abs(random.nextInt());
// Set up services.
sp0 = setupServer(null, id0, new TestRequestListener(), SERVICE_TYPE,
INSTANCE_NAME);
@@ -239,8 +236,8 @@
// Client<Object, Object> client = null;
//
// try {
-// int id0 = counter++;
-// int id1 = counter++;
+// int id0 = Math.abs(random.nextInt());
+// int id1 = Math.abs(random.nextInt());
//
// // Set up services.
// sp0 = setupServer(null, id0, new TestRequestListener(), SERVICE_TYPE,
INSTANCE_NAME);
Show replies by date