assertEquals(1, callbackHandler.received);
Set serverThreads = clientpool.getContents();
Iterator it = serverThreads.iterator();
while (it.hasNext())
{
ServerThread st = (ServerThread) it.next();
st.shutdown();
}
client.invoke(SEND_CALLBACK);
assertEquals(2, callbackHandler.received);
serverThreads = clientpool.getContents();
it = serverThreads.iterator();
while (it.hasNext())
{
ServerThread st = (ServerThread) it.next();
st.shutdown();
}
client.invoke(SEND_CALLBACK);
assertEquals(3, callbackHandler.received);
client.removeListener(callbackHandler);