Package org.switchyard.config.model.selector

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


        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) {
            RegexOperationSelectorModel regexModel = RegexOperationSelectorModel.class.cast(_model);
            operationQName = regexMatch(regexModel.getExpression(), extractString(content));
        } else {
            throw CommonCommonMessages.MESSAGES.unsupportedOperationSelectorConfiguration(_model.toString());
View Full Code Here


    public void testXPath() throws Exception {
        String expression = "/Message/Operation";
        String expressionAttribute = "/Message/Operation/@name";
        String content = "<Message><Operation name=\"xpathOperationFromAttribute\">xpathOperation</Operation></Message>";

        XPathOperationSelectorModel model = new V1XPathOperationSelectorModel(SwitchYardNamespace.DEFAULT.uri());
        model.setExpression(expression);
        OperationSelector<String> selector = new MyOperationSelector(model);
        QName operationQName = selector.selectOperation(content);
        Assert.assertEquals("xpathOperation", operationQName.getLocalPart());
       
        model.setExpression(expressionAttribute);
        selector = new MyOperationSelector(model);
        operationQName = selector.selectOperation(content);
        Assert.assertEquals("xpathOperationFromAttribute", operationQName.getLocalPart());
    }
View Full Code Here

    @Test
    public void testOperationSelectorOnNettyChannelBuffer() throws Exception {
        String payload = "<body><operation>greet</operation><name>Tomas</name></body>";
        ProducerTemplate producer = _camelContext.createProducerTemplate();
        XPathOperationSelectorModel operationSelectorModel = new V1XPathOperationSelectorModel(SwitchYardNamespace.DEFAULT.uri());
        operationSelectorModel.setExpression("//body/operation");
        InboundHandler<?> handler = createInboundHandler("direct://xpath", "xpath", operationSelectorModel);
        handler.start();
       
        try {
            // BigEndianHeapChannelBuffer->String converter is provided by camel-netty component
View Full Code Here

TOP

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

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.