Example usage for org.apache.wicket.markup IMarkupFragment size

List of usage examples for org.apache.wicket.markup IMarkupFragment size

Introduction

In this page you can find the example usage for org.apache.wicket.markup IMarkupFragment size.

Prototype

int size();

Source Link

Document

The number of markup elements.

Usage

From source file:sf.wicklet.wicketext.wicket.core.test.MarkupParser01.java

License:Apache License

@Test
public void test01() throws IOException, ResourceStreamNotFoundException {
    final String DATA = "/sf/wicklet/wicketext/wicket/core/test/MarkupParser01Test01.html";
    final String content = FileUtil.getResourceAsString(DATA);
    new WicketTester();
    final MarkupParser parser = new MarkupParser(content);
    final IMarkupFragment ret = parser.parse();
    int components = 0;
    if (DEBUG) {/*from w w  w. ja va 2 s  . com*/
        System.out.println("### Markup: " + ret.size());
    }
    for (final IMarkupElement e : ret) {
        if (DEBUG) {
            System.out.println(e.getClass().getName() + ": " + e.toUserDebugString());
        }
        if (e instanceof ComponentTag) {
            ++components;
        }
    }
    assertEquals(7, components);
}