org.htmlparser.tests.parserHelperTests
Class RemarkNodeParserTest

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

public class RemarkNodeParserTest
extends ParserTestCase


Field Summary
 
Fields inherited from class org.htmlparser.tests.ParserTestCase
mLexer, node, nodeCount, parser
 
Constructor Summary
RemarkNodeParserTest(java.lang.String name)
           
 
Method Summary
 void testDashesInComment()
          Bug reported by John Zook [594301] If dashes exist in a comment, they dont get added to the comment text
 void testDoubleComment()
          Test a comment declaration with two comments.
 void testEmptyComment()
          Test a comment declaration without any comments.
 void testExclamationComment()
          Test exclamation mark ending.
 void testInvalidTag()
          Bug reported by John Zook [594301], invalid remark nodes are accepted as remark nodes.
 void testNonRemark()
           
 void testRemarkBug()
          Test unparsed remark node.
 void testRemarkWithBlankLine()
          This is the simulation of bug report 586756, submitted by John Zook.
 void testRemarkWithNothing()
          This is the simulation of a bug report submitted by Claude Duguay.
 void testSingleComment()
          Test a comment declaration with a comment.
 void testTagWithinRemark()
          Test tag within remark.
 void testToPlainTextString()
           
 void testToRawString()
           
 
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

RemarkNodeParserTest

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

testRemarkBug

public void testRemarkBug()
                   throws ParserException
Test unparsed remark node. The bug being reproduced is this :
<!-- saved from url=(0022)http://internet.e-mail --> <HTML> <HEAD><META name="title" content="Training Introduction"> <META name="subject" content=""> <!-- Whats gonna happen now ? --> <TEST> </TEST> The above line is incorrectly parsed - the remark is not correctly identified. This bug was reported by Serge Kruppa (2002-Feb-08).

Throws:
ParserException

testToPlainTextString

public void testToPlainTextString()
                           throws ParserException
Throws:
ParserException

testToRawString

public void testToRawString()
                     throws ParserException
Throws:
ParserException

testNonRemark

public void testNonRemark()
                   throws ParserException
Throws:
ParserException

testRemarkWithBlankLine

public void testRemarkWithBlankLine()
                             throws ParserException
This is the simulation of bug report 586756, submitted by John Zook. If all the comment contains is a blank line, it breaks the state

Throws:
ParserException

testRemarkWithNothing

public void testRemarkWithNothing()
                           throws ParserException
This is the simulation of a bug report submitted by Claude Duguay. If it is a comment with nothing in it, parser crashes

Throws:
ParserException

testTagWithinRemark

public void testTagWithinRemark()
                         throws ParserException
Test tag within remark. Reproduction of bug reported by John Zook [594301] When we have tags like : <!-- <A> --> it doesent get parsed correctly

Throws:
ParserException

testInvalidTag

public void testInvalidTag()
                    throws ParserException
Bug reported by John Zook [594301], invalid remark nodes are accepted as remark nodes. <
-
-
ssd -->
This is not supposed to be a Remark

Throws:
ParserException

testDashesInComment

public void testDashesInComment()
                         throws ParserException
Bug reported by John Zook [594301] If dashes exist in a comment, they dont get added to the comment text

Throws:
ParserException

testSingleComment

public void testSingleComment()
                       throws ParserException
Test a comment declaration with a comment.

Throws:
ParserException

testDoubleComment

public void testDoubleComment()
                       throws ParserException
Test a comment declaration with two comments.

Throws:
ParserException

testEmptyComment

public void testEmptyComment()
                      throws ParserException
Test a comment declaration without any comments.

Throws:
ParserException

testExclamationComment

public void testExclamationComment()
                            throws ParserException
Test exclamation mark ending. Test a comment ending with !--. See bug #788746 parser crashes on comments like

Throws:
ParserException