01: /*************************************************************************
02: * *
03: * EJBCA: The OpenSource Certificate Authority *
04: * *
05: * This software is free software; you can redistribute it and/or *
06: * modify it under the terms of the GNU Lesser General Public *
07: * License as published by the Free Software Foundation; either *
08: * version 2.1 of the License, or any later version. *
09: * *
10: * See terms of license at gnu.org. *
11: * *
12: *************************************************************************/package se.anatom.ejbca.util;
13:
14: import junit.framework.TestCase;
15:
16: import org.apache.log4j.Logger;
17: import org.ejbca.util.CertTools;
18: import org.ejbca.util.HTMLTools;
19: import org.ejbca.util.StringTools;
20:
21: /**
22: * Tests the StringTools class .
23: *
24: * @version $Id: TestHTMLTools.java,v 1.1 2008/02/27 13:14:26 anatom Exp $
25: */
26: public class TestHTMLTools extends TestCase {
27: private static Logger log = Logger.getLogger(TestHTMLTools.class);
28:
29: /**
30: * Creates a new TestStringTools object.
31: *
32: * @param name name
33: */
34: public TestHTMLTools(String name) {
35: super (name);
36: }
37:
38: protected void setUp() throws Exception {
39: log.debug(">setUp()");
40: log.debug("<setUp()");
41: }
42:
43: protected void tearDown() throws Exception {
44: log.debug(">tearDown()");
45: log.debug("<tearDown()");
46: }
47:
48: public void test01JavascriptEscape() throws Exception {
49: String test = "l'AC si vous l'avez";
50: assertEquals("l\\'AC si vous l\\'avez", HTMLTools
51: .javascriptEscape(test));
52: }
53: }
|