Here's a simple hack that serves a pretty useful purpose for us, perhaps you may wish to incorporate it in the build:
We're using httpunit to validate page output, including validation against a benchmark. We save the old benchmark pages as zipped html text. When it's time to compare them against the new results, we use the following factory method we added to WebResponse to reconstitute them:
/**
* Constructs a response directly from saved page text.
* @param client the conversation in current use
* @param url the url at which the saved page was found
* @param text the saved page text from which to reconstruct the response
* @return a newly reconstituted WebResponse
*/
public static WebResponse fromHtmlText(WebClient client, URL url, String text)
throws SAXException
{
WebResponse resp = new DefaultWebResponse(client, url, text);
return resp;
}
The other way to do it is to copy WebResponse.DefaultWebResponse and paste it into your app. Now that we've upgraded to a newer version of httpunit, we do it that way.
Marc Schabb
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's a simple hack that serves a pretty useful purpose for us, perhaps you may wish to incorporate it in the build:
We're using httpunit to validate page output, including validation against a benchmark. We save the old benchmark pages as zipped html text. When it's time to compare them against the new results, we use the following factory method we added to WebResponse to reconstitute them:
/**
* Constructs a response directly from saved page text.
* @param client the conversation in current use
* @param url the url at which the saved page was found
* @param text the saved page text from which to reconstruct the response
* @return a newly reconstituted WebResponse
*/
public static WebResponse fromHtmlText(WebClient client, URL url, String text)
throws SAXException
{
WebResponse resp = new DefaultWebResponse(client, url, text);
return resp;
}
The other way to do it is to copy WebResponse.DefaultWebResponse and paste it into your app. Now that we've upgraded to a newer version of httpunit, we do it that way.
Marc Schabb