1 package net.sf.flock.parser;
2
3 import junit.framework.TestCase;
4
5 /***
6 * @version $Revision: 1.1 $
7 * @author $Author: phraktle $
8 */
9 public class HTMLUtilTest extends TestCase {
10
11 /***
12 * Constructor for HTMLUtilTest.
13 * @param arg0
14 */
15 public HTMLUtilTest(String arg0) {
16 super(arg0);
17 }
18
19 private final static String[][] TEST = {
20 {"<foo>", "<foo>"},
21 {"Foo&unknown;bar", "Foo&unknown;bar"},
22 {"foo & broken", "foo & broken"}
23 };
24
25 private final static String[][] ESCAPETEST = {
26 {"Vil?g?totorony", "Világítotorony"},
27 {"?rv?zt?r?t?k?rf?r?", "Árvíztürötükörfúró"},
28 {"foo & broken", "foo & broken"}
29 };
30
31
32 public void testUnescape() {
33 assertNull( HTMLUtil.unescape(null) );
34 for (int i=0; i<TEST.length; i++) {
35 assertEquals( TEST[i][1], HTMLUtil.unescape(TEST[i][0]) );
36 }
37 }
38
39 public void testEscape() {
40 assertNull( HTMLUtil.escape(null) );
41 for (int i=0; i<ESCAPETEST.length; i++) {
42 assertEquals( ESCAPETEST[i][1], HTMLUtil.escape(ESCAPETEST[i][0]) );
43 }
44
45 }
46
47 }
This page was automatically generated by Maven