Introduced factory methods for HTTP2Client and HttpClient.

This commit is contained in:
Simone Bordet 2015-12-24 10:38:51 +01:00
parent 7598062bbb
commit 24b99d4b33
1 changed files with 14 additions and 3 deletions

View File

@ -99,7 +99,7 @@ public abstract class AbstractTest
{
QueuedThreadPool clientThreads = new QueuedThreadPool();
clientThreads.setName("client");
client = new HttpClient(provideClientTransport(transport), sslContextFactory);
client = newHttpClient(provideClientTransport(transport), sslContextFactory);
client.setExecutor(clientThreads);
client.start();
}
@ -166,8 +166,7 @@ public abstract class AbstractTest
case H2C:
case H2:
{
HTTP2Client http2Client = new HTTP2Client();
http2Client.setSelectors(1);
HTTP2Client http2Client = newHTTP2Client();
return new HttpClientTransportOverHTTP2(http2Client);
}
case FCGI:
@ -181,6 +180,18 @@ public abstract class AbstractTest
}
}
protected HttpClient newHttpClient(HttpClientTransport transport, SslContextFactory sslContextFactory)
{
return new HttpClient(transport, sslContextFactory);
}
protected HTTP2Client newHTTP2Client()
{
HTTP2Client http2Client = new HTTP2Client();
http2Client.setSelectors(1);
return http2Client;
}
protected String newURI()
{
switch (transport)