01: package org.uispec4j.xml;
02:
03: import org.uispec4j.utils.UnitTestCase;
04:
05: public class XmlEscapeTest extends UnitTestCase {
06: public void testConvertToXmlEntity() throws Exception {
07: assertEquals("sdfsdf&sdfsdf", XmlEscape
08: .convertToXmlWithEntities("sdfsdf&sdfsdf"));
09: assertEquals("sdfsdf<sdf>sdf", XmlEscape
10: .convertToXmlWithEntities("sdfsdf<sdf>sdf"));
11: assertEquals("sdf"sdf"sdfsdf", XmlEscape
12: .convertToXmlWithEntities("sdf\"sdf\"sdfsdf"));
13: assertEquals("sdfsdf'sdfsdf", XmlEscape
14: .convertToXmlWithEntities("sdfsdf'sdfsdf"));
15: assertEquals("&<>'"", XmlEscape
16: .convertToXmlWithEntities("&<>'\""));
17: }
18: }
|