Examples of OperationImpl


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

        }

    }

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

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

        this.handler = new JAXBWrapperHandler();
    }

    public void testCreate() {
        ElementInfo element = new ElementInfo(ELEMENT, null);
        Operation op = new OperationImpl();
        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, element, null);
        wrapperInfo.setWrapperType(new DataTypeImpl<XMLType>(JAXBDataBinding.NAME, StockQuoteOffer.class,
                                                             XMLType.UNKNOWN));
        op.setInputWrapper(wrapperInfo);
        Object offer = handler.create(op, true);
        Assert.assertTrue(offer instanceof StockQuoteOffer);
    }
View Full Code Here

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

        StockQuoteOffer wrapper = new StockQuoteOffer();
        wrapper.setInput("IBM");
        List<ElementInfo> elements = new ArrayList<ElementInfo>();
        elements.add(new ElementInfo(INPUT, null));
        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, null, elements);
        Operation op = new OperationImpl();
        op.setInputWrapper(wrapperInfo);
        List children = handler.getChildren(wrapper, op, true);
        assertNotNull(children);
        assertEquals(1, children.size());
        assertEquals("IBM", children.get(0));
    }
View Full Code Here

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

        @DataBinding("xml:string")
        String call1(String msg);
    }

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

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

     * @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

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

                            policyProcessor.readPolicies(abstractProperty, reader);
                           
                        } else if (OPERATION_QNAME.equals(name)) {
   
                            // Read an <operation>
                            Operation operation = new OperationImpl();
                            operation.setName(getString(reader, NAME));
                            operation.setUnresolved(true);
                            policyProcessor.readPolicies(abstractContract, operation, reader);
                           
                        } else {
   
                            // Read an extension element
View Full Code Here

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

    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

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

    }

    public void testWrapperAnyType() throws Exception {
        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

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

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

    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);
        op.setInputWrapper(wrapperInfo);
        DataObject wrapper = (DataObject) handler.create(op, true);
        assertNotNull(wrapper);
    }
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.