* Tests the DOM Document and Element editors.
*/
public void testDocumentElementEditors()
{
getLog().debug("+++ testDocumentElementEditors");
DocumentEditor de = new DocumentEditor();
// Comments can appear outside of a document
String s = "<!-- header comment --><doc name='whatever'/><!-- footer comment -->";
getLog().debug("setAsText '" + s + "'");
de.setAsText(s);
getLog().debug("Parsed XML document:");
log((Node)de.getValue(), " ");
getLog().debug("getAsText '" + de.getAsText() + "'");
assertTrue("Document :\n" + de.getAsText(), de.getAsText().trim().endsWith(s));
assertTrue(de.getValue() instanceof org.w3c.dom.Document);
// Test whitespace preservation
s = "<element>\n\n<e2/> testing\n\n</element>";
de.setAsText(s);
assertTrue("Document :\n" + de.getAsText() + "\nvs\n" + s, de.getAsText().trim().endsWith(s));
ElementEditor ee = new ElementEditor();
s = "<element>text</element>";
ee.setAsText(s);
assertEquals(s, ee.getAsText());