Package org.htmlparser.tags

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


        assertStringEquals("Link Text", "", linkTag.getLinkText());
        // Verify the reconstruction html
        assertStringEquals(
            "toHTML",
            "<A HREF=\"s/8741\"><IMG BORDER=\"0\" WIDTH=\"16\" SRC=\"http://us.i1.yimg.com/us.yimg.com/i/i16/mov_popc.gif\" HEIGHT=\"16\"></A>",
            linkTag.toHtml());
    }

    /**
     * Test case based on a report by Raghavender Srimantula, of the parser giving out of memory exceptions. Found to occur
     * on the following piece of html
View Full Code Here


        assertEquals("Link Text", "This is a test\r\n", linkTag.getLinkText());
        // Verify the reconstruction html
        assertStringEquals(
            "toHTML()",
            "<A HREF=\"s/8741\"><IMG BORDER=\"0\" WIDTH=\"16\" SRC=\"http://us.i1.yimg.com/us.yimg.com/i/i16/mov_popc.gif\" HEIGHT=\"16\">This is a test\r\n</A>",
            linkTag.toHtml());
    }

    public void testEvaluate()
    {
        LinkScanner scanner = new LinkScanner("-l");
View Full Code Here

            node[0] instanceof LinkTag);
        LinkTag linkTag = (LinkTag) node[0];
        assertStringEquals(
            "Link Raw Text",
            "<A HREF=\"mailto:somik@yahoo.com\">hello</A>",
            linkTag.toHtml());
        assertTrue(
            "Eighth Node should be a HTMLLinkTag",
            node[7] instanceof LinkTag);
        linkTag = (LinkTag) node[7];
        assertStringEquals(
View Full Code Here

            node[7] instanceof LinkTag);
        linkTag = (LinkTag) node[7];
        assertStringEquals(
            "Link Raw Text",
            "<A HREF=\"http://ads.samachar.com/bin/redirect/tech.txt?http://www.samachar.com/tech\r\nnical.html\"> Journalism 3.0</A>",
            linkTag.toHtml());
    }

    public void testTypeHttps() throws ParserException
    {
        LinkTag linkTag =
View Full Code Here

            link2 + " by Rajesh Jain","http://www.cj.com/");
        parser.setNodeFactory (new PrototypicalNodeFactory (new LinkTag ()));
        parseAndAssertNodeCount(10);
        assertTrue("First Node should be a LinkTag",node[0] instanceof LinkTag);
        LinkTag linkTag = (LinkTag)node[0];
        assertStringEquals("Link Raw Text",link1,linkTag.toHtml());
        assertTrue("Ninth Node should be a LinkTag",node[8] instanceof LinkTag);
        linkTag = (LinkTag)node[8];
        assertStringEquals("Link Raw Text",link2,linkTag.toHtml());
    }
View Full Code Here

        assertTrue("First Node should be a LinkTag",node[0] instanceof LinkTag);
        LinkTag linkTag = (LinkTag)node[0];
        assertStringEquals("Link Raw Text",link1,linkTag.toHtml());
        assertTrue("Ninth Node should be a LinkTag",node[8] instanceof LinkTag);
        linkTag = (LinkTag)node[8];
        assertStringEquals("Link Raw Text",link2,linkTag.toHtml());
    }

    public void testTypeHttps() throws ParserException
    {
        LinkTag link;
View Full Code Here

        LinkTag linkTag = (LinkTag)linkNodes.elementAt (0);
        assertStringEquals("Link","http://www.yahoo.com/s/8741",linkTag.getLink());
        // Verify the link data
        assertStringEquals("Link Text","",linkTag.getLinkText());
        // Verify the reconstruction html
        assertStringEquals("toHTML",link + "</a>",linkTag.toHtml());
    }

    /**
     * Test case based on a report by Raghavender Srimantula, of the parser giving out of memory exceptions. Found to occur
     * on the following piece of html
View Full Code Here

        LinkTag linkTag = (LinkTag)node[0];
        assertEquals("Link","http://www.yahoo.com/s/8741",linkTag.getLink());
        // Verify the link data
        assertEquals("Link Text","This is a test\n",linkTag.getLinkText());
        // Verify the reconstruction html
        assertStringEquals("toHTML()",link + "</a>",linkTag.toHtml());
    }

    /**
     * This is the reproduction of a bug which produces multiple text copies.
     */
 
View Full Code Here

    assertStringEquals("Link Text", "", linkTag.getLinkText());
    // Verify the reconstruction html
    assertStringEquals(
        "toHTML",
        "<A HREF=\"s/8741\"><IMG BORDER=\"0\" WIDTH=\"16\" SRC=\"http://us.i1.yimg.com/us.yimg.com/i/i16/mov_popc.gif\" HEIGHT=\"16\"></A>",
        linkTag.toHtml());
  }

  /**
   * Test case based on a report by Raghavender Srimantula, of the parser
   * giving out of memory exceptions. Found to occur on the following piece of
View Full Code Here

    assertEquals("Link Text", "This is a test\r\n", linkTag.getLinkText());
    // Verify the reconstruction html
    assertStringEquals(
        "toHTML()",
        "<A HREF=\"s/8741\"><IMG BORDER=\"0\" WIDTH=\"16\" SRC=\"http://us.i1.yimg.com/us.yimg.com/i/i16/mov_popc.gif\" HEIGHT=\"16\">This is a test\r\n</A>",
        linkTag.toHtml());
  }

  public void testEvaluate() {
    LinkScanner scanner = new LinkScanner("-l");
    boolean retVal = scanner.evaluate("   a href ", null);
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.