Package org.apache.openjpa.persistence.util

Examples of org.apache.openjpa.persistence.util.SourceCode$Comment


  @Test
  @Ignore
  // TODO
  public void testOutputFragmentContent() {
    roundTripFragment(new ProcessingInstruction("jdomtest", ""));
    roundTripFragment(new Comment("comment"));
    roundTripFragment(new CDATA("foo"));
    roundTripFragment(new Element("root"));
    roundTripFragment(new Text("bar"));
  }
View Full Code Here


    // this is to test issue #72
    // Compact format only prints first child.
    // and, it has a multi-text-type at the end.
    Element root = new Element("root");
    root.addContent(new Text(" "));
    root.addContent(new Comment("Boo"));
    root.addContent(new Text(" "));
    root.addContent(new Element("child"));
    root.addContent(new Text(" "));
    root.addContent(new ProcessingInstruction("pitarget"));
    root.addContent(new Text(" "));
View Full Code Here

  }

  @Test
  public void testOutputDocumentFull() {
    DocType dt = new DocType("root");
    Comment comment = new Comment("comment");
    ProcessingInstruction pi = new ProcessingInstruction("jdomtest", "");
    Element root = new Element("root");
    Document doc = new Document();
    doc.addContent(dt);
    doc.addContent(comment);
View Full Code Here

  @Test
  public void testOutputEscapedMixedMultiText() {
    // this test has mixed content (text-type and not text type).
    // and, it has a multi-text-type at the end.
    Element root = new Element("root");
    root.addContent(new Comment("Boo"));
    root.addContent(new Text(" xx "));
    root.addContent(new Text("<emb>"));
    root.addContent(new Text(" xx "));
    FormatSetup fs = new FormatSetup() {
      @Override
View Full Code Here

          } else {
            current.addContent(factory.text(
                ((Characters)event).getData()));
          }
        } else if (event instanceof javax.xml.stream.events.Comment) {
          final Comment comment = factory.comment(
              ((javax.xml.stream.events.Comment)event).getText());
          if (current == null) {
            document.addContent(comment);
          } else {
            current.addContent(comment);
View Full Code Here

        outputString(ftfw,     content));
  }
 
  @Test
  public void testComment() {
    Comment content = new Comment("comment");
    assertEquals("<!--comment-->",
        outputString(fraw,     content));
    assertEquals("<!--comment-->",
        outputString(fcompact, content));
    assertEquals("<!--comment-->",
View Full Code Here

  }
 
  @Test
  public void testDocumentComment() {
    Document content = new Document();
    content.addContent(new Comment("comment"));
    assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--comment-->\n",
        outputString(fraw,     content));
    assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--comment-->\n",
        outputString(fcompact, content));
    assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--comment-->\n",
View Full Code Here

  @Test
  public void testOutputComment() {
    String incomment = "   hello   there  bozo !   ";
    String outcomment = "<!--" + incomment + "-->";
    checkOutput(new Comment(incomment), outcomment, outcomment, outcomment, outcomment, outcomment);
  }
View Full Code Here

    // down in to normal (not preserve).
   
    // this is essentially a test of the FormatStack code....

    Element tst = new Element("child");
    Comment cmt = new Comment("comment");
    tst.addContent(cmt);
    String spaced = "  <child>\n    <!--comment-->\n  </child>\n";
    String compact = "<child><!--comment--></child>";
    String preserved = "<child xml:space=\"preserve\"><!--comment--></child>";
    Element root = new Element("root");
View Full Code Here

    root.addContent(new Text(" "));
    root.addContent(new Text("    "));
    root.addContent(new Text(""));
    root.addContent(new Text(" "));
    root.addContent(new Text("  \n \n "));
    root.addContent(new Comment("Boo"));
    root.addContent(new Text("  \t "));
    root.addContent(new Text("  "));
    FormatSetup fs = new FormatSetup() {
      @Override
      public void setup(Format fmt) {
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.util.SourceCode$Comment

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.