RE: How to set the autoRedirect and autoRefresh in httpunit
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <652366DEEF97A3438EC2F4669BD66BA58A79AD@msgswbmnmsp31.wellsfargo.com> |
public void testRedirect() throws Exception {
WebConversation conv = new WebConversation();
conv.setExceptionsThrownOnErrorStatus(false);
String url = "http://www.qa.ehealthinsurance.com/ehi/CarrierP";
WebRequest webRequest = new GetMethodWebRequest(url);
WebResponse webResponse = conv.getResponse(webRequest);
assertEquals(404, webResponse.getResponseCode());
WebRequest refreshRequest = webResponse.getRefreshRequest();
assertEquals("http://www.qa.ehealthinsurance.com/", refreshRequest.getURL().toExternalForm());
WebResponse newResponse = conv.getResponse(refreshRequest);
assertEquals(200, newResponse.getResponseCode());
}
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of zhao dean
> Sent: Sunday, April 30, 2006 6:01 AM
> To: [email protected]
> Subject: [Httpunit-develop] How to set the autoRedirect and
> autoRefresh in httpunit
>
>
> Hi,
>
> My question is “How to set the autoRedirect and autoRefresh
> in httpunit”.
>
> I’d like to take an example:
>
> When go to
> http://www.qa.ehealthinsurance.com/ehi/CarrierP
>
> You first land at a “404 not found” page. And 6 seconds
> later, you are
> forwarded to http://www.qa.ehealthinsurance.com/.
> So http://www.qa.ehealthinsurance.com/. Is the final response
> from server
> for http://www.qa.ehealthinsurance.com/ehi/CarrierP
>
>
> However, When using httpunit, I am always get a 404 not found
> exception,
> and thus not able to get to the final response when tried manually.
> Could any kind guys show me the example code to get the final
> response (the
> response after being redirected/refreshed)?
>
> Many thanks,
>
> Thanks,
>
> _________________________________________________________________
> 与世界各地的朋友进行交流,免费下载 MSN Messenger:
> http://messenger.msn.com/cn
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web
> services, security? Get stuff done quickly with
> pre-integrated technology to make your job easier Download
> IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&
dat=121642
_______________________________________________
Httpunit-develop mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642