Author: ron.sigal(a)jboss.com
Date: 2009-09-17 10:33:25 -0400 (Thu, 17 Sep 2009)
New Revision: 5516
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/socketexception/BisocketSocketCreationExceptionTestCase.java
Log:
JBREM-1152: Fixed ConcurrentModificationException.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/socketexception/BisocketSocketCreationExceptionTestCase.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/socketexception/BisocketSocketCreationExceptionTestCase.java 2009-09-17
04:30:56 UTC (rev 5515)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/socketexception/BisocketSocketCreationExceptionTestCase.java 2009-09-17
14:33:25 UTC (rev 5516)
@@ -28,7 +28,6 @@
import java.net.Socket;
import java.net.SocketException;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -97,20 +96,20 @@
// Verify MicroSocketClientInvoker retries invocation after failure to get a
connection.
client.invoke(SEND_CALLBACK);
assertEquals(1, callbackHandler.received);
- Set serverThreads = clientpool.getContents();
- Iterator it = serverThreads.iterator();
- while (it.hasNext())
+ Set set = clientpool.getContents();
+ Object[] serverThreads = set.toArray();
+ for (int i = 0; i < serverThreads.length; i++)
{
- ServerThread st = (ServerThread) it.next();
+ ServerThread st = (ServerThread) serverThreads[i];
st.shutdown();
}
client.invoke(SEND_CALLBACK);
assertEquals(2, callbackHandler.received);
- serverThreads = clientpool.getContents();
- it = serverThreads.iterator();
- while (it.hasNext())
+ set = clientpool.getContents();
+ serverThreads = set.toArray();
+ for (int i = 0; i < serverThreads.length; i++)
{
- ServerThread st = (ServerThread) it.next();
+ ServerThread st = (ServerThread) serverThreads[i];
st.shutdown();
}
client.invoke(SEND_CALLBACK);
Show replies by date