Examples of childAt()


Examples of org.htmlparser.tags.Html.childAt()

        "</style>","http://www.yle.fi/");
        parseAndAssertNodeCount(1);
        assertTrue("First node should be a HTML tag", node[0] instanceof Html);
        Html html = (Html)node[0];
        assertTrue("HTML tag should have one child", 1 == html.getChildCount ());
        assertTrue("First child should be a HEAD tag", html.childAt (0) instanceof HeadTag);
        HeadTag head = (HeadTag)html.childAt (0);
        assertTrue("HEAD tag should have three children", 3 == head.getChildCount ());
        assertTrue("Third child should be a STYLE tag", head.childAt (2) instanceof StyleTag);
        StyleTag styleTag = (StyleTag)head.childAt (2);
        assertStringEquals("Expected Style Code",expectedCode,styleTag.getStyleCode());
View Full Code Here

Examples of org.htmlparser.tags.Html.childAt()

        parseAndAssertNodeCount(1);
        assertTrue("First node should be a HTML tag", node[0] instanceof Html);
        Html html = (Html)node[0];
        assertTrue("HTML tag should have one child", 1 == html.getChildCount ());
        assertTrue("First child should be a HEAD tag", html.childAt (0) instanceof HeadTag);
        HeadTag head = (HeadTag)html.childAt (0);
        assertTrue("HEAD tag should have three children", 3 == head.getChildCount ());
        assertTrue("Third child should be a STYLE tag", head.childAt (2) instanceof StyleTag);
        StyleTag styleTag = (StyleTag)head.childAt (2);
        assertStringEquals("Expected Style Code",expectedCode,styleTag.getStyleCode());
    }
View Full Code Here

Examples of org.htmlparser.tags.TableColumn.childAt()

        TableTag table = (TableTag) node[1];
        assertEquals("rows", 3, table.getRowCount());
        TableRow tr = table.getRow(2);
        assertEquals("columns", 1, tr.getColumnCount());
        TableColumn td = tr.getColumns()[0];
        Node node = td.childAt(0);
        assertType("node", TableTag.class, node);
        TableTag table2 = (TableTag) node;
        assertEquals("second table row count", 1, table2.getRowCount());
        tr = table2.getRow(0);
        assertEquals("second table col count", 2, tr.getColumnCount());
View Full Code Here

Examples of org.htmlparser.tags.TableColumn.childAt()

        TableRow row = (TableRow)table.childAt (1);
        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
View Full Code Here

Examples of org.htmlparser.tags.TableColumn.childAt()

        TableTag table = (TableTag)html.getChild (1);
        assertEquals("rows",3,table.getRowCount());
        TableRow tr = table.getRow(2);
        assertEquals("columns",1,tr.getColumnCount());
        TableColumn td = tr.getColumns()[0];
        Node node = td.childAt(1);
        assertType("node",TableTag.class,node);
        TableTag table2 = (TableTag)node;
        assertEquals("second table row count",1,table2.getRowCount());
        tr = table2.getRow(0);
        assertEquals("second table col count",2,tr.getColumnCount());
View Full Code Here

Examples of org.htmlparser.tags.TableColumn.childAt()

        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
        assertType ("bogus div", Div.class, div.childAt (2));
View Full Code Here

Examples of org.htmlparser.tags.TableColumn.childAt()

    TableTag table = (TableTag) node[1];
    assertEquals("rows", 3, table.getRowCount());
    TableRow tr = table.getRow(2);
    assertEquals("columns", 1, tr.getColumnCount());
    TableColumn td = tr.getColumns()[0];
    Node node = td.childAt(0);
    assertType("node", TableTag.class, node);
    TableTag table2 = (TableTag) node;
    assertEquals("second table row count", 1, table2.getRowCount());
    tr = table2.getRow(0);
    assertEquals("second table col count", 2, tr.getColumnCount());
View Full Code Here

Examples of org.htmlparser.tags.TableRow.childAt()

        TableTag table = (TableTag)node[0];
        assertTrue ("table should have 3 nodes", 3 == table.getChildCount ());
        assertType ("row", TableRow.class, table.childAt (1));
        TableRow row = (TableRow)table.childAt (1);
        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
View Full Code Here

Examples of org.htmlparser.tags.TableRow.childAt()

        assertTrue ("table should have 3 nodes", 3 == table.getChildCount ());
        assertType ("row", TableRow.class, table.childAt (1));
        TableRow row = (TableRow)table.childAt (1);
        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
View Full Code Here

Examples of org.htmlparser.tags.TableTag.childAt()

        createParser (html);
        parseAndAssertNodeCount (1);
        assertType ("table", TableTag.class, node[0]);
        TableTag table = (TableTag)node[0];
        assertTrue ("table should have 3 nodes", 3 == table.getChildCount ());
        assertType ("row", TableRow.class, table.childAt (1));
        TableRow row = (TableRow)table.childAt (1);
        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
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.