1 7 8 package org.dom4j.tree; 9 10 import junit.textui.TestRunner; 11 12 import org.dom4j.AbstractTestCase; 13 14 19 public class CDataTest extends AbstractTestCase { 20 public static void main(String [] args) { 21 TestRunner.run(CDataTest.class); 22 } 23 24 public void testNullTest() { 25 DefaultCDATA cdata = new DefaultCDATA(null); 26 assertEquals("CData not correct", "<![CDATA[]]>", cdata.asXML()); 27 } 28 29 public void testNormal() { 30 DefaultCDATA cdata = new DefaultCDATA("sample"); 31 assertEquals("CData not correct", "<![CDATA[sample]]>", cdata.asXML()); 32 } 33 34 public void testLongCData() throws Exception { 35 getDocument("xml/test/longCDATA.xml"); 36 } 37 } 38 39 75 | Popular Tags |