Package org.switchyard.config.model.selector

Examples of org.switchyard.config.model.selector.StaticOperationSelectorModel


    public QName selectOperation(T content) throws Exception {
        QName operationQName = null;

        if (_model instanceof StaticOperationSelectorModel) {
            StaticOperationSelectorModel staticModel = StaticOperationSelectorModel.class.cast(_model);
            operationQName = QName.valueOf(staticModel.getOperationName());

        } else if (_model instanceof XPathOperationSelectorModel) {
            XPathOperationSelectorModel xpathModel = XPathOperationSelectorModel.class.cast(_model);
            operationQName = xpathMatch(xpathModel.getExpression(), extractDomDocument(content));
        } else if (_model instanceof RegexOperationSelectorModel) {
View Full Code Here


        String namespace = "urn:operation-selector-test:1.0";
        String namespace2 = "urn:operation-selector-test:2.0";
        String operation = "invoke";
        String fullname = "{" + namespace2 + "}" + operation;

        StaticOperationSelectorModel model = new V1StaticOperationSelectorModel(SwitchYardNamespace.DEFAULT.uri());
        model.setOperationName(operation);
        OperationSelector<String> selector = new MyOperationSelector(model);
       
        QName operationQName = selector.selectOperation(null);
        Assert.assertEquals(XMLConstants.NULL_NS_URI, operationQName.getNamespaceURI());
        Assert.assertEquals(operation, operationQName.getLocalPart());
       
        selector.setDefaultNamespace(namespace);
        operationQName = selector.selectOperation(null);
        Assert.assertEquals(namespace, operationQName.getNamespaceURI());
        Assert.assertEquals(operation, operationQName.getLocalPart());
       
        model.setOperationName(fullname);
        selector = new MyOperationSelector(model);
        selector.setDefaultNamespace(namespace);
        operationQName = selector.selectOperation(null);
        Assert.assertEquals(namespace2, operationQName.getNamespaceURI());
        Assert.assertEquals(operation, operationQName.getLocalPart());
View Full Code Here

TOP

Related Classes of org.switchyard.config.model.selector.StaticOperationSelectorModel

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.