Updated test to run even when not connected to the network.

This commit is contained in:
Simone Bordet 2015-08-30 17:46:23 +02:00
parent 6fad345161
commit 7211d415f9
1 changed files with 9 additions and 2 deletions

View File

@ -881,9 +881,16 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@Test
public void testConnectHostWithMultipleAddresses() throws Exception
{
// Likely that the DNS for google.com returns multiple addresses.
String host = "google.com";
Assume.assumeTrue(InetAddress.getAllByName(host).length > 1);
try
{
// Likely that the DNS for google.com returns multiple addresses.
Assume.assumeTrue(InetAddress.getAllByName(host).length > 1);
}
catch (Throwable x)
{
Assume.assumeNoException(x);
}
startClient();
client.setFollowRedirects(false); // Avoid redirects from 80 to 443.