Thread: [Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/scannersTests CompositeTagScannerTest.java,1.59
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2004-05-24 16:19:17
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19028/src/org/htmlparser/tests/scannersTests Modified Files: CompositeTagScannerTest.java Log Message: Part three of a multiphase refactoring. The three node types are now fronted by interfaces (program to the interface paradigm) with concrete implementations in the new htmlparser.nodes package. Classes from the lexer.nodes package are moved to this package, and obvious references to the concrete classes that got broken by this have been changed to use the interfaces where possible. Index: CompositeTagScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/CompositeTagScannerTest.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** CompositeTagScannerTest.java 14 Jan 2004 02:53:47 -0000 1.59 --- CompositeTagScannerTest.java 24 May 2004 16:18:33 -0000 1.60 *************** *** 27,34 **** package org.htmlparser.tests.scannersTests; - import org.htmlparser.AbstractNode; import org.htmlparser.Node; import org.htmlparser.PrototypicalNodeFactory; ! import org.htmlparser.StringNode; import org.htmlparser.scanners.CompositeTagScanner; import org.htmlparser.tags.CompositeTag; --- 27,34 ---- package org.htmlparser.tests.scannersTests; import org.htmlparser.Node; import org.htmlparser.PrototypicalNodeFactory; ! import org.htmlparser.Text; ! import org.htmlparser.nodes.AbstractNode; import org.htmlparser.scanners.CompositeTagScanner; import org.htmlparser.tags.CompositeTag; *************** *** 116,120 **** assertEquals("ending line position",0,customTag.getEndingLineNumber()); Node child = customTag.childAt(0); ! assertType("child",StringNode.class,child); assertStringEquals("child text","Hello",child.toPlainTextString()); } --- 116,120 ---- assertEquals("ending line position",0,customTag.getEndingLineNumber()); Node child = customTag.childAt(0); ! assertType("child",Text.class,child); assertStringEquals("child text","Hello",child.toPlainTextString()); } *************** *** 235,240 **** assertEquals("another tag children count",1,anotherTag.getChildCount()); node = anotherTag.childAt(0); ! assertType("nested child",StringNode.class,node); ! StringNode text = (StringNode)node; assertEquals("text","Hello",text.toPlainTextString()); } --- 235,240 ---- assertEquals("another tag children count",1,anotherTag.getChildCount()); node = anotherTag.childAt(0); ! assertType("nested child",Text.class,node); ! Text text = (Text)node; assertEquals("text","Hello",text.toPlainTextString()); } *************** *** 269,274 **** assertEquals("another tag children count",1,anotherTag.getChildCount()); node = anotherTag.childAt(0); ! assertType("nested child",StringNode.class,node); ! StringNode text = (StringNode)node; assertEquals("text","Hello",text.toPlainTextString()); } --- 269,274 ---- assertEquals("another tag children count",1,anotherTag.getChildCount()); node = anotherTag.childAt(0); ! assertType("nested child",Text.class,node); ! Text text = (Text)node; assertEquals("text","Hello",text.toPlainTextString()); } *************** *** 416,420 **** AnotherTag anotherTag = (AnotherTag)customTag.childAt(0); assertEquals("anotherTag child count",1,anotherTag.getChildCount()); ! StringNode stringNode = (StringNode)anotherTag.childAt(0); assertStringEquals("anotherTag child text","something",stringNode.toPlainTextString()); assertStringEquals( --- 416,420 ---- AnotherTag anotherTag = (AnotherTag)customTag.childAt(0); assertEquals("anotherTag child count",1,anotherTag.getChildCount()); ! Text stringNode = (Text)anotherTag.childAt(0); assertStringEquals("anotherTag child text","something",stringNode.toPlainTextString()); assertStringEquals( *************** *** 532,536 **** Node firstChild = customTag.childAt(0); ! assertType("firstChild",StringNode.class,firstChild); Node parent = firstChild.getParent(); assertNotNull("first child parent should not be null",parent); --- 532,536 ---- Node firstChild = customTag.childAt(0); ! assertType("firstChild",Text.class,firstChild); Node parent = firstChild.getParent(); assertNotNull("first child parent should not be null",parent); |