KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > io > xml > Dom4JWriterTest


1 package com.thoughtworks.xstream.io.xml;
2
3 import org.dom4j.DocumentFactory;
4 import org.dom4j.Document;
5 import org.dom4j.io.OutputFormat;
6 import com.thoughtworks.xstream.io.HierarchicalStreamDriver;
7
8 import java.io.Writer JavaDoc;
9 import java.io.StringWriter JavaDoc;
10
11 public class Dom4JWriterTest extends AbstractXMLWriterTest {
12
13     private StringWriter JavaDoc out;
14
15     protected void setUp() throws Exception JavaDoc {
16         super.setUp();
17
18         Dom4JDriver driver = new Dom4JDriver();
19
20         OutputFormat format = OutputFormat.createCompactFormat();
21         format.setSuppressDeclaration(true);
22         driver.setOutputFormat(format);
23
24         out = new StringWriter JavaDoc();
25         writer = driver.createWriter(out);
26     }
27
28     protected void assertXmlProducedIs(String JavaDoc expected) {
29         writer.close();
30         String JavaDoc actual = out.toString().trim();
31         assertEquals(expected, actual);
32     }
33
34     // inherits tests from superclass
35

36     public void testEscapesWhitespaceCharacters() {
37         // TODO: Support whitespaces.
38
// This method overrides a test in the superclass to prevent it from being run.
39
}
40 }
41
Popular Tags