Examples of EchoImpl


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

public class TestMethodInterceptorAdapter extends TestCase
{
    public void testMethodInterception()
    {
        final Echo proxy = ( Echo ) new JavassistProxyFactory().createInterceptorProxy( new EchoImpl(),
                                                                                         new MethodInterceptorAdapter( new SuffixMethodInterceptor(
                                                                                                 " suffix" ) ),
                                                                                         new Class[]{ Echo.class } );
        assertEquals( "message suffix", proxy.echoBack( "message" ) );
    }
View Full Code Here

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

    }

    public void testMethodInvocationImplementation() throws Exception
    {
        final InterceptorTester tester = new InterceptorTester();
        final EchoImpl target = new EchoImpl();
        final Echo proxy = ( Echo ) new JavassistProxyFactory().createInterceptorProxy( target, new MethodInterceptorAdapter( tester ), new Class[] { Echo.class } );
        proxy.echo();
        assertNotNull( tester.invocation.getArguments() );
        assertEquals( 0, tester.invocation.getArguments().length );
        assertEquals( Echo.class.getMethod( "echo", new Class[] {} ), tester.invocation.getMethod() );
View Full Code Here

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

*/
public class TestInterceptorChain extends TestCase
{
    public void testWithSingleInterceptor()
    {
        Echo echo = ( Echo ) new InterceptorChain( new Interceptor[] { new SuffixInterceptor( "a" ) } ).createProxyProvider( new CglibProxyFactory(), new EchoImpl()new Class[] { Echo.class } ).getObject();
        assertEquals( "messagea", echo.echoBack( "message" ) );
    }
View Full Code Here

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

        assertEquals( "messagea", echo.echoBack( "message" ) );
    }

    public void testWithMultipleInterceptors()
    {
        Echo echo = ( Echo ) new InterceptorChain( new Interceptor[] { new SuffixInterceptor( "a" ), new SuffixInterceptor( "b" ) } ).createProxyProvider( new CglibProxyFactory(), new EchoImpl()new Class[] { Echo.class } ).getObject();
        assertEquals( "messageba", echo.echoBack( "message" ) );
    }
View Full Code Here

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

    protected void setUp() throws Exception
    {
        logMock = mock( Log.class );
        echo = ( Echo ) new CglibProxyFactory()
                .createInterceptorProxy( new EchoImpl(), new LoggingInterceptor( ( Log ) logMock.proxy() ),
                                         new Class[]{ Echo.class } );
    }
View Full Code Here

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

    public void testWhenLoggingDisabled()
    {
        logMock = mock( Log.class );
        echo = ( Echo ) new CglibProxyFactory()
                .createInterceptorProxy( new EchoImpl(), new LoggingInterceptor( ( Log ) logMock.proxy() ),
                                         new Class[]{ Echo.class } );
        logMock.expects( once() ).method( "isDebugEnabled" ).will( returnValue( false ) );
        echo.echoBack( "Hello" );

    }
View Full Code Here

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

*/
public class TestFilteredInterceptor extends TestCase
{
    public void testFilterAccepts()
    {
        Echo echo = ( Echo ) new InterceptorChain( new Interceptor[] { new FilteredInterceptor( new SuffixInterceptor( "a" ), new SimpleFilter( new String[] { "echoBack" } ) ) } ).createProxyProvider( new CglibProxyFactory(), new EchoImpl() ).getObject();
        assertEquals( "messagea", echo.echoBack( "message" ) );
    }
View Full Code Here

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

        assertEquals( "messagea", echo.echoBack( "message" ) );
    }

    public void testFilterDenies()
    {
        Echo echo = ( Echo ) new InterceptorChain( new Interceptor[] { new FilteredInterceptor( new SuffixInterceptor( "a" ), new SimpleFilter() ) } ).createProxyProvider( new CglibProxyFactory(), new EchoImpl() ).getObject();
        assertEquals( "message", echo.echoBack( "message" ) );
    }
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.EchoImpl

   
   
    private Service createService() {
        // Create the Service
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setServiceBean(new EchoImpl());
        factory.setAddress("local://Echo");
        factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
        Server server = factory.create();
       
        Service service = server.getEndpoint().getService();
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.EchoImpl

    }
   
    private Service createService() {
        // Create the Service
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setServiceBean(new EchoImpl());
        factory.setAddress("local://Echo");
        factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
        Server server = factory.create();
       
        Service service = server.getEndpoint().getService();
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.