1 package com.atlassian.refapp.sal.pluginsettings;
2
3 import junit.framework.TestCase;
4
5 public class TestXmlUtils extends TestCase {
6 public void testEscape() {
7
8 assertEquals("hello world", XmlUtils.escape("hello world"));
9
10
11 assertEquals(null, XmlUtils.escape(null));
12
13
14 assertEquals("hello!@#$000Cworld\nyeehaw!@#$0008hoho", XmlUtils.escape("hello\fworld\nyeehaw\bhoho"));
15 }
16
17 public void testUnescape() {
18
19 assertEquals("hello world", XmlUtils.unescape("hello world"));
20
21
22 assertEquals(null, XmlUtils.unescape(null));
23
24
25 assertEquals("hello\fworld\nyeehaw\bhoho", XmlUtils.unescape("hello!@#$000Cworld\nyeehaw!@#$0008hoho"));
26
27
28 assertEquals("hello!@#000Cworld", XmlUtils.unescape("hello!@#000Cworld"));
29
30
31 assertEquals("hello!@#$000%world", XmlUtils.unescape("hello!@#$000%world"));
32
33
34 assertEquals("hello!@ !@# !@#$ !! @@ ## $$ !@#$54", XmlUtils.unescape("hello!@ !@# !@#$ !! @@ ## $$ !@#$54"));
35
36
37 assertEquals("hello!", XmlUtils.unescape("hello!"));
38 }
39 }