HeadMethodWebRequest problems
<[email protected]> Tue, 18 Aug 2009 14:33:32 -0500
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <047619DE22807D4192B0B9EB64E45CC1248574F0D7@MSGCMSV21024.ent.wfb.bank.corp> |
I tried to use HeadMethodWebRequest, but I have problems because it is
calling the HTMLParser I set with HTMLParserFactory.setHTMLParser(...)
which it shouldn't be doing because HEAD will have no body in the response.
I tried to look in the unit tests, and I see no tests
for HeadMethodWebRequest. Perhaps the test server doesn't
support it because this gave me a 404:
public void testHead() throws Exception {
defineResource( "SimplePage.html",
"<html><head><title>A Sample Page</title></head>\n" +
"<body>Hello</body></html>\n" );
HttpUnitOptions.setExceptionsThrownOnErrorStatus(true);
WebConversation wc = new WebConversation();
WebRequest request = new HeadMethodWebRequest( getHostPath() + "/SimplePage.html" );
WebResponse simplePage = wc.getResponse( request );
}
Thanks,
Dan
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july