Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3381
Modified Files:
AttributeTests.java
Log Message:
Add test case for bug #979893 Not Parsing all Attributes.
Not reproducible.
Index: AttributeTests.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/AttributeTests.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AttributeTests.java 24 May 2004 16:31:22 -0000 1.15
--- AttributeTests.java 26 Jun 2004 11:56:08 -0000 1.16
***************
*** 35,38 ****
--- 35,39 ----
import org.htmlparser.lexer.PageAttribute;
import org.htmlparser.tags.ImageTag;
+ import org.htmlparser.tags.LinkTag;
import org.htmlparser.tags.Tag;
import org.htmlparser.tests.ParserTestCase;
***************
*** 748,750 ****
--- 749,777 ----
assertTrue ("setQuote('\\'') failed", "src='images/third'".equals (src.toString ()));
}
+
+ /**
+ * see bug #979893 Not Parsing all Attributes
+ */
+ public void testNoSpace () throws ParserException
+ {
+ String id = "A19012_00002";
+ String rawid = "\"" + id + "\"";
+ String cls = "BuyLink";
+ String rawcls = "\"" + cls + "\"";
+ String href = "http://www.someplace.com/buyme.html";
+ String rawhref = "\"" + href + "\"";
+ String html = "<a id=" + rawid + /* no space */ "class=" + rawcls + " href=" + rawhref + ">Pick me.</a>";
+ createParser (html);
+ parseAndAssertNodeCount (1);
+ assertTrue ("Node should be an LinkTag", node[0] instanceof LinkTag);
+ LinkTag link = (LinkTag)node[0];
+ Vector attributes = link.getAttributesEx ();
+ assertEquals ("Incorrect number of attributes", 6, attributes.size ());
+ assertStringEquals ("id wrong", rawid, link.getAttributeEx ("id").getRawValue ());
+ assertStringEquals ("class wrong", rawcls, link.getAttributeEx ("class").getRawValue ());
+ assertStringEquals ("href wrong", rawhref, link.getAttributeEx ("href").getRawValue ());
+ assertStringEquals ("id wrong", id, link.getAttributeEx ("id").getValue ());
+ assertStringEquals ("class wrong", cls, link.getAttributeEx ("class").getValue ());
+ assertStringEquals ("href wrong", href, link.getAttributeEx ("href").getValue ());
+ }
}
|