Package org.apache.tapestry5

Examples of org.apache.tapestry5.MarkupWriter.end()


            if (i != 2)
            {
                writer.write(String.valueOf(i));
            }

            writer.end();

            if (e.getChildren().isEmpty())
            {
                e.remove();
            }
View Full Code Here


            {
                e.remove();
            }
        }

        writer.end();

        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n" +
                "<ul><li>0</li><li>1</li><li>3</li></ul>");
    }
}
View Full Code Here

            if (i != 2)
            {
                writer.write(String.valueOf(i));
            }

            writer.end();

            if (e.getChildren().isEmpty())
            {
                e.remove();
            }
View Full Code Here

            {
                e.remove();
            }
        }

        writer.end();

        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n" +
                "<ul><li>0</li><li>1</li><li>3</li></ul>");
    }
}
View Full Code Here

    public void single_root_element_only()
    {
        MarkupWriter w = new MarkupWriterImpl(new XMLMarkupModel());

        w.element("root1");
        w.end();

        try
        {
            w.element("root2");
            unreachable();
View Full Code Here

        MarkupWriter w = new MarkupWriterImpl(new XMLMarkupModel());

        w.write("  ");

        w.element("root");
        w.end();

        assertEquals(w.toString(), "<?xml version=\"1.0\"?>\n" + "  <root/>");
    }

    @Test
View Full Code Here

    public void write_whitespace_after_end_of_root_element_is_retained_in_preamble()
    {
        MarkupWriter w = new MarkupWriterImpl(new XMLMarkupModel());

        w.element("root");
        w.end();

        w.write("  ");

        assertEquals(w.toString(), "<?xml version=\"1.0\"?>\n  <root/>");
    }
View Full Code Here

        w.comment(" preamble start ");
        w.write("preamble text");
        w.cdata("CDATA content");
        w.writeRaw("&nbsp;");
        w.element("root");
        w.end();
        // You really shouldn't have any text after the close tag of the document, so it
        // gets moved to the top, to the "preamble", before the first element.
        w.comment(" content after root element in preamble ");

        assertEquals(w.getDocument().toString(), readFile("preamble_content.txt"));
View Full Code Here

    @Test(expectedExceptions = IllegalStateException.class)
    public void end_with_no_current_element()
    {
        MarkupWriter w = new MarkupWriterImpl();

        w.end();
    }

    @Test(expectedExceptions = IllegalStateException.class)
    public void attributes_with_no_current_element()
    {
View Full Code Here

    {
        MarkupWriter w = new MarkupWriterImpl();

        w.element("root");

        assertNull(w.end());
    }

    @Test
    public void element_nesting()
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.