Thread: [Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/lexerTests AttributeTests.java,1.10,1.11 KitTes
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests In directory sc8-pr-cvs1:/tmp/cvs-serv28098/src/org/htmlparser/tests/lexerTests Modified Files: AttributeTests.java KitTest.java LexerTests.java PageTests.java SourceTests.java StreamTests.java Log Message: Index: AttributeTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/AttributeTests.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AttributeTests.java 2 Jan 2004 16:24:55 -0000 1.10 --- AttributeTests.java 14 Jan 2004 02:53:47 -0000 1.11 *************** *** 29,36 **** import java.util.Hashtable; import java.util.Vector; - import junit.framework.TestSuite; import org.htmlparser.Node; - import org.htmlparser.Parser; import org.htmlparser.PrototypicalNodeFactory; import org.htmlparser.lexer.nodes.Attribute; --- 29,34 ---- Index: KitTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/KitTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** KitTest.java 20 Oct 2003 01:28:03 -0000 1.5 --- KitTest.java 14 Jan 2004 02:53:47 -0000 1.6 *************** *** 31,38 **** import java.util.Vector; import javax.swing.text.BadLocationException; - import javax.swing.text.Document; - import javax.swing.text.EditorKit; import javax.swing.text.Element; - import javax.swing.text.ElementIterator; import javax.swing.text.MutableAttributeSet; import javax.swing.text.html.HTML; --- 31,35 ---- *************** *** 43,47 **** import org.htmlparser.lexer.Cursor; import org.htmlparser.lexer.Lexer; - import org.htmlparser.lexer.Page; import org.htmlparser.AbstractNode; import org.htmlparser.lexer.nodes.Attribute; --- 40,43 ---- *************** *** 608,611 **** --- 604,610 ---- * * $Log$ + * Revision 1.6 2004/01/14 02:53:47 derrickoswald + * *** empty log message *** + * * Revision 1.5 2003/10/20 01:28:03 derrickoswald * Removed lexer level AbstractNode. Index: LexerTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/LexerTests.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LexerTests.java 10 Jan 2004 15:23:33 -0000 1.16 --- LexerTests.java 14 Jan 2004 02:53:47 -0000 1.17 *************** *** 27,39 **** package org.htmlparser.tests.lexerTests; - import java.io.BufferedReader; - import java.io.ByteArrayInputStream; import java.io.IOException; - import java.io.InputStream; - import java.io.InputStreamReader; - import java.io.StringReader; - import java.io.UnsupportedEncodingException; import java.net.URL; - import java.net.URLConnection; import java.util.HashSet; --- 27,32 ---- *************** *** 41,48 **** import org.htmlparser.Parser; import org.htmlparser.lexer.Lexer; - import org.htmlparser.lexer.Page; - import org.htmlparser.lexer.PageIndex; - import org.htmlparser.lexer.Source; - import org.htmlparser.lexer.Stream; import org.htmlparser.lexer.nodes.RemarkNode; import org.htmlparser.lexer.nodes.StringNode; --- 34,37 ---- *************** *** 52,56 **** import org.htmlparser.util.NodeIterator; import org.htmlparser.util.NodeList; - import org.htmlparser.util.EncodingChangeException; import org.htmlparser.util.ParserException; --- 41,44 ---- *************** *** 621,629 **** * causes spurious tags. * The root cause is characters bracketed by [esc]$B and [esc](J (contrary ! * to what is indicated in the j_s_nightingale analysis of the problem) that * sometimes have an angle bracket (< or 0x3c) embedded in them. These * are taken to be tags by the parser, instead of being considered strings. * <p> ! * The URL http://www.009.com/ has an ISO-8859-1 encoding (the default), but * Japanese characters intermixed on the page with English, using the JIS * encoding. We detect failure by looking for weird tag names which were --- 609,617 ---- * causes spurious tags. * The root cause is characters bracketed by [esc]$B and [esc](J (contrary ! * to what is indicated in then j_s_nightingale analysis of the problem) that * sometimes have an angle bracket (< or 0x3c) embedded in them. These * are taken to be tags by the parser, instead of being considered strings. * <p> ! * The URL refrenced has an ISO-8859-1 encoding (the default), but * Japanese characters intermixed on the page with English, using the JIS * encoding. We detect failure by looking for weird tag names which were *************** *** 667,671 **** NodeIterator iterator; ! parser = new Parser ("http://htmlparser.sourceforge.net/test/www_009_com.html"); iterator = parser.elements (); while (iterator.hasMoreNodes ()) --- 655,659 ---- NodeIterator iterator; ! parser = new Parser ("http://www.009.com/"); iterator = parser.elements (); while (iterator.hasMoreNodes ()) *************** *** 746,784 **** } - /** - * See bug #874175 StringBean doesn't handle charset change well - * Force an encoding change exception, reset and re-read. - */ - public void testEncodingChange () - throws - ParserException - { - NodeIterator iterator; - Node node; - boolean success; - - parser = new Parser ("http://htmlparser.sourceforge.net/test/www_china-pub_com.html"); - success = false; - try - { - for (iterator = parser.elements (); iterator.hasMoreNodes (); ) - node = iterator.nextNode (); - } - catch (EncodingChangeException ece) - { - success = true; - try - { - parser.reset (); - for (iterator = parser.elements (); iterator.hasMoreNodes (); ) - node = iterator.nextNode (); - } - catch (ParserException pe) - { - success = false; - } - } - assertTrue ("encoding change failed", success); - } } --- 734,737 ---- Index: PageTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/PageTests.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PageTests.java 2 Jan 2004 16:24:56 -0000 1.15 --- PageTests.java 14 Jan 2004 02:53:47 -0000 1.16 *************** *** 28,32 **** import java.io.IOException; - import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLConnection; --- 28,31 ---- Index: SourceTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/SourceTests.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SourceTests.java 2 Jan 2004 16:24:56 -0000 1.15 --- SourceTests.java 14 Jan 2004 02:53:47 -0000 1.16 *************** *** 30,40 **** import java.io.ByteArrayInputStream; import java.io.IOException; - import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; - import java.util.ArrayList; - import java.util.Random; import org.htmlparser.lexer.Stream; --- 30,37 ---- Index: StreamTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/StreamTests.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** StreamTests.java 2 Jan 2004 16:24:56 -0000 1.15 --- StreamTests.java 14 Jan 2004 02:53:47 -0000 1.16 *************** *** 30,39 **** import java.io.ByteArrayInputStream; import java.io.IOException; - import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; - import java.util.Random; import org.htmlparser.lexer.Stream; --- 30,37 ---- |