org.htmlparser.tests.parserHelperTests
Class StringParserTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.htmlparser.tests.ParserTestCase
              extended byorg.htmlparser.tests.parserHelperTests.StringParserTest
All Implemented Interfaces:
junit.framework.Test

public class StringParserTest
extends ParserTestCase


Field Summary
 
Fields inherited from class org.htmlparser.tests.ParserTestCase
mLexer, node, nodeCount, parser
 
Constructor Summary
StringParserTest(java.lang.String name)
           
 
Method Summary
 void testEmptyLines()
           
 void testLastLineWithOneChar()
          Based on a bug report submitted by Cedric Rosa, if the last line contains a single character, Text does not return the string node correctly.
 void testStringBeingMissedBug()
          This is a bug reported by John Zook (586222), where the first few chars before a remark is being missed, if its on the same line.
 void testStringParserBug()
          An attempt to reproduce bug 677176, which passes.
 void testStringWithEmptyLine()
           
 void testStringWithLineBreaks()
           
 void testTagCharsInText()
          Bug reported by Roger Sollberger
For the following HTML : <a href="http://asgard.ch">[< ASGARD ></a><br> The string node is not correctly identified
 void testTextBug1()
          The bug being reproduced is this :
<HTML><HEAD><TITLE>Google</TITLE>
The above line is incorrectly parsed in that, the text Google is missed.
 void testTextBug2()
          Test string containing link.
 void testToHTML()
           
 void testToPlainTextString()
           
 
Methods inherited from class org.htmlparser.tests.ParserTestCase
assertHiddenIDTagPresent, assertNodeCount, assertNodeCount, assertSameType, assertStringEquals, assertSuperType, assertTagEquals, assertType, assertXmlEquals, createParser, createParser, createParser, createParser, failWithMessage, getParser, main, parse, parseAndAssertNodeCount, parseNodes, removeEscapeCharacters, setParser
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringParserTest

public StringParserTest(java.lang.String name)
Method Detail

testTextBug1

public void testTextBug1()
                  throws ParserException
The bug being reproduced is this :
<HTML><HEAD><TITLE>Google</TITLE>
The above line is incorrectly parsed in that, the text Google is missed. The presence of this bug is typically when some tag is identified before the string node is. (usually seen with the end tag). The bug lies in NodeReader.readElement(). Creation date: (6/17/2001 4:01:06 PM)

Throws:
ParserException

testTextBug2

public void testTextBug2()
                  throws ParserException
Test string containing link. Bug reported by Kaarle Kaila of Nokia
For the following HTML : view these documents, you must have <A href='http://www.adobe.com'>Adobe
Acrobat Reader</A> installed on your computer.
The first string before the link is not identified, and the space after the link is also not identified Creation date: (8/2/2001 2:07:32 AM)

Throws:
ParserException

testTagCharsInText

public void testTagCharsInText()
                        throws ParserException
Bug reported by Roger Sollberger
For the following HTML : <a href="http://asgard.ch">[< ASGARD ></a><br> The string node is not correctly identified

Throws:
ParserException

testToPlainTextString

public void testToPlainTextString()
                           throws ParserException
Throws:
ParserException

testToHTML

public void testToHTML()
                throws ParserException
Throws:
ParserException

testEmptyLines

public void testEmptyLines()
                    throws ParserException
Throws:
ParserException

testStringBeingMissedBug

public void testStringBeingMissedBug()
                              throws ParserException
This is a bug reported by John Zook (586222), where the first few chars before a remark is being missed, if its on the same line.

Throws:
ParserException

testLastLineWithOneChar

public void testLastLineWithOneChar()
                             throws ParserException
Based on a bug report submitted by Cedric Rosa, if the last line contains a single character, Text does not return the string node correctly.

Throws:
ParserException

testStringWithEmptyLine

public void testStringWithEmptyLine()
                             throws ParserException
Throws:
ParserException

testStringParserBug

public void testStringParserBug()
                         throws java.lang.Exception
An attempt to reproduce bug 677176, which passes.

Throws:
java.lang.Exception

testStringWithLineBreaks

public void testStringWithLineBreaks()
                              throws java.lang.Exception
Throws:
java.lang.Exception