1   /*
2    * $Id: XsltTransformerUTF8TestCase.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.transformers.xml;
12  
13  import org.mule.api.transformer.Transformer;
14  import org.mule.module.xml.transformer.XsltTransformer;
15  import org.mule.util.IOUtils;
16  
17  public class XsltTransformerUTF8TestCase extends AbstractXmlTransformerTestCase
18  {
19  
20      private String srcData;
21      private String resultData;
22  
23      // @Override
24      protected void doSetUp() throws Exception
25      {
26          srcData = IOUtils.toString(IOUtils.getResourceAsStream("cdcatalog-utf-8.xml", getClass()), "UTF-8");
27          resultData = IOUtils.toString(IOUtils.getResourceAsStream("cdcatalog-utf-8.html", getClass()),
28              "UTF-8");
29      }
30  
31      public Transformer getTransformer() throws Exception
32      {
33          XsltTransformer transformer = new XsltTransformer();
34          transformer.setXslFile("cdcatalog.xsl");
35          transformer.setReturnClass(String.class);
36          transformer.initialise();
37          return transformer;
38      }
39  
40      public Transformer getRoundTripTransformer() throws Exception
41      {
42          return null;
43      }
44  
45      // @Override
46      public void testRoundtripTransform() throws Exception
47      {
48          // disable this test
49      }
50  
51      public Object getTestData()
52      {
53          return srcData;
54      }
55  
56      public Object getResultData()
57      {
58          return resultData;
59      }
60  
61  }