public void testMethodInvocationImplementation() throws Exception
{
final InterceptorTester tester = new InterceptorTester();
final EchoImpl target = new EchoImpl();
final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, ECHO_ONLY );
proxy.echo();
assertNotNull( tester.arguments );
assertEquals( 0, tester.arguments.length );
assertEquals( Echo.class.getMethod( "echo", new Class[] {} ), tester.method );
assertEquals( target, tester.proxy );
proxy.echoBack( "Hello" );
assertNotNull( tester.arguments );
assertEquals( 1, tester.arguments.length );
assertEquals( "Hello", tester.arguments[0] );
assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class } ), tester.method );
proxy.echoBack( "Hello", "World" );
assertNotNull( tester.arguments );
assertEquals( 2, tester.arguments.length );
assertEquals( "Hello", tester.arguments[0] );
assertEquals( "World", tester.arguments[1] );
assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class, String.class } ), tester.method );