commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (PROXY-4) SerializingInterceptor
Date Tue, 23 Oct 2007 12:28:50 GMT

     [ https://issues.apache.org/jira/browse/PROXY-4?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Carman resolved PROXY-4.
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

> SerializingInterceptor
> ----------------------
>
>                 Key: PROXY-4
>                 URL: https://issues.apache.org/jira/browse/PROXY-4
>             Project: Commons Proxy
>          Issue Type: New Feature
>            Reporter: James Carman
>            Assignee: James Carman
>             Fix For: 1.0
>
>
> When unit testing classes that are going to be invoked remotely, it's important to test
that the parameters and return types can be serialized/deserialized properly.  What if commons-proxy
included a neat little helper class that makes a serialized copy of the parameters of an invocation
before passing them to the target object and then makes a serialized copy of the return value
before returning it?
> public class SerializingInterceptor
> {
>   public Object intercept(Invocation invocation)
>   {
>     Object[] argumentsCopy = ( Object[] )serializedCopy(invocation.getArguments());
>     System.arrayCopy(argumentsCopy,0,invocation.getArguments(),0,argumentsCopy.length);
>     return serializedCopy(invocation.proceed());  
>   }
>   private Object serializedCopy(Serializable original);
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message