htmlparser-cvs Mailing List for HTML Parser (Page 34)
Brought to you by:
derrickoswald
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(141) |
Jun
(108) |
Jul
(66) |
Aug
(127) |
Sep
(155) |
Oct
(149) |
Nov
(72) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(100) |
Feb
(36) |
Mar
(21) |
Apr
(3) |
May
(87) |
Jun
(28) |
Jul
(84) |
Aug
(5) |
Sep
(14) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
(39) |
Mar
(26) |
Apr
(38) |
May
(14) |
Jun
(10) |
Jul
|
Aug
|
Sep
(13) |
Oct
(8) |
Nov
(10) |
Dec
|
2006 |
Jan
|
Feb
(1) |
Mar
(17) |
Apr
(20) |
May
(28) |
Jun
(24) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <der...@us...> - 2003-10-26 17:59:30
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer In directory sc8-pr-cvs1:/tmp/cvs-serv7966 Modified Files: PageIndex.java package.html Log Message: Doco update. Move the lexer from future tense to current. Index: PageIndex.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/PageIndex.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PageIndex.java 29 Sep 2003 00:00:39 -0000 1.10 --- PageIndex.java 26 Oct 2003 17:58:25 -0000 1.11 *************** *** 39,45 **** /** ! * A sorted array of integers which are the positions of end of line characters. ! * Maintains a list of integers which are (the positions of the first ! * characters of each line. * To facilitate processing the first element should be maintained at position 0. * Facilities to add, remove, search and determine row and column are provided. --- 39,43 ---- /** ! * A sorted array of integers, the positions of the first characters of each line. * To facilitate processing the first element should be maintained at position 0. * Facilities to add, remove, search and determine row and column are provided. Index: package.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/package.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** package.html 22 Sep 2003 02:39:59 -0000 1.7 --- package.html 26 Oct 2003 17:58:25 -0000 1.8 *************** *** 39,44 **** </HEAD> <BODY> ! The lexer package will eventually be the base level I/O subsystem. ! <EM>It is currently under development.</EM> <P>The lexer package is responsible for reading characters from the HTML source and identifying the node lexemes. For example, the HTML code below would return --- 39,43 ---- </HEAD> <BODY> ! The lexer package is the base level I/O subsystem. <P>The lexer package is responsible for reading characters from the HTML source and identifying the node lexemes. For example, the HTML code below would return *************** *** 98,110 **** <DD><B>Adjacent nodes have no characters between them.</B> The list of nodes forms an uninterrupted chain that, by start and end definitions, completely covers the ! characters that were read from the HTML source. Despite this, the nodes are not ! stored in a linked list, but rather an array to ease any editing tasks that may ! be performed. <DT>Text Fidelity ! <DD>Besides complete coverage, the <B>nodes do not contain copies of the text</B>, ! but instead simply contain offsets into a single large buffer that contains the ! text read from the HTML source. Even within tags, the attributes list can ! contain whitespace, thus there is no lost whitespace or text formatting ! either outside or within tags. Upper and lower case text is preserved. <DT>Line Endings <DD><B>End of line characters are just whitespace.</B> There is no distinction --- 97,108 ---- <DD><B>Adjacent nodes have no characters between them.</B> The list of nodes forms an uninterrupted chain that, by start and end definitions, completely covers the ! characters that were read from the HTML source. <DT>Text Fidelity ! <DD>Besides complete coverage, the <B>nodes do not initially contain copies of ! the text</B>, but instead simply contain offsets into a single large buffer ! that contains the text read from the HTML source. Even within tags, the ! attributes list can contain whitespace, thus there is no lost whitespace or ! text formatting either outside or within tags. Upper and lower case text is ! preserved. <DT>Line Endings <DD><B>End of line characters are just whitespace.</B> There is no distinction *************** *** 127,138 **** all that's needed for a low level parse of the HTML source. In previous implementations, the attributes were parsed on a second scan after the initial ! tag was extracted. <DT>Two Jars <DD>For elementary operations at the node level, a minimalist jar file containing <B>only the lexer and base tag classes</B> is split out from the larger <CODE>htmlparser.jar</CODE>. In this way, simple parsing and output is handled with a jar file that is under ! 40 kilobytes, but anything beyond peephole manipulation, i.e. closing tag detection and other semantic reasoning will need the full set of scanners, nodes and ancillary ! classes, which now stands at 160 kilobytes. </DL> </BODY> --- 125,137 ---- all that's needed for a low level parse of the HTML source. In previous implementations, the attributes were parsed on a second scan after the initial ! tag was extracted. (Actually, for error conditions, the lexer can back up a ! node to handle missing end tags etc.). <DT>Two Jars <DD>For elementary operations at the node level, a minimalist jar file containing <B>only the lexer and base tag classes</B> is split out from the larger <CODE>htmlparser.jar</CODE>. In this way, simple parsing and output is handled with a jar file that is under ! 45 kilobytes, but anything beyond peephole manipulation, i.e. closing tag detection and other semantic reasoning will need the full set of scanners, nodes and ancillary ! classes, which now stands at 210 kilobytes. </DL> </BODY> |
From: <der...@us...> - 2003-10-26 17:31:40
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners In directory sc8-pr-cvs1:/tmp/cvs-serv18628/scanners Modified Files: CompositeTagScanner.java Log Message: Removed the need for CompositeTagScannerHelper, finally getting rid of the parserHelper package. Index: CompositeTagScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/CompositeTagScanner.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** CompositeTagScanner.java 20 Oct 2003 01:28:03 -0000 1.70 --- CompositeTagScanner.java 26 Oct 2003 15:50:57 -0000 1.71 *************** *** 36,40 **** --- 36,42 ---- import org.htmlparser.lexer.Lexer; import org.htmlparser.lexer.Page; + import org.htmlparser.lexer.nodes.Attribute; import org.htmlparser.parserHelper.CompositeTagScannerHelper; + import org.htmlparser.tags.CompositeTag; import org.htmlparser.tags.Tag; import org.htmlparser.util.NodeList; *************** *** 185,193 **** } ! public Tag scan (Tag tag, String url, Lexer lexer) throws ParserException { ! CompositeTagScannerHelper helper = ! new CompositeTagScannerHelper(this, tag, lexer, balance_quotes); ! return helper.scan(); } --- 187,313 ---- } ! /** ! * Collect the children. ! * Performs an immediate call to {@link #shouldCreateEndTagAndExit} to ! * allow subclasses to override the scan is a primitive way. If ! * <code>true</code>, returns a virtual end tag and repositions the lexer ! * to re-read that same tag.<p> ! * Otherwise, calls {@link #beforeScanningStarts} and begins scanning. ! * An initial test is performed for an empty XML tag, in which case ! * the start tag and end tag of the returned tag are the same and it has ! * no children.<p> ! * If it's not an empty XML tag, the lexer is repeatedly asked for ! * subsequent nodes until an end tag is found or a node is encountered ! * that matches the tag ender set or end tag ender set, or a node of ! * the same type is found and {@link #isAllowSelfChildren} returns ! * <code>false</code>. In all but the first case, a virtual end tag ! * is created. Each node found that is not the end tag is added to ! * the list of children and a call made to {@link #childNodeEncountered}.<p> ! * The scanner's {@link #createTag} method is called with details about ! * the start tag, end tag and children. The attributes from the start tag ! * will wind up duplicated in the newly created tag, so the start tag is ! * kind of redundant (and may be removed in subsequent refactoring). ! * @param tag The tag this scanner is responsible for. This will be the ! * start (and possibly end) tag passed to {@link #createTag}. ! * @param url The url for the page the tag is discovered on. ! * @param lexer The source of subsequent nodes. ! * @return The scanner specific tag from the call to {@link #createTag}., ! * or the virtual end tag if {@link #shouldCreateEndTagAndExit} returned ! * <code>true</code>. ! */ ! public Tag scan (Tag tag, String url, Lexer lexer) throws ParserException { ! Node node; ! NodeList nodeList; ! Tag endTag; ! CompositeTag composite; ! Tag ret; ! ! if (shouldCreateEndTagAndExit ()) ! { ! ret = createVirtualEndTag (tag, lexer.getPage (), tag.elementBegin ()); ! lexer.setPosition (tag.elementBegin ()); ! } ! else ! { ! beforeScanningStarts (); ! nodeList = new NodeList (); ! endTag = null; ! ! if (tag.isEmptyXmlTag ()) ! endTag = tag; ! else ! do ! { ! node = lexer.nextNode (balance_quotes); ! if (null != node) ! { ! if (node instanceof Tag) ! { ! Tag end = (Tag)node; ! // check for normal end tag ! if (end.isEndTag () && end.getTagName ().equals (tag.getTagName ())) ! { ! endTag = end; ! node = null; ! } ! else if (isTagToBeEndedFor (end) || // check DTD ! ( // check for child of same name not allowed ! !(end.isEndTag ()) && ! !isAllowSelfChildren () && ! end.getTagName ().equals (tag.getTagName ()) ! )) ! { ! endTag = createVirtualEndTag (tag, lexer.getPage (), end.elementBegin ()); ! lexer.setPosition (end.elementBegin ()); ! node = null; ! } ! } ! ! if (null != node) ! { ! nodeList.add (node); ! childNodeEncountered (node); ! } ! } ! } ! while (null != node); ! ! if (null == endTag) ! endTag = createVirtualEndTag (tag, lexer.getPage (), lexer.getCursor ().getPosition ()); ! ! composite = (CompositeTag)createTag (lexer.getPage (), tag.elementBegin (), endTag.elementEnd (), tag.getAttributesEx (), tag, endTag, nodeList); ! for (int i = 0; i < composite.getChildCount (); i++) ! composite.childAt (i).setParent (composite); ! ret = composite; ! } ! ! return (ret); ! } ! ! /** ! * Creates an end tag with the same name as the given tag. ! * NOTE: This does not call the {@link #createTag} method, but may in the ! * future after refactoring. ! * @param tag The tag to end. ! * @param page The page the tag is on (virtually). ! * @param position The offset into the page at which the tag is to ! * be anchored. ! * @return An end tag with the name "/" + tag.getTagName() and a start ! * and end position at the given position. The fact these are equal may ! * be used to distinguish it as a virtual tag. ! */ ! protected Tag createVirtualEndTag (Tag tag, Page page, int position) ! { ! Tag ret; ! String name; ! Vector attributes; ! ! name = "/" + tag.getRawTagName(); ! attributes = new Vector (); ! attributes.addElement (new Attribute (name, (String)null)); ! ret = new Tag (page, position, position, attributes); ! ! return (ret); } *************** *** 228,232 **** * @param startTag The tag that begins the composite tag. * @param endTag The tag that ends the composite tag. Note this could be a ! * virtual tag created to satisfy the scanner (check is it's starting and * ending position are the same). * @param children The list of nodes contained within the ebgin end tag pair. --- 348,352 ---- * @param startTag The tag that begins the composite tag. * @param endTag The tag that ends the composite tag. Note this could be a ! * virtual tag created to satisfy the scanner (check if it's starting and * ending position are the same). * @param children The list of nodes contained within the ebgin end tag pair. |
From: <der...@us...> - 2003-10-26 16:44:13
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexerapplications/thumbelina In directory sc8-pr-cvs1:/tmp/cvs-serv28296 Modified Files: Thumbelina.java Log Message: Get thumbelina working again. The tag.getName() method doesn't include the / of end tags. Index: Thumbelina.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexerapplications/thumbelina/Thumbelina.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Thumbelina.java 21 Sep 2003 18:20:56 -0000 1.1 --- Thumbelina.java 26 Oct 2003 16:44:01 -0000 1.2 *************** *** 791,841 **** if ("A".equals (name)) { ! startatag = tag; ! imgtag = null; ! ina = true; ! href = startatag.getAttribute ("HREF"); ! if (null != href) { ! if (!isImage (href)) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!links.containsKey (href)) ! links.put (href, url); ! } ! catch (MalformedURLException murle) { ! // well, obviously we don't want this one } } ! } ! else if ("/A".equals (name)) ! { ! ina = false; ! if (null != imgtag) { ! // evidence of a thumb href = startatag.getAttribute ("HREF"); if (null != href) { ! if (isImage (href)) ! { ! src = imgtag.getAttribute ("SRC"); ! if (null != src) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!images.containsKey (href)) ! images.put (href, url); ! } ! catch (MalformedURLException murle) ! { ! // oops, forget it ! } ! } } } --- 791,844 ---- if ("A".equals (name)) { ! if (tag.isEndTag ()) { ! ina = false; ! if (null != imgtag) ! { ! // evidence of a thumb ! href = startatag.getAttribute ("HREF"); ! if (null != href) { ! if (isImage (href)) ! { ! src = imgtag.getAttribute ("SRC"); ! if (null != src) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!images.containsKey (href)) ! images.put (href, url); ! } ! catch (MalformedURLException murle) ! { ! // oops, forget it ! } ! } } + } } ! else { ! startatag = tag; ! imgtag = null; ! ina = true; href = startatag.getAttribute ("HREF"); if (null != href) { ! if (!isImage (href)) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!links.containsKey (href)) ! links.put (href, url); ! } ! catch (MalformedURLException murle) ! { ! // well, obviously we don't want this one ! } } } *************** *** 1424,1427 **** --- 1427,1433 ---- * * $Log$ + * Revision 1.2 2003/10/26 16:44:01 derrickoswald + * Get thumbelina working again. The tag.getName() method doesn't include the / of end tags. + * * Revision 1.1 2003/09/21 18:20:56 derrickoswald * Thumbelina |
From: <der...@us...> - 2003-10-26 16:04:39
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests In directory sc8-pr-cvs1:/tmp/cvs-serv21118/tests/parserHelperTests Modified Files: CompositeTagScannerHelperTest.java Log Message: Oops, remove references to CompositeTagScannerHelper. Index: CompositeTagScannerHelperTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/CompositeTagScannerHelperTest.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CompositeTagScannerHelperTest.java 25 Oct 2003 20:19:44 -0000 1.25 --- CompositeTagScannerHelperTest.java 26 Oct 2003 16:04:27 -0000 1.26 *************** *** 29,33 **** package org.htmlparser.tests.parserHelperTests; - import org.htmlparser.parserHelper.CompositeTagScannerHelper; import org.htmlparser.tags.Tag; import org.htmlparser.tests.ParserTestCase; --- 29,32 ---- *************** *** 47,51 **** } - private CompositeTagScannerHelper helper; public CompositeTagScannerHelperTest(String name) { super(name); --- 46,49 ---- |
From: <der...@us...> - 2003-10-26 16:04:35
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners In directory sc8-pr-cvs1:/tmp/cvs-serv21118/scanners Modified Files: CompositeTagScanner.java Log Message: Oops, remove references to CompositeTagScannerHelper. Index: CompositeTagScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/CompositeTagScanner.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** CompositeTagScanner.java 26 Oct 2003 15:50:57 -0000 1.71 --- CompositeTagScanner.java 26 Oct 2003 16:04:26 -0000 1.72 *************** *** 37,41 **** import org.htmlparser.lexer.Page; import org.htmlparser.lexer.nodes.Attribute; - import org.htmlparser.parserHelper.CompositeTagScannerHelper; import org.htmlparser.tags.CompositeTag; import org.htmlparser.tags.Tag; --- 37,40 ---- |
From: <der...@us...> - 2003-10-26 15:56:13
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserHelper In directory sc8-pr-cvs1:/tmp/cvs-serv18628/parserHelper Removed Files: CompositeTagScannerHelper.java Log Message: Removed the need for CompositeTagScannerHelper, finally getting rid of the parserHelper package. --- CompositeTagScannerHelper.java DELETED --- |
From: <der...@us...> - 2003-10-26 03:56:13
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests In directory sc8-pr-cvs1:/tmp/cvs-serv18387/tests/scannersTests Modified Files: BulletScannerTest.java Log Message: Quiet down the test output. Index: BulletScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/BulletScannerTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BulletScannerTest.java 21 Oct 2003 02:24:01 -0000 1.11 --- BulletScannerTest.java 26 Oct 2003 03:53:33 -0000 1.12 *************** *** 81,85 **** for (NodeIterator i = parser.elements();i.hasMoreNodes();) { Node node = i.nextNode(); ! System.out.println(node.toHtml()); } } --- 81,85 ---- for (NodeIterator i = parser.elements();i.hasMoreNodes();) { Node node = i.nextNode(); ! // System.out.println(node.toHtml()); } } |
From: <der...@us...> - 2003-10-26 03:56:02
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests In directory sc8-pr-cvs1:/tmp/cvs-serv18387/tests/tagTests Modified Files: OptionTagTest.java Log Message: Quiet down the test output. Index: OptionTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/OptionTagTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** OptionTagTest.java 25 Oct 2003 20:19:44 -0000 1.33 --- OptionTagTest.java 26 Oct 2003 03:53:33 -0000 1.34 *************** *** 78,84 **** for(int j=0;j<nodeCount;j++) { ! //assertTrue("Node " + j + " should be Option Tag",node[j] instanceof OptionTag); ! System.out.println(node[j].getClass().getName()); ! System.out.println(node[j].toHtml()); } OptionTag OptionTag; --- 78,84 ---- for(int j=0;j<nodeCount;j++) { ! assertTrue("Node " + j + " should be Option Tag",node[j] instanceof OptionTag); ! // System.out.println(node[j].getClass().getName()); ! // System.out.println(node[j].toHtml()); } OptionTag OptionTag; |
From: <der...@us...> - 2003-10-26 03:55:58
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1:/tmp/cvs-serv18387/tags Modified Files: AppletTag.java Log Message: Quiet down the test output. Index: AppletTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/AppletTag.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** AppletTag.java 20 Oct 2003 01:28:03 -0000 1.32 --- AppletTag.java 26 Oct 2003 03:53:32 -0000 1.33 *************** *** 164,168 **** String paramValue; Vector attributes; - Attribute attribute; StringNode string; --- 164,167 ---- *************** *** 200,216 **** paramName = (String)e.nextElement (); paramValue = (String)newAppletParams.get (paramName); ! attribute = new Attribute ("PARAM", null); ! System.out.println (attribute); ! attributes.addElement (attribute); attributes.addElement (new Attribute (" ")); ! attribute = new Attribute ("VALUE", paramValue, '"'); ! System.out.println (attribute); ! attributes.addElement (attribute); attributes.addElement (new Attribute (" ")); ! attribute = new Attribute ("NAME", paramName, '"'); ! System.out.println (attribute); ! attributes.addElement (attribute); tag = new Tag (null, 0, 0, attributes); - System.out.println (tag.toHtml ()); kids.add (tag); } --- 199,208 ---- paramName = (String)e.nextElement (); paramValue = (String)newAppletParams.get (paramName); ! attributes.addElement (new Attribute ("PARAM", null)); attributes.addElement (new Attribute (" ")); ! attributes.addElement (new Attribute ("VALUE", paramValue, '"')); attributes.addElement (new Attribute (" ")); ! attributes.addElement (new Attribute ("NAME", paramName, '"')); tag = new Tag (null, 0, 0, attributes); kids.add (tag); } |
From: <der...@us...> - 2003-10-26 03:55:52
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests In directory sc8-pr-cvs1:/tmp/cvs-serv18387/tests Modified Files: ParserTest.java ParserTestCase.java Log Message: Quiet down the test output. Index: ParserTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/ParserTest.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ParserTest.java 21 Oct 2003 02:24:00 -0000 1.45 --- ParserTest.java 26 Oct 2003 03:53:33 -0000 1.46 *************** *** 48,51 **** --- 48,52 ---- import org.htmlparser.tags.LinkTag; import org.htmlparser.tags.Tag; + import org.htmlparser.util.DefaultParserFeedback; import org.htmlparser.util.NodeIterator; import org.htmlparser.util.NodeList; *************** *** 347,351 **** out.println ("</html>"); out.close (); ! parser = new Parser (file.getAbsolutePath ()); nodes = new AbstractNode[30]; i = 0; --- 348,352 ---- out.println ("</html>"); out.close (); ! parser = new Parser (file.getAbsolutePath (), new DefaultParserFeedback(DefaultParserFeedback.QUIET)); nodes = new AbstractNode[30]; i = 0; Index: ParserTestCase.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/ParserTestCase.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ParserTestCase.java 21 Oct 2003 02:24:00 -0000 1.34 --- ParserTestCase.java 26 Oct 2003 03:53:33 -0000 1.35 *************** *** 74,78 **** protected void createParser(String inputHTML) { mLexer = new Lexer (new Page (inputHTML)); ! parser = new Parser(mLexer, new DefaultParserFeedback()); node = new AbstractNode[40]; } --- 74,78 ---- protected void createParser(String inputHTML) { mLexer = new Lexer (new Page (inputHTML)); ! parser = new Parser(mLexer, new DefaultParserFeedback(DefaultParserFeedback.QUIET)); node = new AbstractNode[40]; } *************** *** 81,85 **** { Lexer lexer = new Lexer (inputHTML); ! parser = new Parser (lexer, new DefaultParserFeedback()); node = new AbstractNode[numNodes]; } --- 81,85 ---- { Lexer lexer = new Lexer (inputHTML); ! parser = new Parser (lexer, new DefaultParserFeedback(DefaultParserFeedback.QUIET)); node = new AbstractNode[numNodes]; } *************** *** 88,92 **** Lexer lexer = new Lexer (inputHTML); lexer.getPage ().setUrl (url); ! parser = new Parser (lexer, new DefaultParserFeedback()); node = new AbstractNode[40]; } --- 88,92 ---- Lexer lexer = new Lexer (inputHTML); lexer.getPage ().setUrl (url); ! parser = new Parser (lexer, new DefaultParserFeedback(DefaultParserFeedback.QUIET)); node = new AbstractNode[40]; } *************** *** 95,99 **** Lexer lexer = new Lexer (inputHTML); lexer.getPage ().setUrl (url); ! parser = new Parser (lexer, new DefaultParserFeedback()); node = new AbstractNode[numNodes]; } --- 95,99 ---- Lexer lexer = new Lexer (inputHTML); lexer.getPage ().setUrl (url); ! parser = new Parser (lexer, new DefaultParserFeedback(DefaultParserFeedback.QUIET)); node = new AbstractNode[numNodes]; } |
From: <der...@us...> - 2003-10-26 03:54:04
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/visitors In directory sc8-pr-cvs1:/tmp/cvs-serv18387/visitors Modified Files: LinkFindingVisitor.java Log Message: Quiet down the test output. Index: LinkFindingVisitor.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/visitors/LinkFindingVisitor.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** LinkFindingVisitor.java 22 Sep 2003 02:40:16 -0000 1.29 --- LinkFindingVisitor.java 26 Oct 2003 03:53:33 -0000 1.30 *************** *** 41,45 **** public void visitLinkTag(LinkTag linkTag) { ! System.out.println("Matching with "+linkTag.getLinkText()); if (linkTag.getLinkText().toUpperCase().indexOf(linkTextToFind)!=-1) { linkTagFound = true; --- 41,45 ---- public void visitLinkTag(LinkTag linkTag) { ! // System.out.println("Matching with "+linkTag.getLinkText()); if (linkTag.getLinkText().toUpperCase().indexOf(linkTextToFind)!=-1) { linkTagFound = true; |
From: <der...@us...> - 2003-10-26 03:54:03
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests In directory sc8-pr-cvs1:/tmp/cvs-serv18387/tests/lexerTests Modified Files: StreamTests.java Log Message: Quiet down the test output. Index: StreamTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/StreamTests.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StreamTests.java 21 Oct 2003 02:24:00 -0000 1.9 --- StreamTests.java 26 Oct 2003 03:53:33 -0000 1.10 *************** *** 254,267 **** time2 = System.currentTimeMillis () - begin; ! System.out.println ("fills: " + stream.fills); ! System.out.println ("reallocations: " + stream.reallocations); ! System.out.println ("synchronous: " + stream.synchronous); ! System.out.println ("buffer size: " + stream.mBuffer.length); ! System.out.println ("bytes: " + stream.mLevel); stream.close (); ! System.out.println ("time (" + time2 + ") vs. (" + time1 + ") for " + index + " bytes"); double samples = index / 1000; ! System.out.println ("average available bytes (" + available2/samples + ") vs. (" + available1/samples + ")"); assertTrue ("slower (" + time2 + ") vs. (" + time1 + ")", time2 < time1); --- 254,267 ---- time2 = System.currentTimeMillis () - begin; ! // System.out.println ("fills: " + stream.fills); ! // System.out.println ("reallocations: " + stream.reallocations); ! // System.out.println ("synchronous: " + stream.synchronous); ! // System.out.println ("buffer size: " + stream.mBuffer.length); ! // System.out.println ("bytes: " + stream.mLevel); stream.close (); ! // System.out.println ("time (" + time2 + ") vs. (" + time1 + ") for " + index + " bytes"); double samples = index / 1000; ! // System.out.println ("average available bytes (" + available2/samples + ") vs. (" + available1/samples + ")"); assertTrue ("slower (" + time2 + ") vs. (" + time1 + ")", time2 < time1); |
From: <der...@us...> - 2003-10-26 03:54:01
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer In directory sc8-pr-cvs1:/tmp/cvs-serv18387/lexer Modified Files: Page.java Log Message: Quiet down the test output. Index: Page.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/Page.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Page.java 13 Oct 2003 21:48:12 -0000 1.19 --- Page.java 26 Oct 2003 03:53:32 -0000 1.20 *************** *** 327,340 **** catch (UnsupportedEncodingException uee) { ! StringBuffer msg; ! String message; ! ! msg = new StringBuffer (1024); ! msg.append (getConnection ().getURL ().toExternalForm ()); ! msg.append (" has an encoding ("); ! msg.append (charset); ! msg.append (") which is not supported, using "); ! msg.append (DEFAULT_CHARSET); ! System.out.println (msg.toString ()); charset = DEFAULT_CHARSET; mSource = new Source (stream, charset); --- 327,339 ---- catch (UnsupportedEncodingException uee) { ! // StringBuffer msg; ! // ! // msg = new StringBuffer (1024); ! // msg.append (getConnection ().getURL ().toExternalForm ()); ! // msg.append (" has an encoding ("); ! // msg.append (charset); ! // msg.append (") which is not supported, using "); ! // msg.append (DEFAULT_CHARSET); ! // System.out.println (msg.toString ()); charset = DEFAULT_CHARSET; mSource = new Source (stream, charset); *************** *** 554,566 **** // Charset names are not case-sensitive; // that is, case is always ignored when comparing charset names. ! if (!ret.equalsIgnoreCase (content)) ! { ! System.out.println ( ! "detected charset \"" ! + content ! + "\", using \"" ! + ret ! + "\""); ! } } } --- 553,565 ---- // Charset names are not case-sensitive; // that is, case is always ignored when comparing charset names. ! // if (!ret.equalsIgnoreCase (content)) ! // { ! // System.out.println ( ! // "detected charset \"" ! // + content ! // + "\", using \"" ! // + ret ! // + "\""); ! // } } } |
From: <der...@us...> - 2003-10-25 20:25:43
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests In directory sc8-pr-cvs1:/tmp/cvs-serv13708/tests/parserHelperTests Modified Files: CompositeTagScannerHelperTest.java StringParserTest.java Log Message: Clean up the last few failing tests. *** The bar is green again *** Index: CompositeTagScannerHelperTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/CompositeTagScannerHelperTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CompositeTagScannerHelperTest.java 21 Oct 2003 02:24:00 -0000 1.24 --- CompositeTagScannerHelperTest.java 25 Oct 2003 20:19:44 -0000 1.25 *************** *** 32,35 **** --- 32,36 ---- import org.htmlparser.tags.Tag; import org.htmlparser.tests.ParserTestCase; + import org.htmlparser.util.ParserException; /** *************** *** 52,77 **** 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)); } } --- 53,74 ---- protected void setUp() { } ! public void testIsXmlEndTagForRealXml () throws ParserException ! { ! String html = "<something/>"; ! createParser (html); ! parseAndAssertNodeCount (1); ! assertTrue("should be a tag", node[0] instanceof Tag); ! assertTrue("should be an xml end tag", ((Tag)node[0]).isEmptyXmlTag ()); } ! public void testIsXmlEndTagForFalseMatches () throws ParserException ! { ! String html = "<a href=http://someurl.com/>"; ! createParser (html); ! parseAndAssertNodeCount (1); ! assertTrue("should be a tag", node[0] instanceof Tag); ! assertTrue("should not be an xml end tag", !((Tag)node[0]).isEmptyXmlTag ()); } } Index: StringParserTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/StringParserTest.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** StringParserTest.java 21 Oct 2003 02:24:00 -0000 1.40 --- StringParserTest.java 25 Oct 2003 20:19:44 -0000 1.41 *************** *** 89,93 **** LinkTag linkNode = (LinkTag)node[1]; assertEquals("Link is","http://www.adobe.com",linkNode.getLink()); ! assertEquals("Link text is","Adobe \r\nAcrobat Reader",linkNode.getLinkText()); assertTrue("Third node should be a string node",node[2] instanceof StringNode); --- 89,93 ---- LinkTag linkNode = (LinkTag)node[1]; assertEquals("Link is","http://www.adobe.com",linkNode.getLink()); ! assertEquals("Link text is","Adobe \nAcrobat Reader",linkNode.getLinkText()); assertTrue("Third node should be a string node",node[2] instanceof StringNode); |
From: <der...@us...> - 2003-10-25 20:25:39
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1:/tmp/cvs-serv13708/tags Modified Files: CompositeTag.java Log Message: Clean up the last few failing tests. *** The bar is green again *** Index: CompositeTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/CompositeTag.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** CompositeTag.java 20 Oct 2003 01:28:03 -0000 1.59 --- CompositeTag.java 25 Oct 2003 20:19:43 -0000 1.60 *************** *** 117,126 **** { node = e.nextNode (); ! sb.append (node.toHtml ()); } } ! protected void putEndTagInto(StringBuffer sb) { ! sb.append(endTag.toHtml()); } --- 117,131 ---- { node = e.nextNode (); ! // eliminate virtual tags ! // if (!(node.getStartPosition () == node.getEndPosition ())) ! sb.append (node.toHtml ()); } } ! protected void putEndTagInto(StringBuffer sb) ! { ! // eliminate virtual tags ! // if (!(endTag.getStartPosition () == endTag.getEndPosition ())) ! sb.append(endTag.toHtml()); } |
From: <der...@us...> - 2003-10-25 20:25:32
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests In directory sc8-pr-cvs1:/tmp/cvs-serv13708/tests/tagTests Modified Files: JspTagTest.java OptionTagTest.java SelectTagTest.java TagTest.java Log Message: Clean up the last few failing tests. *** The bar is green again *** Index: JspTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/JspTagTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** JspTagTest.java 21 Oct 2003 02:24:01 -0000 1.35 --- JspTagTest.java 25 Oct 2003 20:19:44 -0000 1.36 *************** *** 67,105 **** public void testJspTag() throws ParserException { ! String contents = "jsp:useBean id=\"transfer\" scope=\"session\" class=\"com.bank.PageBean\"/"; ! String jsp = "<" + contents + ">"; ! String contents2 = "%\n"+ ! " org.apache.struts.util.BeanUtils.populate(transfer, request);\n"+ ! " if(request.getParameter(\"marker\") == null)\n"+ ! " // initialize a pseudo-property\n"+ ! " transfer.set(\"days\", java.util.Arrays.asList(\n"+ ! " new String[] {\"1\", \"2\", \"3\", \"4\", \"31\"}));\n"+ ! " else \n"+ ! " if(transfer.validate(request))\n"+ ! " %"; ! createParser( ! "<%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %>\n"+ ! jsp + "\n" + ! "<" + contents2 + ">\n<jsp:forward page=\"transferConfirm.jsp\"/><%\n"+ ! "%>"); ! Parser.setLineSeparator("\r\n"); ! // Register the Jsp Scanner ! parser.addScanner(new JspScanner("-j")); ! parseAndAssertNodeCount(8); ! // The first node should be an JspTag ! assertTrue("Node 1 should be an JspTag",node[0] instanceof JspTag); ! JspTag tag = (JspTag)node[0]; ! assertStringEquals("Contents of the tag","%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %",tag.getText()); ! ! // The second node should be a normal tag ! assertTrue("Node 3 should be a normal Tag",node[2] instanceof Tag); ! Tag htag = (Tag)node[2]; ! assertStringEquals("Contents of the tag",contents,htag.getText()); ! assertStringEquals("html",jsp,htag.toHtml()); ! // The third node should be an JspTag ! assertTrue("Node 5 should be an JspTag",node[4] instanceof JspTag); ! JspTag tag2 = (JspTag)node[4]; ! assertEquals("Contents of the tag",contents2,tag2.getText()); } --- 67,107 ---- public void testJspTag() throws ParserException { ! if (JSP_TESTS_ENABLED) ! { ! String contents = "jsp:useBean id=\"transfer\" scope=\"session\" class=\"com.bank.PageBean\"/"; ! String jsp = "<" + contents + ">"; ! String contents2 = "%\n"+ ! " org.apache.struts.util.BeanUtils.populate(transfer, request);\n"+ ! " if(request.getParameter(\"marker\") == null)\n"+ ! " // initialize a pseudo-property\n"+ ! " transfer.set(\"days\", java.util.Arrays.asList(\n"+ ! " new String[] {\"1\", \"2\", \"3\", \"4\", \"31\"}));\n"+ ! " else \n"+ ! " if(transfer.validate(request))\n"+ ! " %"; ! createParser( ! "<%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %>\n"+ ! jsp + "\n" + ! "<" + contents2 + ">\n<jsp:forward page=\"transferConfirm.jsp\"/><%\n"+ ! "%>"); ! Parser.setLineSeparator("\r\n"); ! // Register the Jsp Scanner ! parser.addScanner(new JspScanner("-j")); ! parseAndAssertNodeCount(8); ! // The first node should be an JspTag ! assertTrue("Node 1 should be an JspTag",node[0] instanceof JspTag); ! JspTag tag = (JspTag)node[0]; ! assertStringEquals("Contents of the tag","%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %",tag.getText()); + // The second node should be a normal tag + assertTrue("Node 3 should be a normal Tag",node[2] instanceof Tag); + Tag htag = (Tag)node[2]; + assertStringEquals("Contents of the tag",contents,htag.getText()); + assertStringEquals("html",jsp,htag.toHtml()); + // The third node should be an JspTag + assertTrue("Node 5 should be an JspTag",node[4] instanceof JspTag); + JspTag tag2 = (JspTag)node[4]; + assertStringEquals("Contents of the tag",contents2,tag2.getText()); + } } Index: OptionTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/OptionTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** OptionTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 --- OptionTagTest.java 25 Oct 2003 20:19:44 -0000 1.33 *************** *** 57,63 **** "<OPTION>\nRediff\n</OPTION>"+ "<OPTION>Cricinfo" + ! "<OPTION value=\"Microsoft Passport\">" ! // "<OPTION value=\"AOL\"><SPAN>AOL</SPAN></OPTION>" + ! // "<OPTION value=\"Time Warner\">Time <LABEL>Warner <SPAN>AOL </SPAN>Inc.</LABEL>" ); --- 57,63 ---- "<OPTION>\nRediff\n</OPTION>"+ "<OPTION>Cricinfo" + ! "<OPTION value=\"Microsoft Passport\">"+ ! "<OPTION value=\"AOL\"><SPAN>AOL</SPAN></OPTION>" + ! "<OPTION value=\"Time Warner\">Time <LABEL>Warner <SPAN>AOL </SPAN>Inc.</LABEL>" ); *************** *** 71,75 **** createParser(testHTML); parser.addScanner(new OptionTagScanner("-option", new Stack ())); ! parseAndAssertNodeCount(11); } --- 71,75 ---- createParser(testHTML); parser.addScanner(new OptionTagScanner("-option", new Stack ())); ! parseAndAssertNodeCount(13); } *************** *** 105,113 **** OptionTag = (OptionTag) node[10]; assertStringEquals("HTML String","<OPTION VALUE=\"Microsoft Passport\"></OPTION>",OptionTag.toHtml()); ! /* OptionTag = (OptionTag) node[11]; assertStringEquals("HTML String","<OPTION VALUE=\"AOL\"><SPAN>AOL</SPAN></OPTION>",OptionTag.toHtml()); OptionTag = (OptionTag) node[12]; assertStringEquals("HTML String","<OPTION value=\"Time Warner\">Time <LABEL>Warner <SPAN>AOL </SPAN>Inc.</LABEL></OPTION>",OptionTag.toHtml()); ! */ } public void testToString() throws ParserException --- 105,113 ---- OptionTag = (OptionTag) node[10]; assertStringEquals("HTML String","<OPTION VALUE=\"Microsoft Passport\"></OPTION>",OptionTag.toHtml()); ! OptionTag = (OptionTag) node[11]; assertStringEquals("HTML String","<OPTION VALUE=\"AOL\"><SPAN>AOL</SPAN></OPTION>",OptionTag.toHtml()); OptionTag = (OptionTag) node[12]; assertStringEquals("HTML String","<OPTION value=\"Time Warner\">Time <LABEL>Warner <SPAN>AOL </SPAN>Inc.</LABEL></OPTION>",OptionTag.toHtml()); ! } public void testToString() throws ParserException *************** *** 127,131 **** assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Yahoo!\n",OptionTag.toString()); OptionTag = (OptionTag) node[4]; ! assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Hotmail\n",OptionTag.toString()); OptionTag = (OptionTag) node[5]; assertEquals("HTML Raw String","OPTION VALUE: ICQ Messenger TEXT: \n",OptionTag.toString()); --- 127,131 ---- assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Yahoo!\n",OptionTag.toString()); OptionTag = (OptionTag) node[4]; ! assertEquals("HTML Raw String","OPTION VALUE: null TEXT: \nHotmail\n",OptionTag.toString()); OptionTag = (OptionTag) node[5]; assertEquals("HTML Raw String","OPTION VALUE: ICQ Messenger TEXT: \n",OptionTag.toString()); *************** *** 133,147 **** assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Mailcity\n\n",OptionTag.toString()); OptionTag = (OptionTag) node[7]; ! assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Indiatimes\n\n",OptionTag.toString()); OptionTag = (OptionTag) node[8]; ! assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Rediff\n\n",OptionTag.toString()); OptionTag = (OptionTag) node[9]; assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Cricinfo\n",OptionTag.toString()); OptionTag = (OptionTag) node[10]; assertEquals("HTML Raw String","OPTION VALUE: Microsoft Passport TEXT: \n",OptionTag.toString()); ! /* OptionTag = (OptionTag) node[11]; assertEquals("HTML Raw String","OPTION VALUE: AOL TEXT: AOL\n",OptionTag.toString()); OptionTag = (OptionTag) node[12]; assertEquals("HTML Raw String","OPTION VALUE: Time Warner TEXT: Time Warner AOL Inc.\n",OptionTag.toString()); ! */ } } --- 133,147 ---- assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Mailcity\n\n",OptionTag.toString()); OptionTag = (OptionTag) node[7]; ! assertEquals("HTML Raw String","OPTION VALUE: null TEXT: \nIndiatimes\n\n",OptionTag.toString()); OptionTag = (OptionTag) node[8]; ! assertEquals("HTML Raw String","OPTION VALUE: null TEXT: \nRediff\n\n",OptionTag.toString()); OptionTag = (OptionTag) node[9]; assertEquals("HTML Raw String","OPTION VALUE: null TEXT: Cricinfo\n",OptionTag.toString()); OptionTag = (OptionTag) node[10]; assertEquals("HTML Raw String","OPTION VALUE: Microsoft Passport TEXT: \n",OptionTag.toString()); ! OptionTag = (OptionTag) node[11]; assertEquals("HTML Raw String","OPTION VALUE: AOL TEXT: AOL\n",OptionTag.toString()); OptionTag = (OptionTag) node[12]; assertEquals("HTML Raw String","OPTION VALUE: Time Warner TEXT: Time Warner AOL Inc.\n",OptionTag.toString()); ! } } Index: SelectTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/SelectTagTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** SelectTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 --- SelectTagTest.java 25 Oct 2003 20:19:44 -0000 1.34 *************** *** 59,62 **** --- 59,73 ---- "</select>" ); + private String correctedHTML = new String( + "<SELECT name=\"Nominees\">\n"+ + "<option value=\"Spouse\">Spouse</option>"+ + "<option value=\"Father\"></option>\n"+ + "<option value=\"Mother\">Mother\n</option>" + + "<option value=\"Son\">\nSon\n</option>"+ + "<option value=\"Daughter\">\nDaughter\n</option>"+ + "<option value=\"Nephew\">\nNephew</option>\n"+ + "<option value=\"Niece\">Niece\n</option>" + + "</select>" + ); private SelectTag selectTag; *************** *** 78,82 **** public void testToHTML() throws ParserException { ! assertStringEquals("HTML String",testHTML, selectTag.toHtml()); } --- 89,93 ---- public void testToHTML() throws ParserException { ! assertStringEquals("HTML String", correctedHTML, selectTag.toHtml()); } *************** *** 102,106 **** assertEquals("option tag array length",7,optionTags.length); assertEquals("option tag 1","Spouse",optionTags[0].getOptionText()); ! assertEquals("option tag 7","Niece\r\n",optionTags[6].getOptionText()); } } --- 113,117 ---- assertEquals("option tag array length",7,optionTags.length); assertEquals("option tag 1","Spouse",optionTags[0].getOptionText()); ! assertEquals("option tag 7","Niece\n",optionTags[6].getOptionText()); } } Index: TagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TagTest.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** TagTest.java 21 Oct 2003 02:24:01 -0000 1.49 --- TagTest.java 25 Oct 2003 20:19:44 -0000 1.50 *************** *** 477,482 **** assertStringEquals("Node contents",guts,tag.getText()); assertEquals("Meta Content",author,tag.getAttribute("NAME")); ! assertEquals("Meta Content",content,tag.getAttribute("CONTENT")); ! } --- 477,488 ---- assertStringEquals("Node contents",guts,tag.getText()); assertEquals("Meta Content",author,tag.getAttribute("NAME")); ! ! // ! // Big todo here: ! // This involves a change in the lexer state machine from ! // six states to probably 8, or perhaps a half dozen 'substates' ! // on state zero... ! // we shy away from this at the moment: ! // assertEquals("Meta Content",content,tag.getAttribute("CONTENT")); } |
From: <der...@us...> - 2003-10-25 20:25:27
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests In directory sc8-pr-cvs1:/tmp/cvs-serv13708/tests/scannersTests Modified Files: CompositeTagScannerTest.java LinkScannerTest.java Log Message: Clean up the last few failing tests. *** The bar is green again *** Index: CompositeTagScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/CompositeTagScannerTest.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** CompositeTagScannerTest.java 21 Oct 2003 02:24:01 -0000 1.43 --- CompositeTagScannerTest.java 25 Oct 2003 20:19:44 -0000 1.44 *************** *** 86,91 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",9,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); assertStringEquals("html",html,customTag.toHtml()); } --- 86,91 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",9,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); assertStringEquals("html",html,customTag.toHtml()); } *************** *** 99,104 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); assertEquals("html",html,customTag.toHtml()); } --- 99,104 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); assertEquals("html",html,customTag.toHtml()); } *************** *** 115,121 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); ! Node child = customTag.childAt(0); assertType("child",StringNode.class,child); --- 115,120 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); Node child = customTag.childAt(0); assertType("child",StringNode.class,child); *************** *** 265,270 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); assertStringEquals("html",html + "</custom>",customTag.toHtml()); } --- 264,269 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); assertStringEquals("html",html + "</custom>",customTag.toHtml()); } *************** *** 278,283 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); assertStringEquals("html",html + "</custom>",customTag.toHtml()); } --- 277,282 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); assertStringEquals("html",html + "</custom>",customTag.toHtml()); } *************** *** 291,296 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",1,customTag.tagData.getEndLine()); assertStringEquals("html", html + "</custom>", customTag.toHtml() ); --- 290,295 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",1,customTag.getEndingLineNumber()); assertStringEquals("html", html + "</custom>", customTag.toHtml() ); *************** *** 309,314 **** assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); assertEquals("ending loc of custom tag",17,customTag.elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); assertStringEquals("1st custom tag", tag1 + "</custom>", customTag.toHtml()); customTag = (CustomTag)node[1]; --- 308,313 ---- assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); assertEquals("ending loc of custom tag",17,customTag.elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); assertStringEquals("1st custom tag", tag1 + "</custom>", customTag.toHtml()); customTag = (CustomTag)node[1]; *************** *** 334,340 **** assertEquals("starting loc",9,customTag.getStartTag().elementBegin()); assertEquals("ending loc",17,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",1,customTag.tagData.getEndLine()); ! assertStringEquals("another tag html",another,anotherTag.toHtml()); assertStringEquals("custom tag html",custom,customTag.toHtml()); } --- 333,339 ---- assertEquals("starting loc",9,customTag.getStartTag().elementBegin()); assertEquals("ending loc",17,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",1,customTag.getEndingLineNumber()); ! assertStringEquals("another tag html",another + "</another>",anotherTag.toHtml()); assertStringEquals("custom tag html",custom,customTag.toHtml()); } *************** *** 354,359 **** AnotherTag anotherTag = (AnotherTag)customTag.childAt(0); assertEquals("another tag ending loc",17,anotherTag.elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); assertStringEquals("html","<custom><another></another></custom>",customTag.toHtml()); } --- 353,358 ---- AnotherTag anotherTag = (AnotherTag)customTag.childAt(0); assertEquals("another tag ending loc",17,anotherTag.elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); assertStringEquals("html","<custom><another></another></custom>",customTag.toHtml()); } *************** *** 374,379 **** assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! // assertEquals("starting line position",0,customTag.tagData.getStartLine()); ! // assertEquals("ending line position",0,customTag.tagData.getEndLine()); AnotherTag anotherTag = (AnotherTag)customTag.childAt(0); assertEquals("anotherTag child count",1,anotherTag.getChildCount()); --- 373,378 ---- assertEquals("starting loc",0,customTag.getStartTag().elementBegin()); assertEquals("ending loc",8,customTag.getStartTag().elementEnd()); ! assertEquals("starting line position",0,customTag.getStartingLineNumber()); ! assertEquals("ending line position",0,customTag.getEndingLineNumber()); AnotherTag anotherTag = (AnotherTag)customTag.childAt(0); assertEquals("anotherTag child count",1,anotherTag.getChildCount()); *************** *** 506,518 **** return (super.createTag (page, start, end, attributes, startTag, endTag, children)); } - // public Tag createTag( - // TagData tagData, - // CompositeTagData compositeTagData) { - // url = tagData.getUrlBeingParsed(); - // return super.createTag( - // tagData, - // compositeTagData - // ); - // } }); parseAndAssertNodeCount(1); --- 505,508 ---- *************** *** 628,644 **** } ! public static class CustomTag extends CompositeTag { ! // public TagData tagData; ! public CustomTag(/*TagData data, CompositeTagData compositeTagData*/) { ! // super(data.getPage (), data.getTagBegin (), data.getTagEnd (), data.getAttributes (),compositeTagData); ! // tagData = data; ! } } ! public static class AnotherTag extends CompositeTag { ! public AnotherTag(/*TagData data, CompositeTagData compositeTagData*/) { ! // super(data.getPage (), data.getTagBegin (), data.getTagEnd (), data.getAttributes (),compositeTagData); ! } } - } --- 618,627 ---- } ! public static class CustomTag extends CompositeTag ! { } ! public static class AnotherTag extends CompositeTag ! { } } Index: LinkScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/LinkScannerTest.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** LinkScannerTest.java 21 Oct 2003 02:24:01 -0000 1.43 --- LinkScannerTest.java 25 Oct 2003 20:19:44 -0000 1.44 *************** *** 84,89 **** assertTrue("Third node should be a tag",node[2] instanceof Tag); assertTrue("Fourth node should be a link",node[3] instanceof LinkTag); ! assertTrue("Fifth node should be a link",node[4] instanceof LinkTag); ! assertTrue("Sixth node should be a Tag",node[5] instanceof Tag); } --- 84,90 ---- assertTrue("Third node should be a tag",node[2] instanceof Tag); assertTrue("Fourth node should be a link",node[3] instanceof LinkTag); ! // LinkScanner.evaluate() says anythin less than 5 characters isn't a link: ! assertTrue("Fifth node should be a tag",node[4] instanceof Tag); ! assertTrue("Sixth node should be a tag",node[5] instanceof Tag); } |
From: <der...@us...> - 2003-10-25 15:56:26
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer In directory sc8-pr-cvs1:/tmp/cvs-serv3232/lexer Modified Files: Lexer.java Log Message: Handle some broken end tags. Handle some pathological remark nodes. Index: Lexer.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/Lexer.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Lexer.java 20 Oct 2003 01:28:02 -0000 1.15 --- Lexer.java 25 Oct 2003 15:46:02 -0000 1.16 *************** *** 270,280 **** else { ! probe.retreat (); // remark and tag need this character ! if ('-' == ch) ! ret = parseRemark (probe, quotesmart); else { ! probe.retreat (); // tag needs the previous one too ! ret = parseTag (probe); } } --- 270,285 ---- else { ! if ('>' == ch) // handle <!> ! ret = makeRemark (probe); else { ! probe.retreat (); // remark and tag need this character ! if ('-' == ch) ! ret = parseRemark (probe, quotesmart); ! else ! { ! probe.retreat (); // tag needs the previous one too ! ret = parseTag (probe); ! } } } *************** *** 483,488 **** { case 0: // outside of any attribute ! if ((0 == ch) || ('>' == ch)) { whitespace (attributes, bookmarks); done = true; --- 488,499 ---- { case 0: // outside of any attribute ! if ((0 == ch) || ('>' == ch) || ('<' == ch)) { + if ('<' == ch) + { + // don't consume the opening angle + cursor.retreat (); + bookmarks[state + 1] = cursor.getPosition (); + } whitespace (attributes, bookmarks); done = true; *************** *** 495,500 **** break; case 1: // within attribute name ! if ((0 == ch) || ('>' == ch)) { standalone (attributes, bookmarks); done = true; --- 506,517 ---- break; case 1: // within attribute name ! if ((0 == ch) || ('>' == ch) || ('<' == ch)) { + if ('<' == ch) + { + // don't consume the opening angle + cursor.retreat (); + bookmarks[state + 1] = cursor.getPosition (); + } standalone (attributes, bookmarks); done = true; *************** *** 797,839 **** { ch = mPage.getCharacter (cursor); ! switch (state) ! { ! case 0: // prior to the first open delimiter ! if ('-' == ch) ! state = 1; ! else ! return (parseString (cursor, quotesmart)); ! break; ! case 1: // prior to the second open delimiter ! if ('-' == ch) ! state = 2; ! else ! return (parseString (cursor, quotesmart)); ! break; ! case 2: // prior to the first closing delimiter ! if ('-' == ch) ! state = 3; ! else if (0 == ch) ! return (parseString (cursor, quotesmart)); // no terminator ! break; ! case 3: // prior to the second closing delimiter ! if ('-' == ch) ! state = 4; ! else ! state = 2; ! break; ! case 4: // prior to the terminating > ! if ('>' == ch) ! done = true; ! else if (('!' == ch) || ('-' == ch) || Character.isWhitespace (ch)) ! { ! // stay in state 4 ! } ! else ! state = 2; ! break; ! default: ! throw new IllegalStateException ("how the fuck did we get in state " + state); ! } } --- 814,873 ---- { ch = mPage.getCharacter (cursor); ! if (0 == ch) ! done = true; ! else ! switch (state) ! { ! case 0: // prior to the first open delimiter ! if ('>' == ch) ! done = true; ! if ('-' == ch) ! state = 1; ! else ! return (parseString (cursor, quotesmart)); ! break; ! case 1: // prior to the second open delimiter ! if ('-' == ch) ! { ! // handle <!--> because netscape does ! ch = mPage.getCharacter (cursor); ! if (0 == ch) ! done = true; ! else if ('>' == ch) ! done = true; ! else ! { ! cursor.retreat (); ! state = 2; ! } ! } ! else ! return (parseString (cursor, quotesmart)); ! break; ! case 2: // prior to the first closing delimiter ! if ('-' == ch) ! state = 3; ! else if (0 == ch) ! return (parseString (cursor, quotesmart)); // no terminator ! break; ! case 3: // prior to the second closing delimiter ! if ('-' == ch) ! state = 4; ! else ! state = 2; ! break; ! case 4: // prior to the terminating > ! if ('>' == ch) ! done = true; ! else if (('!' == ch) || ('-' == ch) || Character.isWhitespace (ch)) ! { ! // stay in state 4 ! } ! else ! state = 2; ! break; ! default: ! throw new IllegalStateException ("how the fuck did we get in state " + state); ! } } |
From: <der...@us...> - 2003-10-25 15:56:16
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests In directory sc8-pr-cvs1:/tmp/cvs-serv3232/tests/scannersTests Modified Files: TitleScannerTest.java Log Message: Handle some broken end tags. Handle some pathological remark nodes. Index: TitleScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/TitleScannerTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** TitleScannerTest.java 21 Oct 2003 02:24:01 -0000 1.31 --- TitleScannerTest.java 25 Oct 2003 15:46:03 -0000 1.32 *************** *** 28,34 **** --- 28,40 ---- package org.htmlparser.tests.scannersTests; + + import org.htmlparser.scanners.BodyScanner; + import org.htmlparser.scanners.HeadScanner; + import org.htmlparser.scanners.HtmlScanner; import org.htmlparser.scanners.MetaTagScanner; import org.htmlparser.scanners.StyleScanner; import org.htmlparser.scanners.TitleScanner; + import org.htmlparser.tags.HeadTag; + import org.htmlparser.tags.Html; import org.htmlparser.tags.TitleTag; import org.htmlparser.tests.ParserTestCase; *************** *** 66,79 **** */ public void testIncompleteTitle() throws ParserException { ! createParser( ! "<TITLE>SISTEMA TERRA, VOL. VI , No. 1-3, December 1997</TITLE\n"+ ! "</HEAD>"); ! TitleScanner titleScanner = new TitleScanner("-t"); ! parser.addScanner(titleScanner); ! parseAndAssertNodeCount(2); ! assertTrue("First Node is a title tag",node[0] instanceof TitleTag); ! TitleTag titleTag = (TitleTag)node[0]; assertEquals("Title","SISTEMA TERRA, VOL. VI , No. 1-3, December 1997",titleTag.getTitle()); ! } --- 72,102 ---- */ public void testIncompleteTitle() throws ParserException { ! String text = ! "<HTML>\n"+ ! "<HEAD>\n"+ ! // note the missing angle bracket on the close title: ! "<TITLE>SISTEMA TERRA, VOL. VI , No. 1-3, December 1997</TITLE\n"+ ! "</HEAD>\n"+ ! "<BODY>\n"+ ! "The body.\n"+ ! "</BODY>\n"+ ! "</HTML>"; ! createParser(text); ! parser.addScanner (new HtmlScanner ()); ! parser.addScanner (new TitleScanner ("-t")); ! parser.addScanner (new HeadScanner ()); ! parser.addScanner (new BodyScanner ()); ! parseAndAssertNodeCount(1); ! assertTrue ("Only node is a html tag",node[0] instanceof Html); ! Html html = (Html)node[0]; ! assertEquals ("Html node has five children", 5, html.getChildCount ()); ! assertTrue ("Second child is a head tag", html.childAt (1) instanceof HeadTag); ! HeadTag head = (HeadTag)html.childAt (1); ! assertEquals ("Head node has two children", 2, head.getChildCount ()); ! assertTrue ("Second child is a title tag", head.childAt (1) instanceof TitleTag); ! TitleTag titleTag = (TitleTag)head.childAt (1); assertEquals("Title","SISTEMA TERRA, VOL. VI , No. 1-3, December 1997",titleTag.getTitle()); ! // Note: this will fail because of the extra > inserted to finish the /TITLE tag: ! // assertStringEquals ("toHtml", text, html.toHtml ()); } *************** *** 91,97 **** TitleScanner titleScanner = new TitleScanner("-t"); parser.addScanner(titleScanner); ! parseAndAssertNodeCount(8); assertTrue("Third tag should be a title tag",node[2] instanceof TitleTag); TitleTag titleTag = (TitleTag)node[2]; assertEquals("Title","\nDouble tags can hang the code\n",titleTag.getTitle()); } --- 114,123 ---- TitleScanner titleScanner = new TitleScanner("-t"); parser.addScanner(titleScanner); ! parseAndAssertNodeCount(9); assertTrue("Third tag should be a title tag",node[2] instanceof TitleTag); TitleTag titleTag = (TitleTag)node[2]; + assertEquals("Title","\n",titleTag.getTitle()); + assertTrue("Fourth tag should be a title tag",node[3] instanceof TitleTag); + titleTag = (TitleTag)node[3]; assertEquals("Title","\nDouble tags can hang the code\n",titleTag.getTitle()); } |
From: <der...@us...> - 2003-10-25 15:55:13
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes In directory sc8-pr-cvs1:/tmp/cvs-serv3232/lexer/nodes Modified Files: RemarkNode.java Log Message: Handle some broken end tags. Handle some pathological remark nodes. Index: RemarkNode.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes/RemarkNode.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RemarkNode.java 20 Oct 2003 01:28:02 -0000 1.8 --- RemarkNode.java 25 Oct 2003 15:46:02 -0000 1.9 *************** *** 55,63 **** /** * Returns the text contents of the comment tag. - * todo: this only works for the usual case. */ public String getText() { ! return (mPage.getText (elementBegin () + 4, elementEnd () - 3)); } --- 55,73 ---- /** * Returns the text contents of the comment tag. */ public String getText() { ! int start; ! int end; ! String ret; ! ! start = elementBegin () + 4; ! end = elementEnd () - 3; ! if (start >= end) ! ret = ""; ! else ! ret = mPage.getText (start, end); ! ! return (ret); } *************** *** 66,69 **** --- 76,80 ---- return (getText()); } + public String toHtml() { return (mPage.getText (elementBegin (), elementEnd ())); |
From: <der...@us...> - 2003-10-25 15:51:11
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners In directory sc8-pr-cvs1:/tmp/cvs-serv3232/scanners Modified Files: TitleScanner.java Log Message: Handle some broken end tags. Handle some pathological remark nodes. Index: TitleScanner.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/scanners/TitleScanner.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** TitleScanner.java 20 Oct 2003 01:28:03 -0000 1.30 --- TitleScanner.java 25 Oct 2003 15:46:02 -0000 1.31 *************** *** 42,48 **** public class TitleScanner extends CompositeTagScanner { private static final String MATCH_NAME [] = {"TITLE"}; public TitleScanner(String filter) { ! super(filter,MATCH_NAME); } --- 42,50 ---- public class TitleScanner extends CompositeTagScanner { private static final String MATCH_NAME [] = {"TITLE"}; + private static final String ENDERS [] = {"BODY"}; + private static final String END_TAG_ENDERS [] = {"HEAD", "HTML"}; public TitleScanner(String filter) { ! super(filter,MATCH_NAME,ENDERS,END_TAG_ENDERS,false); } |
From: <der...@us...> - 2003-10-25 12:10:14
|
Update of /cvsroot/htmlparser/htmlparser/bin In directory sc8-pr-cvs1:/tmp/cvs-serv28126/bin Added Files: parser Log Message: Fix htmllexer.jar, add parser linux/unix script. --- NEW FILE: parser --- #! /bin/sh if [ -z "$HTMLPARSER_HOME" ] ; then ## resolve links - $0 may be a link to the home PRG="$0" progname=`basename "$0"` saveddir=`pwd` # need this for relative symlinks dirname_prg=`dirname "$PRG"` cd "$dirname_prg" while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done HTMLPARSER_HOME=`dirname "$PRG"`/.. cd "$saveddir" # make it fully qualified HTMLPARSER_HOME=`cd "$HTMLPARSER_HOME" && pwd` fi if [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi else JAVACMD=`which java 2> /dev/null ` if [ -z "$JAVACMD" ] ; then JAVACMD=java fi fi fi if [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." echo " We cannot execute $JAVACMD" exit 1 fi if [ -n "$CLASSPATH" ] ; then LOCALCLASSPATH="$CLASSPATH" fi HTMLPARSER_LIB="${HTMLPARSER_HOME}/lib" # add in the parser .jar file if [ -z "$LOCALCLASSPATH" ] ; then LOCALCLASSPATH="${HTMLPARSER_LIB}/htmlparser.jar" else LOCALCLASSPATH="${HTMLPARSER_LIB}/htmlparser.jar":"$LOCALCLASSPATH" fi # handle 1.1x JDKs if [ -n "$JAVA_HOME" ] ; then if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip" fi fi "$JAVACMD" -classpath "$LOCALCLASSPATH" org.htmlparser.Parser "$@" |
From: <der...@us...> - 2003-10-25 12:09:00
|
Update of /cvsroot/htmlparser/htmlparser In directory sc8-pr-cvs1:/tmp/cvs-serv28126 Modified Files: build.xml Log Message: Fix htmllexer.jar, add parser linux/unix script. Index: build.xml =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/build.xml,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** build.xml 23 Sep 2003 03:41:33 -0000 1.49 --- build.xml 25 Oct 2003 12:03:52 -0000 1.50 *************** *** 267,270 **** --- 267,271 ---- <include name="org/htmlparser/util/NodeIterator.class"/> <include name="org/htmlparser/util/SimpleNodeIterator.class"/> + <include name="org/htmlparser/util/SpecialHashtable.class"/> <include name="org/htmlparser/util/sort/**/*.class"/> <include name="org/htmlparser/parserHelper/SpecialHashtable.class"/> |
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests In directory sc8-pr-cvs1:/tmp/cvs-serv21682/parserHelperTests Modified Files: AllTests.java CompositeTagScannerHelperTest.java RemarkNodeParserTest.java StringParserTest.java Log Message: Consolidated the various testing main() methods into ParserTestCase. All unit test classes in the org.htmlparser.tests heirarchy should now be executable. Index: AllTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/AllTests.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AllTests.java 22 Sep 2003 02:40:07 -0000 1.28 --- AllTests.java 21 Oct 2003 02:24:00 -0000 1.29 *************** *** 28,35 **** package org.htmlparser.tests.parserHelperTests; - import junit.framework.*; ! public class AllTests extends junit.framework.TestCase { public AllTests(String name) { --- 28,42 ---- package org.htmlparser.tests.parserHelperTests; ! import junit.framework.TestSuite; ! ! import org.htmlparser.tests.ParserTestCase; ! ! public class AllTests extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.parserHelperTests.AllTests", "AllTests"); + } public AllTests(String name) { *************** *** 37,114 **** } ! public static TestSuite suite() { TestSuite suite = new TestSuite("Parser Helper Tests"); - // To-do: Test below should be enabled after it passes - // suite.addTestSuite(AttributeParserTest.class); suite.addTestSuite(CompositeTagScannerHelperTest.class); suite.addTestSuite(RemarkNodeParserTest.class); suite.addTestSuite(StringParserTest.class); - // To-do: Test below should be enabled after it passes - // suite.addTestSuite(TagParserTest.class); - return suite; - } - - /** - * Mainline for all suites of tests. - * @param args Command line arguments. The following options - * are understood: - * <pre> - * -text -- use junit.textui.TestRunner - * -awt -- use junit.awtui.TestRunner - * -swing -- use junit.swingui.TestRunner (default) - * </pre> - * All other options are passed on to the junit framework. - */ - public static void main(String[] args) - { - String runner; - int i; - String arguments[]; - Class cls; - - runner = null; - for (i = 0; (i < args.length) && (null == runner); i++) - { - if (args[i].equalsIgnoreCase ("-text")) - runner = "junit.textui.TestRunner"; - else if (args[i].equalsIgnoreCase ("-awt")) - runner = "junit.awtui.TestRunner"; - else if (args[i].equalsIgnoreCase ("-swing")) - runner = "junit.swingui.TestRunner"; - } - if (null != runner) - { - // remove it from the arguments - arguments = new String[args.length - 1]; - System.arraycopy (args, 0, arguments, 0, i - 1); - System.arraycopy (args, i, arguments, i - 1, args.length - i); - args = arguments; - } - else - runner = "junit.swingui.TestRunner"; - - // append the test class - arguments = new String[args.length + 1]; - System.arraycopy (args, 0, arguments, 0, args.length); - arguments[args.length] = "org.htmlparser.tests.parserHelperTests.AllTests"; - - // invoke main() of the test runner - try - { - cls = Class.forName (runner); - java.lang.reflect.Method method = cls.getDeclaredMethod ( - "main", new Class[] { String[].class }); - method.invoke ( - null, - new Object[] { arguments }); - } - catch (Throwable t) - { - System.err.println ( - "cannot run unit test (" - + t.getMessage () - + ")"); - } } } --- 44,53 ---- } ! public static TestSuite suite() { TestSuite suite = new TestSuite("Parser Helper Tests"); suite.addTestSuite(CompositeTagScannerHelperTest.class); suite.addTestSuite(RemarkNodeParserTest.class); suite.addTestSuite(StringParserTest.class); return suite; } } Index: CompositeTagScannerHelperTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/CompositeTagScannerHelperTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CompositeTagScannerHelperTest.java 20 Oct 2003 01:28:04 -0000 1.23 --- CompositeTagScannerHelperTest.java 21 Oct 2003 02:24:00 -0000 1.24 *************** *** 40,43 **** --- 40,49 ---- */ public class CompositeTagScannerHelperTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.parserHelperTests.CompositeTagScannerHelperTest", "CompositeTagScannerHelperTest"); + } + private CompositeTagScannerHelper helper; public CompositeTagScannerHelperTest(String name) { Index: RemarkNodeParserTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/RemarkNodeParserTest.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** RemarkNodeParserTest.java 6 Oct 2003 01:43:28 -0000 1.37 --- RemarkNodeParserTest.java 21 Oct 2003 02:24:00 -0000 1.38 *************** *** 39,42 **** --- 39,47 ---- public class RemarkNodeParserTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.parserHelperTests.RemarkNodeParserTest", "RemarkNodeParserTest"); + } + public RemarkNodeParserTest(String name) { super(name); Index: StringParserTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/parserHelperTests/StringParserTest.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** StringParserTest.java 6 Oct 2003 01:43:28 -0000 1.39 --- StringParserTest.java 21 Oct 2003 02:24:00 -0000 1.40 *************** *** 40,43 **** --- 40,48 ---- public class StringParserTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.parserHelperTests.StringParserTest", "StringParserTest"); + } + public StringParserTest(String name) { super(name); |
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests In directory sc8-pr-cvs1:/tmp/cvs-serv21682/tagTests Modified Files: AllTests.java AppletTagTest.java BaseHrefTagTest.java BodyTagTest.java CompositeTagTest.java DoctypeTagTest.java EndTagTest.java FormTagTest.java FrameSetTagTest.java FrameTagTest.java ImageTagTest.java InputTagTest.java JspTagTest.java LinkTagTest.java MetaTagTest.java ObjectCollectionTest.java OptionTagTest.java ScriptTagTest.java SelectTagTest.java StyleTagTest.java TagTest.java TextareaTagTest.java TitleTagTest.java Log Message: Consolidated the various testing main() methods into ParserTestCase. All unit test classes in the org.htmlparser.tests heirarchy should now be executable. Index: AllTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/AllTests.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** AllTests.java 22 Sep 2003 02:40:12 -0000 1.44 --- AllTests.java 21 Oct 2003 02:24:01 -0000 1.45 *************** *** 31,36 **** import junit.framework.TestSuite; ! public class AllTests extends junit.framework.TestCase { public AllTests(String name) { super(name); --- 31,43 ---- import junit.framework.TestSuite; ! import org.htmlparser.tests.ParserTestCase; ! ! public class AllTests extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.AllTests", "AllTests"); + } + public AllTests(String name) { super(name); *************** *** 62,128 **** suite.addTestSuite(CompositeTagTest.class); return suite; - } - - /** - * Mainline for all suites of tests. - * @param args Command line arguments. The following options - * are understood: - * <pre> - * -text -- use junit.textui.TestRunner - * -awt -- use junit.awtui.TestRunner - * -swing -- use junit.swingui.TestRunner (default) - * </pre> - * All other options are passed on to the junit framework. - */ - public static void main(String[] args) - { - String runner; - int i; - String arguments[]; - Class cls; - - runner = null; - for (i = 0; (i < args.length) && (null == runner); i++) - { - if (args[i].equalsIgnoreCase ("-text")) - runner = "junit.textui.TestRunner"; - else if (args[i].equalsIgnoreCase ("-awt")) - runner = "junit.awtui.TestRunner"; - else if (args[i].equalsIgnoreCase ("-swing")) - runner = "junit.swingui.TestRunner"; - } - if (null != runner) - { - // remove it from the arguments - arguments = new String[args.length - 1]; - System.arraycopy (args, 0, arguments, 0, i - 1); - System.arraycopy (args, i, arguments, i - 1, args.length - i); - args = arguments; - } - else - runner = "junit.swingui.TestRunner"; - - // append the test class - arguments = new String[args.length + 1]; - System.arraycopy (args, 0, arguments, 0, args.length); - arguments[args.length] = "org.htmlparser.tests.tagTests.AllTests"; - - // invoke main() of the test runner - try - { - cls = Class.forName (runner); - java.lang.reflect.Method method = cls.getDeclaredMethod ( - "main", new Class[] { String[].class }); - method.invoke ( - null, - new Object[] { arguments }); - } - catch (Throwable t) - { - System.err.println ( - "cannot run unit test (" - + t.getMessage () - + ")"); - } } } --- 69,72 ---- Index: AppletTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/AppletTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** AppletTagTest.java 18 Oct 2003 20:50:37 -0000 1.31 --- AppletTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 37,40 **** --- 37,45 ---- public class AppletTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.AppletTagTest", "AppletTagTest"); + } + public AppletTagTest(String name) { super(name); Index: BaseHrefTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/BaseHrefTagTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** BaseHrefTagTest.java 20 Oct 2003 01:28:04 -0000 1.30 --- BaseHrefTagTest.java 21 Oct 2003 02:24:01 -0000 1.31 *************** *** 36,39 **** --- 36,44 ---- public class BaseHrefTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.BaseHrefTagTest", "BaseHrefTagTest"); + } + public BaseHrefTagTest(String name) { super(name); Index: BodyTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/BodyTagTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** BodyTagTest.java 22 Sep 2003 02:40:12 -0000 1.13 --- BodyTagTest.java 21 Oct 2003 02:24:01 -0000 1.14 *************** *** 40,43 **** --- 40,49 ---- public class BodyTagTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.BodyTagTest", "BodyTagTest"); + } + private BodyTag bodyTag; *************** *** 105,113 **** { return new TestSuite(BodyTagTest.class); - } - - public static void main(String[] args) - { - new junit.awtui.TestRunner().start(new String[] {BodyTagTest.class.getName()}); } } --- 111,114 ---- Index: CompositeTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/CompositeTagTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CompositeTagTest.java 22 Sep 2003 02:40:12 -0000 1.9 --- CompositeTagTest.java 21 Oct 2003 02:24:01 -0000 1.10 *************** *** 37,40 **** --- 37,45 ---- public class CompositeTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.CompositeTagTest", "CompositeTagTest"); + } + public CompositeTagTest(String name) { super(name); Index: DoctypeTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/DoctypeTagTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** DoctypeTagTest.java 5 Oct 2003 13:49:54 -0000 1.29 --- DoctypeTagTest.java 21 Oct 2003 02:24:01 -0000 1.30 *************** *** 35,38 **** --- 35,43 ---- public class DoctypeTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.DoctypeTagTest", "DoctypeTagTest"); + } + public DoctypeTagTest(String name) { super(name); Index: EndTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/EndTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** EndTagTest.java 6 Oct 2003 01:43:28 -0000 1.31 --- EndTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 36,39 **** --- 36,44 ---- public class EndTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.EndTagTest", "EndTagTest"); + } + public EndTagTest(String name) { super(name); Index: FormTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/FormTagTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** FormTagTest.java 18 Oct 2003 20:50:37 -0000 1.35 --- FormTagTest.java 21 Oct 2003 02:24:01 -0000 1.36 *************** *** 42,45 **** --- 42,50 ---- public class FormTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.FormTagTest", "FormTagTest"); + } + public FormTagTest(String name) { super(name); Index: FrameSetTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/FrameSetTagTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FrameSetTagTest.java 6 Oct 2003 01:43:28 -0000 1.30 --- FrameSetTagTest.java 21 Oct 2003 02:24:01 -0000 1.31 *************** *** 37,40 **** --- 37,45 ---- public class FrameSetTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.FrameSetTagTest", "FrameSetTagTest"); + } + public FrameSetTagTest(String name) { super(name); Index: FrameTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/FrameTagTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FrameTagTest.java 6 Oct 2003 01:43:28 -0000 1.30 --- FrameTagTest.java 21 Oct 2003 02:24:01 -0000 1.31 *************** *** 36,39 **** --- 36,44 ---- public class FrameTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.FrameTagTest", "FrameTagTest"); + } + public FrameTagTest(String name) { super(name); Index: ImageTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/ImageTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ImageTagTest.java 6 Oct 2003 01:43:28 -0000 1.32 --- ImageTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 *************** *** 41,44 **** --- 41,49 ---- public class ImageTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.ImageTagTest", "ImageTagTest"); + } + public ImageTagTest(String name) { super(name); Index: InputTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/InputTagTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** InputTagTest.java 13 Oct 2003 21:48:14 -0000 1.33 --- InputTagTest.java 21 Oct 2003 02:24:01 -0000 1.34 *************** *** 38,41 **** --- 38,47 ---- public class InputTagTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.InputTagTest", "InputTagTest"); + } + private String testHTML = new String("<INPUT type=\"text\" name=\"Google\">"); Index: JspTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/JspTagTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** JspTagTest.java 18 Oct 2003 20:50:37 -0000 1.34 --- JspTagTest.java 21 Oct 2003 02:24:01 -0000 1.35 *************** *** 37,40 **** --- 37,45 ---- public class JspTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.JspTagTest", "JspTagTest"); + } + private static final boolean JSP_TESTS_ENABLED = false; Index: LinkTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/LinkTagTest.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** LinkTagTest.java 20 Oct 2003 01:28:04 -0000 1.38 --- LinkTagTest.java 21 Oct 2003 02:24:01 -0000 1.39 *************** *** 38,41 **** --- 38,46 ---- public class LinkTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.LinkTagTest", "LinkTagTest"); + } + public LinkTagTest(String name) { super(name); Index: MetaTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/MetaTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MetaTagTest.java 13 Oct 2003 21:48:14 -0000 1.32 --- MetaTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 *************** *** 35,38 **** --- 35,43 ---- public class MetaTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.MetaTagTest", "MetaTagTest"); + } + public MetaTagTest(String name) { super(name); Index: ObjectCollectionTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/ObjectCollectionTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ObjectCollectionTest.java 22 Sep 2003 02:40:12 -0000 1.13 --- ObjectCollectionTest.java 21 Oct 2003 02:24:01 -0000 1.14 *************** *** 42,45 **** --- 42,50 ---- public class ObjectCollectionTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.ObjectCollectionTest", "ObjectCollectionTest"); + } + public ObjectCollectionTest(String name) { super(name); Index: OptionTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/OptionTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** OptionTagTest.java 6 Oct 2003 01:43:28 -0000 1.31 --- OptionTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 41,44 **** --- 41,49 ---- public class OptionTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.OptionTagTest", "OptionTagTest"); + } + private String testHTML = new String( "<OPTION value=\"Google Search\">Google</OPTION>" + *************** *** 140,148 **** assertEquals("HTML Raw String","OPTION VALUE: Time Warner TEXT: Time Warner AOL Inc.\n",OptionTag.toString()); */ } - - public static void main(String[] args) - { - new junit.awtui.TestRunner().start(new String[] {OptionTagTest.class.getName()}); - } - } --- 145,147 ---- Index: ScriptTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/ScriptTagTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ScriptTagTest.java 20 Oct 2003 01:28:04 -0000 1.34 --- ScriptTagTest.java 21 Oct 2003 02:24:01 -0000 1.35 *************** *** 38,41 **** --- 38,47 ---- public class ScriptTagTest extends ParserTestCase{ + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.ScriptTagTest", "ScriptTagTest"); + } + private ScriptScanner scriptScanner; Index: SelectTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/SelectTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** SelectTagTest.java 6 Oct 2003 01:43:28 -0000 1.32 --- SelectTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 *************** *** 43,46 **** --- 43,51 ---- public class SelectTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.SelectTagTest", "SelectTagTest"); + } + private String testHTML = new String( "<SELECT name=\"Nominees\">\n"+ *************** *** 99,107 **** assertEquals("option tag 7","Niece\r\n",optionTags[6].getOptionText()); } - - public static void main(String[] args) - { - new junit.awtui.TestRunner().start(new String[] {SelectTagTest.class.getName()}); - } - } --- 104,106 ---- Index: StyleTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/StyleTagTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** StyleTagTest.java 6 Oct 2003 01:43:28 -0000 1.29 --- StyleTagTest.java 21 Oct 2003 02:24:01 -0000 1.30 *************** *** 36,39 **** --- 36,44 ---- public class StyleTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.StyleTagTest", "StyleTagTest"); + } + public StyleTagTest(String name) { super(name); Index: TagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TagTest.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** TagTest.java 18 Oct 2003 20:50:37 -0000 1.48 --- TagTest.java 21 Oct 2003 02:24:01 -0000 1.49 *************** *** 44,47 **** --- 44,52 ---- public class TagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.TagTest", "TagTest"); + } + private static final boolean JSP_TESTS_ENABLED = false; Index: TextareaTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TextareaTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** TextareaTagTest.java 13 Oct 2003 21:48:14 -0000 1.31 --- TextareaTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 38,41 **** --- 38,46 ---- public class TextareaTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.TextareaTagTest", "TextareaTagTest"); + } + private String area1 = "<TEXTAREA name=\"Remarks\" >The intervention by the UN proved beneficial</TEXTAREA>"; private String area2 = "<TEXTAREA>The capture of the Somali warloard was elusive</TEXTAREA>"; Index: TitleTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TitleTagTest.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TitleTagTest.java 22 Sep 2003 02:40:13 -0000 1.28 --- TitleTagTest.java 21 Oct 2003 02:24:01 -0000 1.29 *************** *** 37,40 **** --- 37,46 ---- public class TitleTagTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.TitleTagTest", "TitleTagTest"); + } + private TitleTag titleTag; |