1
2
3
4
5
6
7
8
9
10
11 package org.mule.transformers.xml;
12
13 import org.mule.MuleManager;
14 import org.mule.tck.AbstractTransformerTestCase;
15 import org.mule.umo.transformer.UMOTransformer;
16 import org.mule.util.ArrayUtils;
17
18 import java.io.UnsupportedEncodingException;
19
20 public class XmlObjectTransformersUTF8TestCase extends AbstractTransformerTestCase
21 {
22
23
24 private static final String TEST_STRING = "\u00E1b\u00E7d\u00E8f";
25
26 private final byte[] testXml;
27
28 public XmlObjectTransformersUTF8TestCase() throws UnsupportedEncodingException
29 {
30 super();
31
32 testXml = ArrayUtils.addAll("<string>".getBytes("ASCII"), ArrayUtils.addAll(
33 TEST_STRING.getBytes("UTF-8"), "</string>".getBytes("ASCII")));
34 }
35
36 protected void doSetUp() throws Exception
37 {
38 super.doSetUp();
39
40 MuleManager.getConfiguration().setEncoding("UTF-8");
41 }
42
43 public UMOTransformer getTransformer() throws Exception
44 {
45 return new XmlToObject();
46 }
47
48 public UMOTransformer getRoundTripTransformer() throws Exception
49 {
50
51 return null;
52 }
53
54 public Object getTestData()
55 {
56 return testXml;
57 }
58
59 public Object getResultData()
60 {
61 return TEST_STRING;
62 }
63 }