Package org.apache.tuscany.sca.interfacedef.impl

Examples of org.apache.tuscany.sca.interfacedef.impl.OperationImpl


    public void testWrapper() throws Exception {
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        Operation op = new OperationImpl();
        List children = handler.getChildren(document, op, true);
        assertEquals(5, children.size());
    }
View Full Code Here


    public void testCreate() {
        HelperContext context = HelperProvider.getDefaultContext();
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        ElementInfo element = new ElementInfo(new QName("http://www.example.com/wrapper", "op"), null);
        Operation op = new OperationImpl();
        WrapperInfo wrapperInfo = new WrapperInfo(SDODataBinding.NAME, element, null, null, null);
        op.setWrapper(wrapperInfo);
        DataObject wrapper = (DataObject) handler.create(op, true);
        assertNotNull(wrapper);
    }
View Full Code Here

        // EasyMock.verify(requestJMSMsg);
        // EasyMock.verify(runtimeWire);
    }

    private static Operation newOperation(String name) {
        Operation operation = new OperationImpl();
        operation.setName(name);
        return operation;
    }
View Full Code Here

        jmsBinding.setDestinationName(requestDestinationName);
        jmsBinding.setResponseDestinationName(responseDestinationName);
        jmsBinding.setName(jmsBindingName);

        // Create the operation
        Operation operation = new OperationImpl();
        operation.setName("OperationName");

        // Try and create the JMS Binding Invoker for the JMS Binding
        try {
            new JMSBindingInvoker(jmsBinding, operation, null);
View Full Code Here

    protected Service createDynamicService() {
        Service dynamicService = assemblyFactory.createService();
        dynamicService.setName("$dynamic$");
        InterfaceContract dynamicInterfaceContract = new InterfaceContractImpl() {};
        Interface dynamicInterface = new DynamicInterfaceImpl();
        Operation dynamicOperation = new OperationImpl();
        dynamicOperation.setDynamic(true);
        dynamicInterface.getOperations().add(dynamicOperation);
        dynamicInterfaceContract.setInterface(dynamicInterface);
        dynamicService.setInterfaceContract(dynamicInterfaceContract);

        return dynamicService;
View Full Code Here

     * @param parameterTypes The types of the parameters for this operation
     * @return An operation with the specified name and parameter types
     */
    private static Operation newOperation(String name, Class operationInterface, Class... parameterTypes) {
        // Create and set the operation name
        Operation operation = new OperationImpl();
        operation.setName(name);

        // Make the operation remotable
        Interface iface = new InterfaceImpl();
        iface.setRemotable(true);
        operation.setInterface(iface);

        // Construct the parameters
        List<DataType> types = new ArrayList<DataType>();
        DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
        for (Class parameterType : parameterTypes) {
            DataType type = new DataTypeImpl<Class>(parameterType, Object.class);
            types.add(type);
        }
        operation.setInputType(inputType);

        // Return the created operation
        return operation;
    }
View Full Code Here

                }
            }

            DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class,
                                                                                  paramDataTypes);
            Operation operation = new OperationImpl(name);
            operation.setInputType(inputType);
            operation.setOutputType(returnDataType);
            operation.setFaultTypes(faultDataTypes);
            operation.setConversationSequence(conversationSequence);
            operation.setNonBlocking(nonBlocking);
            operations.add(operation);
        }
        return operations;
    }
View Full Code Here

     * @throws NotSupportedWSDLException
     */
    public Operation getOperation() throws InvalidWSDLException {
        if (operationModel == null) {
            boolean oneway = (operation.getOutput() == null);
            operationModel = new OperationImpl();
            operationModel.setName(operation.getName());
            operationModel.setFaultTypes(getFaultTypes());
            operationModel.setNonBlocking(oneway);
            operationModel.setConversationSequence(ConversationSequence.CONVERSATION_NONE);
            operationModel.setInputType(getInputType());
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        Operation operation = new OperationImpl("foo");
        List<DataType> types = new ArrayList<DataType>();
        DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
        operation.setInputType(inputType);

        operations = new ArrayList<Operation>();
        operations.add(operation);

        types = new ArrayList<DataType>();
        inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
        DataType type = new DataTypeImpl<Class>(String.class, Object.class);
        types.add(type);
        operation = new OperationImpl("foo");
        operation.setInputType(inputType);
        operations.add(operation);

        types = new ArrayList<DataType>();
        type = new DataTypeImpl<Class>(String.class, Object.class);
        DataType type2 = new DataTypeImpl<Class>(String.class, Object.class);
        types.add(type);
        types.add(type2);
        inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
        operation = new OperationImpl("foo");
        operation.setInputType(inputType);
        operations.add(operation);

        types = new ArrayList<DataType>();
        type = new DataTypeImpl<Class>(Integer.class, Object.class);
        types.add(type);
        inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
        operation = new OperationImpl("foo");
        operation.setInputType(inputType);
        operations.add(operation);

        types = new ArrayList<DataType>();
        type = new DataTypeImpl<Class>(Integer.TYPE, Object.class);
        types.add(type);
        inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
        operation = new OperationImpl("foo");
        operation.setInputType(inputType);
        operations.add(operation);

    }
View Full Code Here

    public Wire createWire() {
        return new WireImpl();
    }

    public Operation createOperation() {
        return new OperationImpl();
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.impl.OperationImpl

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.