Examples of toPlainTextString()


Examples of org.htmlparser.Text.toPlainTextString()

        AnotherTag anotherTag = (AnotherTag)node;
        assertEquals("another tag children count",1,anotherTag.getChildCount());
        node = anotherTag.childAt(0);
        assertType("nested child",Text.class,node);
        Text text = (Text)node;
        assertEquals("text","Hello",text.toPlainTextString());
    }

    public void testCompositeTagWithTwoNestedTags() throws ParserException {
        createParser(
            "<Custom>" +
View Full Code Here

Examples of org.htmlparser.Text.toPlainTextString()

        AnotherTag anotherTag = (AnotherTag)node;
        assertEquals("another tag children count",1,anotherTag.getChildCount());
        node = anotherTag.childAt(0);
        assertType("nested child",Text.class,node);
        Text text = (Text)node;
        assertEquals("text","Hello",text.toPlainTextString());
    }

    public void testErroneousCompositeTag() throws ParserException {
        String html = "<custom>";
        createParser(html);
View Full Code Here

Examples of org.htmlparser.Text.toPlainTextString()

        assertEquals("starting line position",0,customTag.getStartingLineNumber());
        assertEquals("ending line position",0,customTag.getEndingLineNumber());
        AnotherTag anotherTag = (AnotherTag)customTag.childAt(0);
        assertEquals("anotherTag child count",1,anotherTag.getChildCount());
        Text stringNode = (Text)anotherTag.childAt(0);
        assertStringEquals("anotherTag child text","something",stringNode.toPlainTextString());
        assertStringEquals(
            "first custom tag html",
            "<custom><another>something</another></custom>",
            customTag.toHtml()
        );
View Full Code Here

Examples of org.htmlparser.tags.Div.toPlainTextString()

        parser.addScanner(new DivScanner());
        parseAndAssertNodeCount(1);
        assertType("node should be table", TableTag.class, node[0]);
        TableTag tableTag = (TableTag) node[0];
        Div div = (Div) tableTag.searchFor(Div.class).toNodeArray()[0];
        assertEquals("div contents", "some text", div.toPlainTextString());
    }

    /**
     * Test case for bug #735193 Explicit tag type recognition for CompositTags not working.
     */
 
View Full Code Here

Examples of org.htmlparser.tags.FormTag.toPlainTextString()

        assertTrue("Node 0 should be Form Tag", node[0] instanceof FormTag);
        FormTag formTag = (FormTag) node[0];
        assertStringEquals(
            "Form Tag string representation",
            "&nbsp;User NamePassword&nbsp;&nbsp;Contents of TextArea",
            formTag.toPlainTextString());
    }

    public void testSearchFor() throws ParserException
    {
        createParser(FormScannerTest.FORM_HTML);
View Full Code Here

Examples of org.htmlparser.tags.FormTag.toPlainTextString()

    {
        createParser(FORM_HTML);
        parseAndAssertNodeCount(1);
        assertTrue("Node 0 should be Form Tag",node[0] instanceof FormTag);
        FormTag formTag = (FormTag)node[0];
        assertStringEquals("Form Tag string representation","\n&nbsp;\nUser Name\n\nPassword\n\n&nbsp;\n\n&nbsp;\nContents of TextArea\n\n\n", formTag.toPlainTextString());
    }

    public void testSearchFor() throws ParserException
    {
        createParser(FORM_HTML);
View Full Code Here

Examples of org.htmlparser.tags.LinkTag.toPlainTextString()

        LinkTag linkTag = (LinkTag) node[0];

        assertEquals(
            "Link Plain Text",
            "not@for.real",
            linkTag.toPlainTextString());
        assertTrue("Link is not a mail link", !linkTag.isMailLink());
    }

    public void testMailtoLink() throws ParserException
    {
View Full Code Here

Examples of org.htmlparser.tags.LinkTag.toPlainTextString()

        assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
        LinkTag linkTag = (LinkTag) node[0];
        assertEquals(
            "Link Plain Text",
            "this@is.real",
            linkTag.toPlainTextString());
        assertTrue("Link is a mail link", linkTag.isMailLink());
    }

    public void testJavascriptLink() throws ParserException
    {
View Full Code Here

Examples of org.htmlparser.tags.LinkTag.toPlainTextString()

        LinkTag linkTag = (LinkTag) node[0];

        assertEquals(
            "Link Plain Text",
            "say hello",
            linkTag.toPlainTextString());
        assertTrue("Link is a Javascript command", linkTag.isJavascriptLink());
    }

    public void testNotJavascriptLink() throws ParserException
    {
View Full Code Here

Examples of org.htmlparser.tags.LinkTag.toPlainTextString()

        LinkTag linkTag = (LinkTag) node[0];

        assertEquals(
            "Link Plain Text",
            "say hello",
            linkTag.toPlainTextString());
        assertTrue(
            "Link is not a Javascript command",
            !linkTag.isJavascriptLink());
    }
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.