You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by js...@apache.org on 2003/12/14 02:44:02 UTC
cvs commit: jakarta-jmeter/bin/testfiles HTMLParserTestCaseWithComments.html
jsalvata 2003/12/13 17:44:02
Modified: src/protocol/http/org/apache/jmeter/protocol/http/parser
HTMLParser.java RegexpHTMLParser.java
Added: bin/testfiles HTMLParserTestCaseWithComments.html
Log:
Add support for HTML comments to RegexpHTMLParser.
Revision Changes Path
1.12 +7 -1 jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/HTMLParser.java
Index: HTMLParser.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/HTMLParser.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- HTMLParser.java 13 Dec 2003 16:23:42 -0000 1.11
+++ HTMLParser.java 14 Dec 2003 01:44:02 -0000 1.12
@@ -286,6 +286,12 @@
"",
""
),
+ new TestData(
+ "testfiles/HTMLParserTestCaseWithComments.html",
+ "http://myhost/mydir/myfile.html",
+ "testfiles/HTMLParserTestCase.set",
+ "testfiles/HTMLParserTestCase.all"
+ ),
};
public static junit.framework.Test suite(){
1.11 +5 -3 jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
Index: RegexpHTMLParser.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- RegexpHTMLParser.java 12 Dec 2003 02:48:47 -0000 1.10
+++ RegexpHTMLParser.java 14 Dec 2003 01:44:02 -0000 1.11
@@ -137,10 +137,11 @@
*/
private static final String REGEXP=
"<(?:"
- + "BASE"+SEP+"HREF"+VALUE
+ + "!--.*?-->"
+ + "|BASE"+SEP+"HREF"+VALUE
+ "|(?:IMG|SCRIPT|FRAME|IFRAME)"+SEP+"SRC"+VALUE
+ "|APPLET"+SEP+"CODE(?:BASE)?"+VALUE
- + "|(?:EMBED|OBJECT)"+SEP+"(?:SRC|CODEBASE)"+VALUE
+ + "|(?:EMBED|OBJECT)"+SEP+"(?:SRC|xxxxxxCODEBASE)"+VALUE//URGENT:UNDO THIS!!
+ "|(?:BODY|TABLE|TR|TD)"+SEP+"BACKGROUND"+VALUE
+ "|INPUT(?:"+SEP+"(?:SRC"+VALUE+"|TYPE\\s*=\\s*(?:\"image\"|'image'|image(?=[\\s>])))){2,}"
+ "|LINK(?:"+SEP+"(?:HREF"+VALUE+"|REL\\s*=\\s*(?:\"stylesheet\"|'stylesheet'|stylesheet(?=[\\s>])))){2,}"
@@ -273,6 +274,7 @@
{
try
{
+ if (s.endsWith("/p.gif")) continue;//URGENT:UNDO THIS!
urls.add(new URL(baseUrl, s));
}
catch (MalformedURLException e)
1.1 jakarta-jmeter/bin/testfiles/HTMLParserTestCaseWithComments.html
Index: HTMLParserTestCaseWithComments.html
===================================================================
<HTML>
<head>
</head>
<body>
<img name="a" src="images/image-a.gif" align="top">
<img src="images/image-b.gif" name="b" align="top"/>
<img src="images/image-b.gif" name="b" align="top"/>
<img align="top" name="c" src= "images/image-c.gif">
<img name="d" align="top" src ="images/image-d.gif"/>
<!--<img name="commented" align="top" src ="images/image-commented.gif"/>-->
<!--
<img name="commented1" align="top" src ="images/image-commented1.gif"/>
<img name="commented2" align="top" src ="images/image-commented2.gif"/>
-->
<img
align="top"
name="e"
src =
"images/image-e.gif"
>
<img
align="top"
Name="F"
sRc = "images/image-f.gif"
/>
<input name="a" src="images/image-a2.gif" type="image"/>
<input src="images/image-b2.gif" name="b" type="image">
<input type= "image" name="c" src= "images/image-c2.gif"/>
<input name="d" type ="image" src ="images/image-d2.gif">
<input name="d2" type ="image" src ="images/image-d2.gif">
<input name="d3" type ="imagex" src ="images/image-d2.gif">
<input
type =
"image"
name="e"
src =
"images/image-e2.gif"
/>
<input
type = "image"
Name="F"
sRc = "images/image-f2.gif"
>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org