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

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


  // the tests

  @Test
  public void testOneElementWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").end();
    assertOut("<a/>");
  }
View Full Code Here


    assertOut("<a");
  }

  @Test
  public void testNoMoreAttrForcesEndTagWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").noMoreAttr().end("a");
    assertOut("<a></a>");
  }
View Full Code Here

    assertOut("<a>");
  }

  @Test
  public void testEmptyTextContentForcesEndTag() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").t("").end("a");
    assertOut("<a></a>");
  }
View Full Code Here

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

  @Test
  public void testOneElementAndAttributeWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").a("a1", "v1").end();
    assertOut("<a a1='v1'/>");
  }
View Full Code Here

    assertOut("<a a1='v1'/>");
  }

  @Test
  public void testOneElementAndSubElementWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").e("aa").end().end("a");
    assertOut("<a><aa/></a>");
  }
View Full Code Here

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

  @Test
  public void testOneElementAndSubElementAndExplicitNoMoreAttrsWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").noMoreAttr().e("aa").end().end("a");
    assertOut("<a><aa/></a>");
  }
View Full Code Here

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

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

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

  @Test
  public void testOneElementAndTextWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").t("some text").end("a");
    assertOut("<a>some text</a>");
  }
View Full Code Here

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

  @Test
  public void testOneElementAndExplicitNoMoreAttrsAndTextWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd elements = xml.body();
    elements.e("a").noMoreAttr().t("some text").end("a");
    assertOut("<a>some text</a>");
  }
View Full Code Here

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

  @Test
  public void testTextAndAttributesAreEscapedWithManualEnd() {
    RootWithManualEnd xml = SimpleXml.withManualEnd().to(outWriter);
    ElementsWithManualEnd 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.RootWithManualEnd

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.