Package org.htmlparser.tags

Examples of org.htmlparser.tags.BodyTag.toHtml()


        BodyTag bodyTag = (BodyTag) node[4];
        assertEquals("Body", "This is a body tag", bodyTag.getBody());
        assertEquals(
            "Body",
            "<BODY>This is a body tag</BODY>",
            bodyTag.toHtml());
        assertEquals("Body Scanner", bodyScanner, bodyTag.getThisScanner());
    }

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


        // check the body node
        BodyTag bodyTag = (BodyTag) node[4];
        assertStringEquals(
            "Body",
            "<BODY><%=BodyValue%></BODY>",
            bodyTag.toHtml());
        assertEquals("Body Scanner", bodyScanner, bodyTag.getThisScanner());
    }

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

        // check the body node
        BodyTag bodyTag = (BodyTag) node[4];
        assertEquals(
            "Body",
            "<BODY>before jsp<%=BodyValue%>after jsp</BODY>",
            bodyTag.toHtml());
        assertEquals("Body Scanner", bodyScanner, bodyTag.getThisScanner());
    }

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

        // check the body node
        BodyTag bodyTag = (BodyTag) node[1];
        assertEquals(
            "Body",
            "<BODY>before jsp<%=BodyValue%>after jsp</BODY>",
            bodyTag.toHtml());
        assertEquals("Body Scanner", bodyScanner, bodyTag.getThisScanner());
    }

    public static TestSuite suite()
    {
View Full Code Here

        parseAndAssertNodeCount(6);
        assertTrue(node[4] instanceof BodyTag);
        // check the body node
        BodyTag bodyTag = (BodyTag) node[4];
        assertEquals("Body","This is a body tag",bodyTag.getBody());
        assertEquals("Body","<body>This is a body tag</body>",bodyTag.toHtml());
    }

    public void testBodywithJsp() throws ParserException {
        String body = "<body><%=BodyValue%></body>";
        createParser("<html><head><title>Test 1</title></head>" + body + "</html>");
View Full Code Here

        parser.setNodeFactory (new PrototypicalNodeFactory (new BodyTag ()));
        parseAndAssertNodeCount(8);
        assertTrue(node[6] instanceof BodyTag);
        // check the body node
        BodyTag bodyTag = (BodyTag) node[6];
        assertStringEquals("Body",body,bodyTag.toHtml());
    }

    public void testBodyMixed() throws ParserException {
        String body = "<body>before jsp<%=BodyValue%>after jsp</body>";
        createParser("<html><head><title>Test 1</title></head>" + body + "</html>");
View Full Code Here

                }));
        parseAndAssertNodeCount(6);
        assertTrue(node[4] instanceof BodyTag);
        // check the body node
        BodyTag bodyTag = (BodyTag) node[4];
        assertEquals("Body",body,bodyTag.toHtml());
    }

    public void testBodyEnding() throws ParserException {
        String body = "<body>before jsp<%=BodyValue%>after jsp";
        createParser("<html>" + body + "</html>");
View Full Code Here

        parser.setNodeFactory (new PrototypicalNodeFactory (new BodyTag ()));
        parseAndAssertNodeCount(3);
        assertTrue(node[1] instanceof BodyTag);
        // check the body node
        BodyTag bodyTag = (BodyTag) node[1];
        assertEquals("Body",body + "</body>",bodyTag.toHtml());
    }

    public static TestSuite suite()
    {
        return new TestSuite(BodyTagTest.class);
View Full Code Here

        assertEquals ("only one element", 1, list.size ());
        assertType ("should be BodyTag", BodyTag.class, list.elementAt (0));
        BodyTag body = (BodyTag)list.elementAt (0);
        assertEquals ("only one child", 1, body.getChildCount ());
        assertSuperType ("should be Text", Text.class, body.getChildren ().elementAt (0));
        assertStringEquals("html", guts, body.toHtml ());
    }


    /**
     * Test tag name filtering.
View Full Code Here

        createParser(body);
        parseAndAssertNodeCount(1);
        // The node should be a body Tag
        assertTrue("Node should be a BodyTag",node[0] instanceof BodyTag);
        BodyTag tag = (BodyTag)node[0];
        String text = tag.toHtml ();
        assertEquals("Contents of the tag",body + "</BODY>",text);
    }

    /**
     * The following should be identified as a tag : <BR>
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.