[jboss-cvs] JBoss Messaging SVN: r2026 - in trunk/tests/src/org/jboss/test/thirdparty/remoting: util and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 23 08:46:02 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-01-23 08:46:01 -0500 (Tue, 23 Jan 2007)
New Revision: 2026

Modified:
   trunk/tests/src/org/jboss/test/thirdparty/remoting/PureAsynchronousCallTest.java
   trunk/tests/src/org/jboss/test/thirdparty/remoting/util/RemotingTestSubsystem.java
Log:
some sort of test for http://jira.jboss.com/jira/browse/JBMESSAGING-771

Modified: trunk/tests/src/org/jboss/test/thirdparty/remoting/PureAsynchronousCallTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/thirdparty/remoting/PureAsynchronousCallTest.java	2007-01-23 13:25:10 UTC (rev 2025)
+++ trunk/tests/src/org/jboss/test/thirdparty/remoting/PureAsynchronousCallTest.java	2007-01-23 13:46:01 UTC (rev 2026)
@@ -93,6 +93,50 @@
       }
    }
 
+   /**
+    * Send a lot of oneway calls to make sure remoting returns sockets back to pool.
+    */
+   public void testManyOnewayCalls() throws Throwable
+   {
+      if (!isRemote())
+      {
+         fail("This test should be run in a remote configuration!");
+      }
+
+      Client client = null;
+      ObjectName subsystemService = null;
+
+      try
+      {
+         subsystemService = RemotingTestSubsystemService.deployService();
+
+         client = new Client(serverLocator, RemotingTestSubsystemService.SUBSYSTEM_LABEL);
+
+         client.connect();
+
+         // send a ton of invocations
+         int COUNT = 200;
+
+         for(int i = 0; i < COUNT; i++)
+         {
+            client.invokeOneway("ignore");
+         }
+
+         // wait a bit until all invocations are flushed from the server-side pool
+         Thread.sleep(5000);
+      }
+      finally
+      {
+         if (client != null)
+         {
+            client.disconnect();
+         }
+
+         RemotingTestSubsystemService.undeployService(subsystemService);
+      }
+   }
+
+
    public void testAsynchronousCallback() throws Throwable
    {
       if (!isRemote())

Modified: trunk/tests/src/org/jboss/test/thirdparty/remoting/util/RemotingTestSubsystem.java
===================================================================
--- trunk/tests/src/org/jboss/test/thirdparty/remoting/util/RemotingTestSubsystem.java	2007-01-23 13:25:10 UTC (rev 2025)
+++ trunk/tests/src/org/jboss/test/thirdparty/remoting/util/RemotingTestSubsystem.java	2007-01-23 13:46:01 UTC (rev 2026)
@@ -67,10 +67,18 @@
    {
       log.debug(this + " received " + invocation);
 
+      Object parameter = invocation.getParameter();
+
+      if ("ignore".equals(parameter))
+      {
+         // used in stress tests, do not accumulate record the invocation in history, since the
+         // client is goint to send a lot of them ....
+         log.debug(this + " ignoring invocation");
+         return null;
+      }
+
       invocationHistory.put(invocation);
 
-      Object parameter = invocation.getParameter();
-
       if (parameter instanceof CallbackTrigger)
       {
          Callback callback = new Callback(((CallbackTrigger)parameter).getPayload());




More information about the jboss-cvs-commits mailing list