Examples of stringValueOf()


Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    }

    public void testAbsoluteXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("//test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
        assertEquals(message, xpath.stringValueOf(ctx));
    }

    public void testBodyRelativeXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("$body/test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    }

    public void testBodyRelativeXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("$body/test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
        assertEquals(message, xpath.stringValueOf(ctx));
        Object node = xpath.selectSingleNode(ctx);
        assertTrue(node instanceof OMElement);
        assertEquals(message, ((OMElement)node).getText());
    }
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

        ctx.getEnvelope().getHeader().addHeaderBlock("test", ns).setText(message);
        ctx.getEnvelope().getHeader().addHeaderBlock("test2", ns);
       
        SynapseXPath xpath = new SynapseXPath("$header/t:test");
        xpath.addNamespace(ns);
        assertEquals(message, xpath.stringValueOf(ctx));
       
        xpath = new SynapseXPath("$header/*");
        assertEquals(2, xpath.selectNodes(ctx).size());
    }

View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

        }

        // now set the any dynamic properties evaluating XPath's on the current message
        for (String name : messageSetterProperties.keySet()) {
            SynapseXPath xpath = messageSetterProperties.get(name);
            String value = xpath.stringValueOf(synCtx);
            PropertyHelper.setInstanceProperty(name, value, commandObject);
        }

        synLog.traceOrDebug("POJO initialized successfully, invoking the execute() method");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    String message = "This is XPath test";   

    public void testStringXPath() throws Exception {
        SynapseXPath xpath = SynapseXPath.parseXPathString("$body//{http://somens}test");
        MessageContext ctx =  TestUtils.getTestContext("<m0:test xmlns:m0=\"http://somens\">" + message + "</m0:test>");
        assertEquals(message, xpath.stringValueOf(ctx));
    }

    public void testStringXPath2() throws Exception {
        SynapseXPath xpath = SynapseXPath.parseXPathString("$body//{http://somens}test/{http://someother}another");
        MessageContext ctx =  TestUtils.getTestContext("<m0:test xmlns:m0=\"http://somens\"><m1:another xmlns:m1=\"http://someother\">" + message + "</m1:another></m0:test>");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    }

    public void testStringXPath2() throws Exception {
        SynapseXPath xpath = SynapseXPath.parseXPathString("$body//{http://somens}test/{http://someother}another");
        MessageContext ctx =  TestUtils.getTestContext("<m0:test xmlns:m0=\"http://somens\"><m1:another xmlns:m1=\"http://someother\">" + message + "</m1:another></m0:test>");
        assertEquals(message, xpath.stringValueOf(ctx));
    }

    public void testAbsoluteXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("//test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    }

    public void testAbsoluteXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("//test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
        assertEquals(message, xpath.stringValueOf(ctx));
    }

    public void testBodyRelativeXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("$body/test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    }

    public void testBodyRelativeXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("$body/test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
        assertEquals(message, xpath.stringValueOf(ctx));
        Object node = xpath.selectSingleNode(ctx);
        assertTrue(node instanceof OMElement);
        assertEquals(message, ((OMElement)node).getText());
    }
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

        ctx.getEnvelope().getHeader().addHeaderBlock("test", ns).setText(message);
        ctx.getEnvelope().getHeader().addHeaderBlock("test2", ns);
       
        SynapseXPath xpath = new SynapseXPath("$header/t:test");
        xpath.addNamespace(ns);
        assertEquals(message, xpath.stringValueOf(ctx));
       
        xpath = new SynapseXPath("$header/*");
        assertEquals(2, xpath.selectNodes(ctx).size());
    }

View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    public String evaluate(MessageContext synCtx, String credentialElemName) {
        String sourceObject = null;
        // expression is required to perform the match
        if (credentialTokensMap.containsKey(credentialElemName)) {
            SynapseXPath xpath = credentialTokensMap.get(credentialElemName);
            sourceObject = xpath.stringValueOf(synCtx);
            if (null == sourceObject) {
                log.debug(String.format("Source String : %s evaluates to null",
                                        xpath.toString()));
            }
        } else if (credentialTokenValueMap.containsKey(credentialElemName)) {
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.