01: /*
02: * HtmlUtilTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.util;
13:
14: import junit.framework.TestCase;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class HtmlUtilTest extends TestCase {
21:
22: public HtmlUtilTest(String testName) {
23: super (testName);
24: }
25:
26: public void testEscapeHTML() {
27: try {
28: String input = "<sometag> sometext";
29: String escaped = HtmlUtil.escapeHTML(input);
30: assertEquals("<sometag> sometext", escaped);
31:
32: input = "a < b";
33: escaped = HtmlUtil.escapeHTML(input);
34: assertEquals("a &lt; b", escaped);
35:
36: } catch (Exception e) {
37: e.printStackTrace();
38: fail(e.getMessage());
39: }
40: }
41:
42: }
|