[jboss-remoting-commits] JBoss Remoting SVN: r5654 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Jan 8 17:51:51 EST 2010


Author: ron.sigal at jboss.com
Date: 2010-01-08 17:51:51 -0500 (Fri, 08 Jan 2010)
New Revision: 5654

Modified:
   remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java
Log:
JBREM-1176: Added testConfigByInvokerLocator() from version on branch 2.2.

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	2010-01-08 22:48:56 UTC (rev 5653)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/invoker/ClientInvokerDelayedDestructionTestCase.java	2010-01-08 22:51:51 UTC (rev 5654)
@@ -340,8 +340,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";



More information about the jboss-remoting-commits mailing list