/*
* $Id: XmlPrettyPrinterConfigurationTestCase.java 21933 2011-05-17 18:31:30Z dirk.olmes $
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.module.xml.config;
import org.mule.module.xml.transformer.XmlPrettyPrinter;
import org.mule.tck.FunctionalTestCase;
public class XmlPrettyPrinterConfigurationTestCase extends FunctionalTestCase
{
public XmlPrettyPrinterConfigurationTestCase()
{
super();
// no need to waste cycles starting the MuleContext
setStartContext(false);
}
@Override
protected String getConfigResources()
{
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());
}
}