Skip to content

Commit

Permalink
replace usages of ByteBufferPool.Accumulator with RetainableByteBuffe…
Browse files Browse the repository at this point in the history
…r.DynamicCapacity

Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Jun 20, 2024
1 parent d6dc39a commit db00da7
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.eclipse.jetty.http3.client.transport.ClientConnectionFactoryOverHTTP3;
import org.eclipse.jetty.http3.server.HTTP3ServerConnectionFactory;
import org.eclipse.jetty.http3.server.RawHTTP3ServerConnectionFactory;
import org.eclipse.jetty.io.ArrayByteBufferPool;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.jmx.MBeanContainer;
import org.eclipse.jetty.quic.client.ClientQuicConfiguration;
Expand All @@ -49,9 +48,6 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

@ExtendWith(WorkDirExtension.class)
public class AbstractClientServerTest
{
Expand All @@ -61,7 +57,6 @@ public class AbstractClientServerTest
public final BeforeTestExecutionCallback printMethodName = context ->
System.err.printf("Running %s.%s() %s%n", context.getRequiredTestClass().getSimpleName(), context.getRequiredTestMethod().getName(), context.getDisplayName());
protected Server server;
protected ArrayByteBufferPool.Tracking serverBufferPool;
protected QuicServerConnector connector;
protected HTTP3Client http3Client;
protected HttpClient httpClient;
Expand Down Expand Up @@ -100,8 +95,7 @@ private void prepareServer(ServerQuicConfiguration quicConfiguration, Connection
{
QueuedThreadPool serverThreads = new QueuedThreadPool();
serverThreads.setName("server");
serverBufferPool = new ArrayByteBufferPool.Tracking();
server = new Server(serverThreads, null, serverBufferPool);
server = new Server(serverThreads);
connector = new QuicServerConnector(server, quicConfiguration, serverConnectionFactory);
server.addConnector(connector);
MBeanContainer mbeanContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
Expand Down Expand Up @@ -150,15 +144,8 @@ protected MetaData.Request newRequest(HttpMethod method, String path, HttpFields
@AfterEach
public void dispose()
{
try
{
assertThat("Server leaks: " + serverBufferPool.dumpLeaks(), serverBufferPool.getLeaks().size(), is(0));
}
finally
{
LifeCycle.stop(http3Client);
LifeCycle.stop(httpClient);
LifeCycle.stop(server);
}
LifeCycle.stop(http3Client);
LifeCycle.stop(httpClient);
LifeCycle.stop(server);
}
}

0 comments on commit db00da7

Please sign in to comment.