[Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/parserHelperTests CompositeTagScannerHelperTest
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-09-29 21:38:46
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests In directory sc8-pr-cvs1:/tmp/cvs-serv30684/tests/parserHelperTests Modified Files: CompositeTagScannerHelperTest.java Log Message: Lexer Integration Removed old Parser classes. Removed EndTag, this class was replaced by a call to the new isEndTag() method on the Tag class The StringNode, RemarkNode and tags.Tag class now derive from their lexeme counterparts in lexer.nodes instead of the other way around. The beginnings of a node factory interface are included. This was added so the lexer could return 'visitable' nodes to the parser. The parser acts as it's own node factory, as does the Lexer. The node count for parsing goes up in most cases because every whitespace (i.e. newline) now counts as a StringNode. This has whacked out a lot of the tests that were expecting fewer nodes or a certain type of node at a particular index. Attributes now maintain their order and case. The count of attributes also went up because whitespace is maintained within tags too. The storage in a Vector means the element 0 Attribute is actually the name of the tag, rather than having the $TAGNAME entry in a HashTable. Index: CompositeTagScannerHelperTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/CompositeTagScannerHelperTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CompositeTagScannerHelperTest.java 22 Sep 2003 02:40:07 -0000 1.21 --- CompositeTagScannerHelperTest.java 28 Sep 2003 15:33:59 -0000 1.22 *************** *** 47,70 **** protected void setUp() { ! helper = ! new CompositeTagScannerHelper(null,null,null,null,null,false); } public void testIsXmlEndTagForRealXml() { ! Tag tag = new Tag( ! new TagData( ! 0,0,"something/","" ! ) ! ); ! assertTrue("should be an xml end tag",helper.isXmlEndTag(tag)); } public void testIsXmlEndTagForFalseMatches() { ! Tag tag = new Tag( ! new TagData( ! 0,0,"a href=http://someurl.com/","" ! ) ! ); ! assertFalse("should not be an xml end tag",helper.isXmlEndTag(tag)); } } --- 47,72 ---- protected void setUp() { ! // helper = ! // new CompositeTagScannerHelper(null,null,null,null,null,false); } public void testIsXmlEndTagForRealXml() { ! fail ("not implemented"); ! // Tag tag = new Tag( ! // new TagData( ! // 0,0,"something/","" ! // ) ! // ); ! // assertTrue("should be an xml end tag",helper.isXmlEndTag(tag)); } public void testIsXmlEndTagForFalseMatches() { ! fail ("not implemented"); ! // Tag tag = new Tag( ! // new TagData( ! // 0,0,"a href=http://someurl.com/","" ! // ) ! // ); ! // assertFalse("should not be an xml end tag",helper.isXmlEndTag(tag)); } } |