public class TestInvocationHandlerAdapter extends TestCase
{
public void testMethodInvocation() throws Exception
{
InvocationHandlerTester tester = new InvocationHandlerTester();
final Echo echo = ( Echo ) new JavassistProxyFactory().createInvokerProxy( new InvocationHandlerAdapter( tester ), new Class[] { Echo.class } );
echo.echoBack( "hello" );
assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class } ), tester.method );
assertSame( echo, tester.proxy );
assertNotNull( tester.arguments );
assertEquals( 1, tester.arguments.length );
assertEquals( "hello", tester.arguments[0] );