hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1128917 - /httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java
Date Sun, 29 May 2011 17:58:43 GMT
Author: olegk
Date: Sun May 29 17:58:42 2011
New Revision: 1128917

URL: http://svn.apache.org/viewvc?rev=1128917&view=rev
Log:
Fixed the test breakage on Linux where the local host name is returned as 'localhost.localdomain'

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java?rev=1128917&r1=1128916&r2=1128917&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultClientRequestDirector.java
Sun May 29 17:58:42 2011
@@ -614,6 +614,7 @@ public class TestDefaultClientRequestDir
     @Test
     public void testDefaultHostHeader() throws Exception {
         int port = this.localServer.getServiceAddress().getPort();
+        String hostname = getServerHttp().getHostName();
         this.localServer.register("*", new SimpleService());
 
         HttpContext context = new BasicHttpContext();
@@ -633,7 +634,7 @@ public class TestDefaultClientRequestDir
         Header[] headers = reqWrapper.getHeaders("host");
         Assert.assertNotNull(headers);
         Assert.assertEquals(1, headers.length);
-        Assert.assertEquals("localhost:"+port,headers[0].getValue());
+        Assert.assertEquals(hostname + ":" + port, headers[0].getValue());
     }
 
     @Test



Mime
View raw message