Merged branch 'jetty-9.4.x' into 'master'.

This commit is contained in:
Simone Bordet 2016-09-26 15:05:02 +02:00
commit e01686e44d
1 changed files with 14 additions and 1 deletions

View File

@ -811,10 +811,23 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@Test
public void testConnectThrowsUnknownHostException() throws Exception
{
String host = "idontexist";
int port = 80;
try
{
Socket socket = new Socket();
socket.connect(new InetSocketAddress(host, port), 1000);
Assume.assumeTrue("Host must not be resolvable", false);
}
catch (IOException ignored)
{
}
start(new EmptyServerHandler());
final CountDownLatch latch = new CountDownLatch(1);
client.newRequest("idontexist", 80)
client.newRequest(host, port)
.send(result ->
{
Assert.assertTrue(result.isFailed());