Fixed the test breakage on Linux where the local host name is returned as 'localhost.localdomain'

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1128917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2011-05-29 17:58:42 +00:00
parent e30d68d9f0
commit 4acba49325
1 changed files with 2 additions and 1 deletions

View File

@ -614,6 +614,7 @@ public class TestDefaultClientRequestDirector extends BasicServerTestBase {
@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 TestDefaultClientRequestDirector extends BasicServerTestBase {
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