Package org.apache.tuscany.core.wire.jdk

Examples of org.apache.tuscany.core.wire.jdk.JDKOutboundInvocationHandler.invoke()


        //chains.put(echo, chain);
        OutboundWire wire = new OutboundWireImpl();
        wire.addInvocationChain(operation, chain);
        wire.setServiceContract(contract);
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        assertEquals("foo", handler.invoke(null, echo, new String[]{"foo"}));
        assertEquals(1, interceptor.getCount());
    }

    public void setUp() throws Exception {
        super.setUp();
View Full Code Here


        OutboundWire wire = new OutboundWireImpl();
        Operation operation = contract.getOperations().get("hello");
        wire.addInvocationChain(operation, createChain(operation));
        wire.setServiceContract(contract);
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        assertEquals("foo", handler.invoke(hello, new Object[]{"foo"}));
    }

    public void testErrorInvoke() throws Throwable {
        OutboundWire wire = new OutboundWireImpl();
        Operation operation = contract.getOperations().get("hello");
View Full Code Here

        Operation operation = contract.getOperations().get("hello");
        wire.addInvocationChain(operation, createChain(operation));
        wire.setServiceContract(contract);
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        try {
            handler.invoke(hello, new Object[]{});
            fail("Expected " + IllegalArgumentException.class.getName());
        } catch (IllegalArgumentException e) {
            // should throw
        }
    }
View Full Code Here

        OutboundWire wire = new OutboundWireImpl();
        wire.setServiceContract(contract);
        wire.addInvocationChain(operation, source);
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        try {
            assertEquals("foo", handler.invoke(hello, new Object[]{}));
            fail("Expected " + IllegalArgumentException.class.getName());
        } catch (IllegalArgumentException e) {
            // should throw
        }
    }
View Full Code Here

        OutboundWire wire = new OutboundWireImpl();
        wire.setServiceContract(contract);
        wire.addInvocationChain(operation, source);
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        assertEquals("foo", handler.invoke(hello, new Object[]{"foo"}));
    }

    private OutboundInvocationChain createChain(Operation operation) {
        OutboundInvocationChain source = new OutboundInvocationChainImpl(operation);
        MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor();
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.