Package org.mule.module.xml.transformer

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


        }
       
        // Extract the XML payload and format it
        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());
        }
View Full Code Here


        return "org/mule/module/xml/xml-prettyprinter-config.xml";
    }

    public void testPrettyPrinter()
    {
        XmlPrettyPrinter pp = (XmlPrettyPrinter) muleContext.getRegistry().lookupTransformer("MyXMLPrettyPrinter");

        assertNotNull(pp);
        assertEquals("ISO-8859-15", pp.getEncoding());
        assertEquals(true, pp.isExpandEmptyElements());
        assertEquals(true, pp.getIndentEnabled());
        assertEquals("   ", pp.getIndentString());
        assertEquals("\\n\\n", pp.getLineSeparator());
        assertEquals(1, pp.getNewLineAfterNTags());
        assertFalse(pp.isNewlines());
        assertFalse(pp.isNewLineAfterDeclaration());
        assertFalse(pp.isOmitEncoding());
        assertFalse(pp.isPadText());
        assertFalse(pp.isTrimText());
        assertFalse(pp.isSuppressDeclaration());
        assertTrue(pp.isXHTML());
    }
View Full Code Here

        return createObject(XmlPrettyPrinter.class);
    }

    public void testOutputOptions()
    {
        XmlPrettyPrinter t = new XmlPrettyPrinter();
        OutputFormat f = t.getOutputFormat();
        assertEquals(2, f.getIndent().length());
        assertTrue(f.isPadText());

        t.setIndentSize(4);
        t.setPadText(true);
        assertEquals(4, f.getIndent().length());
        assertTrue(f.isPadText());
    }
View Full Code Here

        }
       
        // Extract the XML payload and format it
        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());
        }
View Full Code Here

    }

    @Test
    public void testOutputOptions()
    {
        XmlPrettyPrinter t = new XmlPrettyPrinter();
        OutputFormat f = t.getOutputFormat();
        assertEquals(2, f.getIndent().length());
        assertTrue(f.isPadText());

        t.setIndentSize(4);
        t.setPadText(true);
        assertEquals(4, f.getIndent().length());
        assertTrue(f.isPadText());
    }
View Full Code Here

    }

    @Test
    public void testPrettyPrinter()
    {
        XmlPrettyPrinter pp = (XmlPrettyPrinter) muleContext.getRegistry().lookupTransformer("MyXMLPrettyPrinter");

        assertNotNull(pp);
        assertEquals("ISO-8859-15", pp.getEncoding());
        assertEquals(true, pp.isExpandEmptyElements());
        assertEquals(true, pp.getIndentEnabled());
        assertEquals("   ", pp.getIndentString());
        assertEquals("\\n\\n", pp.getLineSeparator());
        assertEquals(1, pp.getNewLineAfterNTags());
        assertFalse(pp.isNewlines());
        assertFalse(pp.isNewLineAfterDeclaration());
        assertFalse(pp.isOmitEncoding());
        assertFalse(pp.isPadText());
        assertFalse(pp.isTrimText());
        assertFalse(pp.isSuppressDeclaration());
        assertTrue(pp.isXHTML());
    }
View Full Code Here

TOP

Related Classes of org.mule.module.xml.transformer.XmlPrettyPrinter

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.