Examples of echoBack()


Examples of org.apache.commons.proxy.util.Echo.echoBack()

    public void testCreateDelegatingProxy()
    {
        final Echo echo = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
        echo.echo();
        assertEquals( "message", echo.echoBack( "message" ) );
        assertEquals( "ab", echo.echoBack( "a", "b" ) );
    }

    public void testBooleanInterceptorParameter()
    {
        final Echo echo = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new  InterceptorTester(), ECHO_ONLY );
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

    }

    public void testBooleanInterceptorParameter()
    {
        final Echo echo = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new  InterceptorTester(), ECHO_ONLY );
        assertFalse( echo.echoBack( false ) );
        assertTrue( echo.echoBack( true ) );

    }
    public void testPrimitiveParameter()
    {
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

    public void testBooleanInterceptorParameter()
    {
        final Echo echo = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new  InterceptorTester(), ECHO_ONLY );
        assertFalse( echo.echoBack( false ) );
        assertTrue( echo.echoBack( true ) );

    }
    public void testPrimitiveParameter()
    {
        final Echo echo = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

    }
    public void testPrimitiveParameter()
    {
        final Echo echo = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
        assertEquals( 1, echo.echoBack( 1 ) );
    }

    public void testCreateInterceptorProxy()
    {
        final Echo target = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

    public void testCreateInterceptorProxy()
    {
        final Echo target = ( Echo ) factory.createDelegatorProxy( createSingletonEcho(), ECHO_ONLY );
        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, new SuffixInterceptor( " suffix" ), ECHO_ONLY );
        proxy.echo();
        assertEquals( "message suffix", proxy.echoBack( "message" ) );
    }

    private ObjectProvider createSingletonEcho()
    {
        return new SingletonProvider( new BeanProvider( EchoImpl.class ) );
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

        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" );
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

        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 );
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

    public void testMethodInvocationDuplicateMethods() throws Exception
    {
        final InterceptorTester tester = new InterceptorTester();
        final EchoImpl target = new EchoImpl();
        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, new Class[] { Echo.class, DuplicateEcho.class } );
        proxy.echoBack( "hello" );
        assertEquals( Echo.class.getMethod( "echoBack", new Class[] { String.class } ), tester.method );
    }


    public void testMethodInvocationClassCaching() throws Exception
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

        final EchoImpl target = new EchoImpl();
        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( target, tester, ECHO_ONLY );
        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( target, tester, new Class[] { Echo.class, DuplicateEcho.class } );
        proxy1.echoBack( "hello1" );
        final Class invocationClass1 = tester.invocationClass;
        proxy2.echoBack( "hello2" );
        assertEquals( invocationClass1, tester.invocationClass );
    }

    public void testDelegatingProxyClassCaching() throws Exception
    {
View Full Code Here

Examples of org.apache.commons.proxy.util.Echo.echoBack()

    }

    public void testChangingArguments()
    {
        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new ChangeArgumentInterceptor(), ECHO_ONLY );
        assertEquals( "something different", proxy.echoBack( "whatever" ) );
    }

    private static class PrivateEcho extends EchoImpl
    {
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.