Package net.sf.gluent.doc.distillery.simplexmlbuilder.SimpleXml

Examples of net.sf.gluent.doc.distillery.simplexmlbuilder.SimpleXml.RootWithAutomaticEnd


    assertOut("<a/>");
  }

  @Test
  public void testOneElementWithAutomaticEnd() {
    RootWithAutomaticEnd xml = SimpleXml.withAutomaticEnd().to(outWriter);
    ElementsWithAutomaticEnd elements = xml.body();
    elements.e("a").end();
    assertOut("<a/>");
  }
View Full Code Here


    assertOut("<a/>");
  }

  @Test
  public void testOneElementWithAutomaticEndAndIncorrectEndTag() {
    RootWithAutomaticEnd xml = SimpleXml.withAutomaticEnd().to(outWriter);
    ElementsWithAutomaticEnd elements = xml.body();
    try {
      elements.e("a").end("incorrect");
      fail();
    } catch (IllegalStateException e) {
      // expected
View Full Code Here

    assertOut("<a></a>");
  }

  @Test
  public void testNoMoreAttrForcesEndTagWithAutomaticEnd() {
    RootWithAutomaticEnd xml = SimpleXml.withAutomaticEnd().to(outWriter);
    ElementsWithAutomaticEnd elements = xml.body();
    elements.e("a").noMoreAttr().end();
    assertOut("<a></a>");
  }
View Full Code Here

    assertOut("<a></a>");
  }

  @Test
  public void testNoMoreAttrForcesEndTagWithAutomaticEndAndIncorrectEndTag() {
    RootWithAutomaticEnd xml = SimpleXml.withAutomaticEnd().to(outWriter);
    ElementsWithAutomaticEnd elements = xml.body();
    try {
      elements.e("a").noMoreAttr().end("incorrect");
      fail();
    } catch (IllegalStateException e) {
      // expected
View Full Code Here

    assertOut("<a a1='a1v'><aa/><ab ab1='ab1v' ab2='ab2v'/></a>");
  }

  @Test
  public void testSubElementsAndManyAttributesWithAutomaticEnd() {
    RootWithAutomaticEnd xml = SimpleXml.withAutomaticEnd().to(outWriter);
    ElementsWithAutomaticEnd elements = xml.body();
    elements.e("a").a("a1", "a1v").e("aa").end().e("ab").a("ab1", "ab1v")
        .a("ab2", "ab2v").end().end();
    assertOut("<a a1='a1v'><aa/><ab ab1='ab1v' ab2='ab2v'/></a>");
  }
View Full Code Here

    assertOut("<a a='&amp;'>a&amp;&lt;b&gt;&quot;&apos;<b>&amp;</b></a>");
  }

  @Test
  public void testTextAndAttributesAreEscapedWithAutomaticEnd() {
    RootWithAutomaticEnd xml = SimpleXml.withAutomaticEnd().to(outWriter);
    ElementsWithAutomaticEnd elements = xml.body();
    elements.e("a").a("a", "&").t("a&<b>\"'").e("b").noMoreAttr().t("&")
        .end("b").end("a");
    assertOut("<a a='&amp;'>a&amp;&lt;b&gt;&quot;&apos;<b>&amp;</b></a>");
  }
View Full Code Here

TOP

Related Classes of net.sf.gluent.doc.distillery.simplexmlbuilder.SimpleXml.RootWithAutomaticEnd

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.