use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.
the class InsufficientlySizedExecutorHttpTest method tearDown.
@AfterEach
void tearDown() throws Exception {
CompositeCloseable closeable = newCompositeCloseable();
if (client != null) {
closeable.append(client);
}
if (server != null) {
closeable.append(server);
}
if (null != executor) {
closeable.append(executor);
}
closeable.close();
}
use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.
the class InvokingThreadsRecorder method close.
@Override
public void close() throws Exception {
CompositeCloseable compositeCloseable = newCompositeCloseable();
if (client != null) {
compositeCloseable.append(client);
}
if (context != null) {
compositeCloseable.append(context);
}
compositeCloseable.append(ioExecutor);
compositeCloseable.close();
}
use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.
the class MultiAddressUrlHttpClientTest method multipleRequestsToMultipleServers.
@Test
void multipleRequestsToMultipleServers() throws Exception {
try (CompositeCloseable closeables = newCompositeCloseable()) {
ServerContext serverCtx2 = startNewLocalServer(httpService, closeables);
String hostHeader2 = hostHeader(serverHostAndPort(serverCtx2));
ServerContext serverCtx3 = startNewLocalServer(httpService, closeables);
String hostHeader3 = hostHeader(serverHostAndPort(serverCtx3));
List<HttpResponseStatus> statuses = asList(OK, CREATED, ACCEPTED, MOVED_PERMANENTLY, SEE_OTHER, PERMANENT_REDIRECT, BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, INTERNAL_SERVER_ERROR, NOT_IMPLEMENTED, BAD_GATEWAY);
for (HttpResponseStatus status : statuses) {
makeGetRequestAndValidate(hostHeader, status);
makeGetRequestAndValidate(hostHeader2, status);
makeGetRequestAndValidate(hostHeader3, status);
}
}
}
Aggregations