Skip to content

Commit

Permalink
use Netty leak detector extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sullis committed Feb 23, 2024
1 parent b80595e commit 6e8673e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.github.nettyplus</groupId>
<artifactId>netty-leak-detector-junit-extension</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.asynchttpclient;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import org.asynchttpclient.test.EchoHandler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
Expand All @@ -24,12 +25,14 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.asynchttpclient.test.TestUtils.addHttpConnector;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@ExtendWith(NettyLeakDetectorExtension.class)
public abstract class AbstractBasicTest {
protected static final Logger logger = LoggerFactory.getLogger(AbstractBasicTest.class);
protected static final int TIMEOUT = 30;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
package org.asynchttpclient.netty;

import io.github.artsok.RepeatedIfExceptionsTest;
import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import org.asynchttpclient.AsyncHttpClient;
import org.asynchttpclient.DefaultAsyncHttpClient;
import org.asynchttpclient.DefaultAsyncHttpClientConfig;
import org.asynchttpclient.RequestBuilder;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -34,6 +36,7 @@

import static org.junit.jupiter.api.Assertions.assertInstanceOf;

@ExtendWith(NettyLeakDetectorExtension.class)
public class NettyConnectionResetByPeerTest {

private String resettingServerAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
*/
package org.asynchttpclient.testserver;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import org.asynchttpclient.AsyncHttpClient;
import org.asynchttpclient.AsyncHttpClientConfig;
import org.asynchttpclient.DefaultAsyncHttpClientConfig;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.asynchttpclient.Dsl.asyncHttpClient;
import static org.asynchttpclient.Dsl.config;

@ExtendWith(NettyLeakDetectorExtension.class)
public abstract class HttpTest {

protected static final String COMPLETED_EVENT = "Completed";
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.github.nettyplus</groupId>
<artifactId>netty-leak-detector-junit-extension</artifactId>
<version>0.0.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 6e8673e

Please sign in to comment.