Package org.apache.tuscany.spi.model

Examples of org.apache.tuscany.spi.model.Operation


        assertEquals("foo", handler.invoke(hello, new Object[]{"foo"}));
    }

    public void testErrorInvoke() throws Throwable {
        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());
        try {
            handler.invoke(hello, new Object[]{});
View Full Code Here


            // should throw
        }
    }

    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();
View Full Code Here

            // should throw
        }
    }

    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();
View Full Code Here

            // callback method
            // Relaxing this assumption, however, does not seem to be trivial,
            // it may depend on knowledge
            // of what actual callback method was invoked by the service at the
            // other end
            Operation callbackOperation = findCallbackOperation();
            Axis2CallbackInvocationHandler invocationHandler =
                new Axis2CallbackInvocationHandler(inboundWire);
            Axis2ReferenceCallbackTargetInvoker callbackInvoker =
                new Axis2ReferenceCallbackTargetInvoker(callbackOperation, inboundWire, invocationHandler);
            invoker.setCallbackTargetInvoker(callbackInvoker);
View Full Code Here

        return invoker;
    }

    private Operation findCallbackOperation() {
        ServiceContract contract = inboundWire.getServiceContract();
        Operation callbackOperation = null;
        Collection callbackOperations = contract.getCallbackOperations().values();
        if (callbackOperations.size() != 1) {
            throw new Axis2BindingRunTimeException("Can only handle one callback operation");
        } else {
            callbackOperation = (Operation)callbackOperations.iterator().next();
View Full Code Here

        Map<Operation<?>, OutboundInvocationChain> invocationChains = wire.getInvocationChains();
        this.chains = new HashMap<Operation, ChainHolder>(invocationChains.size());
        this.fromAddress = (wire.getContainer() == null) ? null : wire.getContainer().getName();
        // TODO optimize this
        for (Map.Entry<Operation<?>, OutboundInvocationChain> entry : invocationChains.entrySet()) {
            Operation operation = entry.getKey();
            this.chains.put(operation, new ChainHolder(entry.getValue()));
        }

        this.context = context;
    }
View Full Code Here

public class Axis2ReferenceTestCase extends TestCase {

    public void testInvokeService() throws Exception {
        Axis2Reference axis2Reference = createAxis2Reference("testWebAppName", "testServiceName");
        Operation operation = new Operation<Type>("sayHi", null, null, null, false, null);
        TargetInvoker targetInvoker = axis2Reference.createTargetInvoker(null, operation);
        assertNotNull(targetInvoker);
    }
View Full Code Here

        contract.setCallbackOperations(callbackOps);
        EasyMock.expect(inboundWire.getServiceContract()).andReturn(contract).anyTimes();
        EasyMock.replay(inboundWire);

        axis2Reference.setInboundWire(inboundWire);
        Operation operation = new Operation<Type>("sayHi", null, null, null, true, null);
        TargetInvoker asyncTargetInvoker = axis2Reference.createAsyncTargetInvoker(null, operation);
        assertNotNull(asyncTargetInvoker);
    }
View Full Code Here

        CompositeReference compositeReference = new CompositeReference("testCompositeReferemce",
                                                                       null,
                                                                       null,
                                                                       serviceContract,
                                                                       null);
        Operation operation = new Operation<Type>("sayHi", null, null, null, false, null);
        TargetInvoker targetInvoker = compositeReference.createTargetInvoker(serviceContract, operation);
        assertNotNull(targetInvoker);
    }
View Full Code Here

        CompositeReference compositeReference = new CompositeReference("testCompositeReferemce",
                                                                       null,
                                                                       null,
                                                                       serviceContract,
                                                                       null);
        Operation operation = new Operation<Type>("sayHi", null, null, null, false, null);
        TargetInvoker targetInvoker = compositeReference.createCallbackTargetInvoker(serviceContract, operation);
        assertNotNull(targetInvoker);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.model.Operation

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.