Package org.apache.tuscany.core.mock.component

Examples of org.apache.tuscany.core.mock.component.SimpleTargetImpl


        // connect the source to the target
        source.setTargetInterceptor(target.getHeadInterceptor());
        source.prepare();
        target.prepare();
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        Message msg = new MessageImpl();
        msg.setTargetInvoker(invoker);
        Message response = source.getHeadInterceptor().invoke(msg);
View Full Code Here


    public void testInterceptorInvoke() throws Throwable {
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(SimpleTarget.class);
        Operation<?> operation = contract.getOperations().get("echo");
        MockStaticInvoker invoker = new MockStaticInvoker(echo, new SimpleTargetImpl());
        OutboundInvocationChain chain = new OutboundInvocationChainImpl(operation);
        MockSyncInterceptor interceptor = new MockSyncInterceptor();
        chain.addInterceptor(interceptor);
        chain.setTargetInterceptor(new InvokerInterceptor());
        chain.setTargetInvoker(invoker);
View Full Code Here

    public void setUp() throws Exception {
        hello = Hello.class.getMethod("hello", String.class);
    }

    public void testMediation() throws Exception {
        StaticPojoTargetInvoker invoker = new StaticPojoTargetInvoker(hello, new SimpleTargetImpl());
        Assert.assertEquals("foo", invoker.invokeTarget("foo"));
    }
View Full Code Here

    }

    public void testDirectErrorInvoke() throws Throwable {
        Operation operation = contract.getOperations().get("hello");
        OutboundInvocationChain source = new OutboundInvocationChainImpl(operation);
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        OutboundWire wire = new OutboundWireImpl();
        wire.setServiceContract(contract);
        wire.addInvocationChain(operation, source);
View Full Code Here

    }

    public void testDirectInvoke() throws Throwable {
        Operation operation = contract.getOperations().get("hello");
        OutboundInvocationChain source = new OutboundInvocationChainImpl(operation);
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        OutboundWire wire = new OutboundWireImpl();
        wire.setServiceContract(contract);
        wire.addInvocationChain(operation, source);
View Full Code Here

        // connect the source to the target
        source.setTargetInterceptor(targetInterceptor);
        source.prepare();
        target.prepare();
        Method method = JavaIDLUtils.findMethod(operation, SimpleTarget.class.getMethods());
        MockStaticInvoker invoker = new MockStaticInvoker(method, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);
        return source;
    }
View Full Code Here

        // connect the source to the target
        source.setTargetInterceptor(target.getHeadInterceptor());
        source.prepare();
        target.prepare();
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        Message msg = new MessageImpl();
        msg.setBody("foo");
        msg.setTargetInvoker(invoker);
View Full Code Here

    private Method echo;
    private Operation operation;

    public void testInterceptorInvoke() throws Throwable {
        Map<Method, InboundInvocationChain> chains = new HashMap<Method, InboundInvocationChain>();
        MockStaticInvoker invoker = new MockStaticInvoker(echo, new SimpleTargetImpl());
        InboundInvocationChain chain = new InboundInvocationChainImpl(operation);
        MockSyncInterceptor interceptor = new MockSyncInterceptor();
        chain.addInterceptor(interceptor);
        chain.addInterceptor(new InvokerInterceptor());
        chain.setTargetInvoker(invoker);
View Full Code Here

    }


    public void testDirectErrorInvoke() throws Throwable {
        InboundInvocationChain source = new InboundInvocationChainImpl(operation);
        MockStaticInvoker invoker = new MockStaticInvoker(echo, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        Map<Method, InboundInvocationChain> chains = new HashMap<Method, InboundInvocationChain>();
        chains.put(echo, source);
        WorkContext workContext = EasyMock.createNiceMock(WorkContext.class);
View Full Code Here

        }
    }

    public void testDirectInvoke() throws Throwable {
        InboundInvocationChain source = new InboundInvocationChainImpl(operation);
        MockStaticInvoker invoker = new MockStaticInvoker(echo, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        Map<Method, InboundInvocationChain> chains = new HashMap<Method, InboundInvocationChain>();
        chains.put(echo, source);
        WorkContext workContext = EasyMock.createNiceMock(WorkContext.class);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.mock.component.SimpleTargetImpl

Copyright © 2018 www.massapicom. 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.