Author: ron.sigal(a)jboss.com
Date: 2009-08-12 20:37:00 -0400 (Wed, 12 Aug 2009)
New Revision: 5328
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java
Log:
JBREM-1143: Added testConfigByInvokerLocator().
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java
===================================================================
---
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java 2009-08-13
00:36:07 UTC (rev 5327)
+++
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java 2009-08-13
00:37:00 UTC (rev 5328)
@@ -304,8 +304,44 @@
shutdownServer();
log.info(getName() + " PASSES");
}
+
+ public void testConfigByInvokerLocator() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ setupServer();
+
+ // Create client.
+ String clientLocatorURI = locatorURI +
"/?invokerDestructionDelay=10000";
+ InvokerLocator clientLocator = new InvokerLocator(clientLocatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ ClientInvoker invoker1 = client.getInvoker();
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good for first client");
+ client.disconnect();
+
+ Thread.sleep(5000);
+ client = new Client(clientLocator, clientConfig);
+ client.connect();
+ ClientInvoker invoker2 = client.getInvoker();
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good for second client");
+ assertSame(invoker2, invoker1);
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
protected String getTransport()
{
return "socket";
Show replies by date