Author: ron.sigal(a)jboss.com
Date: 2008-02-23 01:43:04 -0500 (Sat, 23 Feb 2008)
New Revision: 3494
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java
Log:
JBREM-877: Added testEventualDestruction().
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java 2008-02-23
06:35:05 UTC (rev 3493)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java 2008-02-23
06:43:04 UTC (rev 3494)
@@ -37,6 +37,7 @@
import org.jboss.remoting.Client;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.InvokerRegistry;
import org.jboss.remoting.ServerInvocationHandler;
import org.jboss.remoting.ServerInvoker;
import org.jboss.remoting.callback.Callback;
@@ -231,6 +232,36 @@
}
+ public void testEventualDestruction() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ setupServer();
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(Client.INVOKER_DESTRUCTION_DELAY, "5000");
+ addExtraClientConfig(clientConfig);
+
+ for (int i = 0; i < 50; i++)
+ {
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ assertEquals("abc", client.invoke("abc"));
+ client.disconnect();
+ }
+
+ Thread.sleep(10000);
+ assertEquals(0, InvokerRegistry.getClientInvokers().length);
+
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
protected String getTransport()
{
return "socket";
Show replies by date