Package org.mule.module.xml.expression

Examples of org.mule.module.xml.expression.JXPathExpressionEvaluator.evaluate()


        apple.wash();
        FruitBowl payload = new FruitBowl(apple, new Banana());
        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("apple/washed", msg);
        assertNotNull(value);
        assertTrue(value instanceof Boolean);
        assertTrue(((Boolean) value).booleanValue());

        value = e.evaluate("bar", msg);
View Full Code Here


        Object value = e.evaluate("apple/washed", msg);
        assertNotNull(value);
        assertTrue(value instanceof Boolean);
        assertTrue(((Boolean) value).booleanValue());

        value = e.evaluate("bar", msg);
        assertNull(value);
    }

    public void testXmlContainingNoNameSpaces() throws MalformedURLException
    {
View Full Code Here

                         "</address>";

        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("/address/street", msg);

        assertTrue(value instanceof String);
        assertEquals("Orchard Road", (String) value);
    }
View Full Code Here

                         "</root>";

        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("//f:table/f:name", msg);

        assertTrue(value instanceof String);
        assertEquals("African Coffee Table", (String) value);
    }
View Full Code Here

        final String xpathExpression = "//f:table/f:name";

        DefaultMuleMessage msg = new DefaultMuleMessage(XML_USING_UNDEFINED_NAMESPACE, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate(xpathExpression, msg);
        assertNull(value);
    }

    public void testXmlWithInvalidNameSpaceIfNameSpaceAliasIsDefined() throws MalformedURLException, RegistrationException
    {
View Full Code Here

        DefaultMuleMessage msg = new DefaultMuleMessage(XML_USING_UNDEFINED_NAMESPACE, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        e.setMuleContext(muleContext);

        Object value = e.evaluate("//f:table/f:name", msg);
        assertTrue(value instanceof String);
        assertEquals("African Coffee Table", (String) value);
    }
}
View Full Code Here

        apple.wash();
        FruitBowl payload = new FruitBowl(apple, new Banana());
        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("apple/washed", msg);
        assertNotNull(value);
        assertTrue(value instanceof Boolean);
        assertTrue(((Boolean) value).booleanValue());

        value = e.evaluate("bar", msg);
View Full Code Here

        Object value = e.evaluate("apple/washed", msg);
        assertNotNull(value);
        assertTrue(value instanceof Boolean);
        assertTrue(((Boolean) value).booleanValue());

        value = e.evaluate("bar", msg);
        assertNull(value);
    }

    @Test
    public void testXmlContainingNoNameSpaces() throws MalformedURLException
View Full Code Here

                         "</address>";

        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("/address/street", msg);

        assertTrue(value instanceof String);
        assertEquals("Orchard Road", value);
    }
View Full Code Here

                         "</root>";

        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("//f:table/f:name", msg);

        assertTrue(value instanceof String);
        assertEquals("African Coffee Table", value);
    }
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.