Examples of StringNode


Examples of org.htmlparser.StringNode

        Node expectedNode,
        Node actualNode)
    {
        if (expectedNode instanceof StringNode)
        {
            StringNode expectedString = (StringNode) expectedNode;
            StringNode actualString = (StringNode) actualNode;
            assertStringEquals(
                displayMessage,
                expectedString.getText(),
                actualString.getText());
        }
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        parseAndAssertNodeCount(5);
        // The fourth node should be a HTMLStringNode-  with the text - Google
        assertTrue(
            "Fourth node should be a HTMLStringNode",
            node[3] instanceof StringNode);
        StringNode stringNode = (StringNode) node[3];
        assertEquals("Text of the StringNode", "Google", stringNode.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        parseAndAssertNodeCount(3);
        // The first node should be a HTMLStringNode-  with the text - view these documents, you must have
        assertTrue(
            "First node should be a HTMLStringNode",
            node[0] instanceof StringNode);
        StringNode stringNode = (StringNode) node[0];
        assertEquals(
            "Text of the StringNode",
            "view these documents, you must have ",
            stringNode.getText());
        assertTrue(
            "Second node should be a link node",
            node[1] instanceof LinkTag);
        LinkTag linkNode = (LinkTag) node[1];
        assertEquals("Link is", "http://www.adobe.com", linkNode.getLink());
        assertEquals(
            "Link text is",
            "Adobe \r\nAcrobat Reader",
            linkNode.getLinkText());

        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode2 = (StringNode) node[2];
        assertEquals(
            "Contents of third node",
            " installed on your computer.",
            stringNode2.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        createParser("<HTML><HEAD><TITLE>This is the Title</TITLE></HEAD><BODY>Hello World, this is the HTML Parser</BODY></HTML>");
        parseAndAssertNodeCount(10);
        assertTrue(
            "Fourth Node identified must be a string node",
            node[3] instanceof StringNode);
        StringNode stringNode = (StringNode) node[3];
        assertEquals(
            "First String Node",
            "This is the Title",
            stringNode.toPlainTextString());
        assertTrue(
            "Eighth Node identified must be a string node",
            node[7] instanceof StringNode);
        stringNode = (StringNode) node[7];
        assertEquals(
            "Second string node",
            "Hello World, this is the HTML Parser",
            stringNode.toPlainTextString());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        createParser("<HTML><HEAD><TITLE>This is the Title</TITLE></HEAD><BODY>Hello World, this is the HTML Parser</BODY></HTML>");
        parseAndAssertNodeCount(10);
        assertTrue(
            "Fourth Node identified must be a string node",
            node[3] instanceof StringNode);
        StringNode stringNode = (StringNode) node[3];
        assertEquals(
            "First String Node",
            "This is the Title",
            stringNode.toHtml());
        assertTrue(
            "Eighth Node identified must be a string node",
            node[7] instanceof StringNode);
        stringNode = (StringNode) node[7];
        assertEquals(
            "Second string node",
            "Hello World, this is the HTML Parser",
            stringNode.toHtml());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

            "Second node should be HTMLRemarkNode",
            node[1] instanceof RemarkNode);
        assertTrue(
            "Third node should be HTMLStringNode",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[0];
        assertEquals(
            "First String node contents",
            "Before Comment ",
            stringNode.getText());
        StringNode stringNode2 = (StringNode) node[2];
        assertEquals(
            "Second String node contents",
            " After Comment",
            stringNode2.getText());
        RemarkNode remarkNode = (RemarkNode) node[1];
        assertEquals("Remark Node contents", " Comment ", remarkNode.getText());

    }
View Full Code Here

Examples of org.htmlparser.StringNode

        createParser("a");
        parseAndAssertNodeCount(1);
        assertTrue(
            "First node should be HTMLStringNode",
            node[0] instanceof StringNode);
        StringNode stringNode = (StringNode) node[0];
        assertEquals("First String node contents", "a", stringNode.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        createParser("a\n\nb");
        parseAndAssertNodeCount(1);
        assertTrue(
            "First node should be HTMLStringNode",
            node[0] instanceof StringNode);
        StringNode stringNode = (StringNode) node[0];
        assertStringEquals(
            "First String node contents",
            "a\r\n\r\nb",
            stringNode.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

    public void testStringWithLineBreaks() throws Exception
    {
        createParser("Testing &\nRefactoring");
        parseAndAssertNodeCount(1);
        assertType("first node", StringNode.class, node[0]);
        StringNode stringNode = (StringNode) node[0];
        assertStringEquals(
            "text",
            "Testing &\r\nRefactoring",
            stringNode.toPlainTextString());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

    parseAndAssertNodeCount(6);
    // The first node should be a Tag
    assertTrue("First node should be a Tag", node[0] instanceof Tag);
    // The second node should be a HTMLStringNode
    assertTrue("Second node should be a HTMLStringNode", node[1] instanceof StringNode);
    StringNode stringNode = (StringNode) node[1];
    assertEquals("Text of the StringNode", "Site Comments?", stringNode.getText());
    assertTrue("Third node should be a tag", node[2] instanceof Tag);

  }
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.