Examples of JXPathExtractor


Examples of org.mule.module.xml.transformer.JXPathExtractor

     * are no ClassCastExceptions.
     */
    @Test
    public void testMultipleResultsNested() throws Exception
    {
        JXPathExtractor extractor = createObject(JXPathExtractor.class);
        extractor.setExpression("/root/node[*]/*/text()");
        extractor.setSingleResult(false);
        final Object objResult = extractor.transform(TEST_XML_MULTI_NESTED_RESULTS);
        assertNotNull(objResult);
        List results = (List)objResult;
        assertEquals("Wrong number of results returned.", 4, results.size());
        assertEquals("Wrong value returned.", "val1", results.get(0));
        assertEquals("Wrong value returned.", "val2", results.get(1));
View Full Code Here

Examples of org.mule.module.xml.transformer.JXPathExtractor

    }

    @Test
    public void testJXPathExtractor() throws Exception
    {
        JXPathExtractor transformer = (JXPathExtractor) lookupTransformer("jxpath-extractor");
        transformer.initialise();
        assertNotNull(transformer.getNamespaces());
        assertEquals(6, transformer.getNamespaces().size());
        assertNotNull(transformer.getNamespaces().get("foo"));
        assertNotNull(transformer.getNamespaces().get("bar"));
    }
View Full Code Here

Examples of org.mule.module.xml.transformer.JXPathExtractor

    }

    @Test
    public void testJXPathExtractor()
    {
        JXPathExtractor extractor = (JXPathExtractor) getAndTestTransformer("jxpathExtractor",
            JXPathExtractor.class);
        assertEquals("/expression", extractor.getExpression());
        assertFalse(extractor.isSingleResult());
        assertEquals(JXPathExtractor.OUTPUT_TYPE_VALUE, extractor.getOutputType());
       
        Map ns = extractor.getNamespaces();
        assertNotNull(ns);
       
        assertEquals("http://foo.com", ns.get("foo1"));
        assertEquals("http://foo.com", ns.get("foo2"));
    }
View Full Code Here

Examples of org.mule.module.xml.transformer.JXPathExtractor

    }

    @Test
    public void testJXPathExtractorOnEndpoint() throws MuleException
    {
        JXPathExtractor extractor = (JXPathExtractor) getAndTestEndpointTransformer("ep2",
            JXPathExtractor.class);
        assertEquals("/expression", extractor.getExpression());
        assertFalse(extractor.isSingleResult());
    }
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.