[jboss-cvs] JBoss Messaging SVN: r2050 - trunk/tests/src/org/jboss/test/thirdparty/remoting/util.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 25 04:34:52 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-01-25 04:34:52 -0500 (Thu, 25 Jan 2007)
New Revision: 2050

Modified:
   trunk/tests/src/org/jboss/test/thirdparty/remoting/util/RemotingTestSubsystem.java
Log:
extra fix for http://jira.jboss.org/jira/browse/JBMESSAGING-780. Now I really hope they work

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-25 07:10:05 UTC (rev 2049)
+++ trunk/tests/src/org/jboss/test/thirdparty/remoting/util/RemotingTestSubsystem.java	2007-01-25 09:34:52 UTC (rev 2050)
@@ -13,7 +13,6 @@
 import org.jboss.remoting.callback.Callback;
 import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
 import org.jboss.logging.Logger;
-import org.jboss.test.thirdparty.remoting.util.CallbackTrigger;
 
 import javax.management.MBeanServer;
 import java.io.Serializable;
@@ -40,6 +39,21 @@
 
    // Static ---------------------------------------------------------------------------------------
 
+   /**
+    * Very quick and dirty method. Don't try it at home. Needed it because some InvocationRequests
+    * (even if the class is declared Serializable) contain request and response payloads which are
+    * not, so I am having trouble sending them over wire back to the client.
+    */
+   private static InvocationRequest dirtyCopy(InvocationRequest source)
+   {
+      return new InvocationRequest(source.getSessionId(),
+                                   source.getSubsystem(),
+                                   source.getParameter(),
+                                   null,
+                                   null,
+                                   source.getLocator());
+   }
+
    // Attributes -----------------------------------------------------------------------------------
 
    private Channel invocationHistory;
@@ -77,11 +91,7 @@
          return null;
       }
 
-      // before putting invocation in history, clear the request and response payloads, for they
-      // are non-serializable for HTTP invocations, and they are useless for our tests anyway
-      invocation.setRequestPayload(null);
-      invocation.setReturnPayload(null);
-      invocationHistory.put(invocation);
+      invocationHistory.put(dirtyCopy(invocation));
 
       if (parameter instanceof CallbackTrigger)
       {




More information about the jboss-cvs-commits mailing list