KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.thoughtworks.xstream.io.xml;
2
3 import org.jdom.output.XMLOutputter;
4
5 import java.util.List JavaDoc;
6
7 public class JDomWriterTest extends AbstractXMLWriterTest {
8
9     private List JavaDoc result;
10
11     protected void setUp() throws Exception JavaDoc {
12         super.setUp();
13         writer = new JDomWriter();
14         result = ((JDomWriter)writer).getResult();
15     }
16
17     protected void assertXmlProducedIs(String JavaDoc expected) {
18         XMLOutputter outputter = new XMLOutputter();
19         String JavaDoc actual = outputter.outputString(result);
20         actual = actual.replaceAll("
", "
"); // close enough
21
actual = actual.replaceAll("\r\n", "\n");
22         actual = actual.replaceAll(" />", "/>");
23         assertEquals(expected, actual);
24     }
25
26     // inherits tests from superclass
27
}
28
Popular Tags