Examples of SimpleTargetImpl


Examples of org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl

        targetFactory.setConfiguration(targetConfig);
        targetFactory.setBusinessInterface(SimpleTarget.class);

        // bootstrap a scope container with the target in it
        Map<String,Object> instances = new HashMap<String,Object>();
        SimpleTarget simpleTarget = new SimpleTargetImpl();
        instances.put("target",simpleTarget);
        MockScopeContext scopeCtx = new MockScopeContext(instances);

        // connect the source to the target
        DefaultWireBuilder builder = new DefaultWireBuilder();
View Full Code Here

Examples of org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl

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

    public void testMediation() throws Exception {
        StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(hello, new SimpleTargetImpl());
        Message msg = msgFactory.createMessage();
        msg.setBody("foo");
        Assert.assertEquals("foo", invoker.invoke(msg).getBody());
    }
View Full Code Here

Examples of org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl

    Map<String, Object> components;

    public MockScopeContext() {
        components = new HashMap<String, Object>();
        components.put("foo", new SimpleTargetImpl());
        components.put("bar", new SimpleTargetImpl());
    }
View Full Code Here

Examples of org.apache.tuscany.core.async.wire.mock.SimpleTargetImpl

        source.build();
        target.build();
       
        CountDownLatch startSignal = new CountDownLatch(1);
        CountDownLatch doneSignal = new CountDownLatch(1);
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl(startSignal, doneSignal));
        source.setTargetInvoker(invoker);

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

Examples of org.apache.tuscany.core.async.wire.mock.SimpleTargetImpl

        source.build();
        target.build();

        CountDownLatch startSignal = new CountDownLatch(1);
        CountDownLatch doneSignal = new CountDownLatch(1);
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl(startSignal, doneSignal));
        source.setTargetInvoker(invoker);

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

Examples of org.apache.tuscany.core.async.wire.mock.SimpleTargetImpl

        source.build();
        target.build();

        CountDownLatch startSignal = new CountDownLatch(1);
        CountDownLatch doneSignal = new CountDownLatch(1);
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl(startSignal, doneSignal));
        source.setTargetInvoker(invoker);

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

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

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

    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

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

    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

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

    }

    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
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.