1   /*
2    * $Id: XmlPrettyPrinterConfigurationTestCase.java 11236 2008-03-06 23:48:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.xml.config;
12  
13  import org.mule.module.xml.transformer.XmlPrettyPrinter;
14  import org.mule.tck.FunctionalTestCase;
15  
16  public class XmlPrettyPrinterConfigurationTestCase extends FunctionalTestCase
17  {
18  
19      protected String getConfigResources()
20      {
21          return "org/mule/module/xml/xml-prettyprinter-config.xml";
22      }
23  
24      public void testPrettyPrinter()
25      {
26          XmlPrettyPrinter pp = (XmlPrettyPrinter) muleContext.getRegistry().lookupTransformer(
27              "MyXMLPrettyPrinter");
28  
29          assertNotNull(pp);
30          assertEquals("ISO-8859-15", pp.getEncoding());
31          assertEquals(true, pp.isExpandEmptyElements());
32          assertEquals(true, pp.getIndentEnabled());
33          assertEquals("   ", pp.getIndentString());
34          assertEquals("\\n\\n", pp.getLineSeparator());
35          assertEquals(1, pp.getNewLineAfterNTags());
36          assertFalse(pp.isNewlines());
37          assertFalse(pp.isOmitEncoding());
38          assertFalse(pp.isPadText());
39          assertFalse(pp.isTrimText());
40          assertFalse(pp.isSuppressDeclaration());
41          assertTrue(pp.isXHTML());
42      }
43  
44  }