Examples of transform()


Examples of org.mule.module.xml.transformer.XPathExtractor.transform()

    {
        final String badExpression = "/$@�%$�&�$$�%";
        final XPathExtractor extractor = initialiseExtractor(badExpression, XPathReturnType.STRING);

        final Document doc = getDocumentForString(TEST_XML_SINGLE_RESULT);
        extractor.transform(doc);
    }

    @Test
    public void nodeToStringResult() throws Exception
    {

Examples of org.mule.module.xml.transformer.XmlPrettyPrinter.transform()

        String payload = lines[payloadLine];
        String xml = StringUtils.substringAfter(payload, "Payload: ");
        XmlPrettyPrinter pp = new XmlPrettyPrinter();
        try
        {
            xml = (String) pp.transform(xml);
        }
        catch (MuleException e)
        {
            System.err.println(e.getMessage());
        }

Examples of org.mule.module.xml.transformer.XmlToDomDocument.transform()

        {               
            // TODO Find a more direct way to do this
            XmlToDomDocument tr = new XmlToDomDocument();
            tr.setMuleContext(muleContext);
            tr.setReturnDataType(DataTypeFactory.create(org.dom4j.Document.class));
            return (org.dom4j.Document) tr.transform(obj);
        }
        else if (obj instanceof java.io.InputStream)
        {               
            return reader.read((java.io.InputStream) obj);
        }

Examples of org.mule.module.xml.transformer.XmlToObject.transform()

    {
        XmlToObject transformer = createObject(XmlToObject.class);
        transformer.setAliases(aliases);

        String input = (String) this.getResultData();
        assertEquals(testObject, transformer.transform(new ByteArrayInputStream(input.getBytes())));
    }
}

Examples of org.mule.module.xml.transformer.XsltTransformer.transform()

        // init transformer
        transformer.initialise();

        // do transformation
        String transformerResult = (String) transformer.transform(xml);

        // remove doc type and CRLFs
        transformerResult = transformerResult.substring(transformerResult.indexOf("?>") + 2);

        assertTrue(transformerResult.indexOf(expectedTransformedxml) > -1);

Examples of org.mule.providers.jms.transformers.AbstractJmsTransformer.transform()

        ObjectMessage oMsg = session.createObjectMessage();
        File f = new File("/some/random/path");
        oMsg.setObject(f);
        AbstractJmsTransformer trans = new JMSMessageToObject();
        Object result = trans.transform(oMsg);
        assertTrue("Transformed object should be a File", result.getClass().equals(File.class));

        AbstractJmsTransformer trans2 = new SessionEnabledObjectToJMSMessage(session);
        trans2.setReturnClass(ObjectMessage.class);
        Object result2 = trans2.transform(f);

Examples of org.mule.providers.jms.transformers.JMSMessageToObject.transform()

        ObjectMessage oMsg = session.createObjectMessage();
        File f = new File("/some/random/path");
        oMsg.setObject(f);
        AbstractJmsTransformer trans = new JMSMessageToObject();
        Object result = trans.transform(oMsg);
        assertTrue("Transformed object should be a File", result.getClass().equals(File.class));

        AbstractJmsTransformer trans2 = new SessionEnabledObjectToJMSMessage(session);
        trans2.setReturnClass(ObjectMessage.class);
        Object result2 = trans2.transform(f);

Examples of org.mule.transformer.AbstractTransformer.transform()

    public void testStringSourceTypeWithIgnoreBadInput() throws Exception
    {
        AbstractTransformer trans = (AbstractTransformer) getTransformer();
        trans.setIgnoreBadInput(true);
        Object result = trans.transform(getResultData());
        trans.setIgnoreBadInput(false);
        assertEquals(result, getResultData());
    }
}

Examples of org.mule.transformer.compression.GZipUncompressTransformer.transform()

        assertNotNull(message);
        GZipUncompressTransformer gu = new GZipUncompressTransformer();
        gu.setMuleContext(muleContext);
        gu.setReturnDataType(DataTypeFactory.STRING);
        assertNotNull(message.getPayload());
        String result = (String)gu.transform(message.getPayloadAsBytes());
        assertEquals("<string>payload</string>", result);
    }

    public void testBinary() throws Exception
    {

Examples of org.mule.transformer.simple.ByteArrayToObject.transform()

        if (object instanceof byte[])
        {
            ByteArrayToObject transformer = new ByteArrayToObject();
            try
            {
                object = transformer.transform(object);
            }
            catch (TransformerException e)
            {
                logger.warn(CoreMessages.transformFailedBeforeFilter(), e);
                // revert transformation
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.