1   /*
2    * $Id: InlineXsltTransformerTestCase.java 7976 2007-08-21 14:26:13Z dirk.olmes $
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.umo.transformer.UMOTransformer;
14  import org.mule.util.IOUtils;
15  
16  public class InlineXsltTransformerTestCase extends AbstractXmlTransformerTestCase
17  {
18  
19      private String srcData;
20      private String resultData;
21  
22      protected void doSetUp() throws Exception
23      {
24          srcData = IOUtils.getResourceAsString("simple.xml", getClass());
25          resultData = IOUtils.getResourceAsString("simple-out.xml", getClass());
26      }
27  
28      public UMOTransformer getTransformer() throws Exception
29      {
30          XsltTransformer transformer = new XsltTransformer();
31          transformer.setXslt("<?xml version='1.0'?>\n"
32                              + "<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>\n"
33                              + "<xsl:output method='xml'/>\n" + "<xsl:template match='/'>\n"
34                              + "  <some-xml>\n" + "    <xsl:copy-of select='.'/>\n" + "  </some-xml>\n"
35                              + "</xsl:template>\n" + "</xsl:stylesheet>");
36          transformer.initialise();
37          return transformer;
38      }
39  
40      public UMOTransformer getRoundTripTransformer() throws Exception
41      {
42          return null;
43      }
44  
45      public void testRoundtripTransform() throws Exception
46      {
47          // disable this test
48      }
49  
50      public Object getTestData()
51      {
52          return srcData;
53      }
54  
55      public Object getResultData()
56      {
57          return resultData;
58      }
59  }