01: package info.jtrac.util;
02:
03: import junit.framework.TestCase;
04:
05: public class ItemUtilsTest extends TestCase {
06:
07: public void testHtmlEscaping() {
08: assertEquals(" ", ItemUtils
09: .fixWhiteSpace(" "));
10: assertEquals(" ", ItemUtils
11: .fixWhiteSpace(" \t"));
12: assertEquals("Hello World", ItemUtils
13: .fixWhiteSpace("Hello World"));
14: assertEquals("", ItemUtils.fixWhiteSpace(""));
15: assertEquals("", ItemUtils.fixWhiteSpace(null));
16: assertEquals("Hello<br/>World", ItemUtils
17: .fixWhiteSpace("Hello\nWorld"));
18: assertEquals("Hello<br/> World", ItemUtils
19: .fixWhiteSpace("Hello\n World"));
20: assertEquals(
21: "Hello<br/> World<br/> Everyone",
22: ItemUtils.fixWhiteSpace("Hello\n World\n\tEveryone"));
23: assertEquals("Hello World", ItemUtils
24: .fixWhiteSpace("Hello\tWorld"));
25: }
26:
27: }
|