Package org.jboss.util.propertyeditor

Examples of org.jboss.util.propertyeditor.DocumentEditor


    * 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());
View Full Code Here

TOP

Related Classes of org.jboss.util.propertyeditor.DocumentEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.