sebb 2004/08/17 15:51:59
Modified: src/protocol/http/org/apache/jmeter/protocol/http/parser
HTMLParser.java
Log:
Added missing base href test; add more details to assert messages
Revision Changes Path
1.24 +14 -6
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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- HTMLParser.java 24 Mar 2004 03:04:46 -0000 1.23
+++ HTMLParser.java 17 Aug 2004 22:51:59 -0000 1.24
@@ -308,6 +308,12 @@
"testfiles/HTMLParserTestCase.all"
),
new TestData(
+ "testfiles/HTMLParserTestCaseWithMissingBaseHRef.html",
+ "http://localhost/mydir/images/myfile.html",
+ "testfiles/HTMLParserTestCase.set",
+ "testfiles/HTMLParserTestCase.all"
+ ),
+ new TestData(
"testfiles/HTMLParserTestCase2.html",
"http:", //Dummy, as the file has no
entries
"",
@@ -435,6 +441,8 @@
boolean orderMatters) //Does the order
matter?
throws Exception
{
+ String parserName=p.getClass().getName()
+
.substring("org.apache.jmeter.protocol.http.parser".length());
log.debug("file "+file);
File f= findTestFile(file);
byte[] buffer= new byte[(int)f.length()];
@@ -470,17 +478,17 @@
}
while (expected.hasNext()) {
- assertTrue("Expecting another
result",result.hasNext());
+ assertTrue(parserName+"::Expecting another
result",result.hasNext());
try
{
- assertEquals(expected.next(),((URL) result.next()).toString());
+ assertEquals(parserName+"("+file+")",expected.next(),((URL)
result.next()).toString());
}
catch (ClassCastException e)
{
- fail("Expected URL, but got "+e.toString());
+ fail(parserName+"::Expected URL, but got "+e.toString());
}
}
- assertFalse("Should have reached the end of the
results",result.hasNext());
+ assertFalse(parserName+"::Should have reached the end of the
results",result.hasNext());
}
// Get expected results as a List
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]