Examples of EchoImpl


Examples of org.apache.commons.proxy.util.EchoImpl

        }
    }

    public void testProxyWithUncheckedException() throws Exception
    {
        final Echo proxy = ( Echo ) factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() ), ECHO_ONLY );
        try
        {
            proxy.illegalArgument();
            fail();
        }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

        }
    }

    public void testInterceptorProxyWithUncheckedException() throws Exception
    {
        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),  ECHO_ONLY );
        try
        {
            proxy.illegalArgument();
            fail();
        }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

        }
    }

    public void testInterceptorProxyWithCheckedException() throws Exception
    {
        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY );
        try
        {
            proxy.ioException();
            fail();
        }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

    }

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

Examples of org.apache.commons.proxy.util.EchoImpl

        super( factory );
    }

    public void testWithAbstractSuperclass()
    {
        final Echo echo = ( Echo )factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() )new Class[] { AbstractEcho.class } );
        assertEquals( "hello", echo.echoBack( "hello" ) );
        assertEquals( "helloworld", echo.echoBack( "hello", "world" ) );
    }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

    }

    public void testDelegatorWithSuperclass()
    {
        final Echo echo = ( Echo ) factory
                .createDelegatorProxy( new ConstantProvider( new EchoImpl() )new Class[] { Echo.class, EchoImpl.class } );
        assertTrue( echo instanceof EchoImpl );
    }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

    }

    public void testInterceptorWithSuperclass()
    {
        final Echo echo = ( Echo ) factory
                .createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor()new Class[] { Echo.class, EchoImpl.class } );
        assertTrue( echo instanceof EchoImpl );
    }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

    }

    public void testProxiesWithClashingFinalMethodInSuperclass()
    {
        final Class[] proxyClasses = new Class[]{Echo.class, FinalMethodEcho.class};
        Echo proxy = ( Echo )factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() ), proxyClasses );
        assertEquals( "final", proxy.echoBack("echo") );

        proxy = ( Echo )factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(), proxyClasses );
        assertEquals( "final", proxy.echoBack("echo") );

        proxy = ( Echo )factory.createInvokerProxy( new NullInvoker(), proxyClasses );
        assertEquals( "final", proxy.echoBack("echo") );
    }
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

    public void testDelegatorWithMultipleSuperclasses()
    {
        try
        {
            factory.createDelegatorProxy( new ConstantProvider( new EchoImpl() ),
                                           new Class[] { EchoImpl.class, String.class } );
            fail();
        }
        catch( ProxyFactoryException e )
        {
View Full Code Here

Examples of org.apache.commons.proxy.util.EchoImpl

    public void testInterceptorWithMultipleSuperclasses()
    {
        try
        {
            factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),
                                             new Class[] { EchoImpl.class, String.class } );
            fail();
        }
        catch( ProxyFactoryException e )
        {
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.