[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebClientTest.java,1.12,1.13
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-03-19 19:09:04
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv20577/test/com/meterware/httpunit
Modified Files:
WebClientTest.java
Log Message:
Add support for DNS override
Index: WebClientTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- WebClientTest.java 19 Mar 2003 16:31:23 -0000 1.12
+++ WebClientTest.java 19 Mar 2003 19:08:59 -0000 1.13
@@ -342,4 +342,21 @@
}
+ public void testDNSOverride() throws Exception {
+ WebConversation wc = new WebConversation();
+ wc.getClientProperties().setDnsListener( new DNSListener() {
+ public String getIpAddress( String hostName ) { return "127.0.0.1"; }
+ });
+
+ defineResource( "whereAmI", new PseudoServlet() {
+ public WebResource getGetResponse() throws IOException {
+ return new WebResource( "found host header: " + getHeader( "Host" ) );
+ }
+ } );
+
+ WebResponse wr = wc.getResponse( "http://meterware.com:" + getHostPort() + "/whereAmI" );
+ assertEquals( "Submitted host header", "found host header: meterware.com:" + getHostPort(), wr.getText() );
+ }
+
+
}
|