1 package com.thoughtworks.xstream.io.xml; 2 3 import org.w3c.dom.Document ; 4 5 import javax.xml.parsers.DocumentBuilder ; 6 import javax.xml.parsers.DocumentBuilderFactory ; 7 8 public class DomWriterTest extends AbstractXMLWriterTest { 9 10 private Document document; 11 12 protected void setUp() throws Exception { 13 super.setUp(); 14 DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); 15 DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); 16 document = documentBuilder.newDocument(); 17 writer = new DomWriter(document); 18 } 19 20 protected void assertXmlProducedIs(String expected) { 21 org.dom4j.io.DOMReader domReader = new org.dom4j.io.DOMReader(); 23 org.dom4j.Document dom4Jdoc = domReader.read(document); 24 String actual = dom4Jdoc.getRootElement().asXML(); 25 assertEquals(expected, actual); 26 } 27 28 30 public void testEscapesWhitespaceCharacters() { 31 } 34 } 35 | Popular Tags |