Skip to content

Commit 67d79e3

Browse files
committed
use Netty leak detector extension
1 parent 84a4e36 commit 67d79e3

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

Diff for: client/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@
9696
<scope>test</scope>
9797
</dependency>
9898

99+
<dependency>
100+
<groupId>io.github.nettyplus</groupId>
101+
<artifactId>netty-leak-detector-junit-extension</artifactId>
102+
<scope>test</scope>
103+
</dependency>
104+
99105
<dependency>
100106
<groupId>org.eclipse.jetty</groupId>
101107
<artifactId>jetty-servlet</artifactId>

Diff for: client/src/test/java/org/asynchttpclient/AbstractBasicTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.asynchttpclient;
1717

18+
import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
1819
import org.asynchttpclient.test.EchoHandler;
1920
import org.eclipse.jetty.server.Server;
2021
import org.eclipse.jetty.server.ServerConnector;
@@ -24,12 +25,14 @@
2425
import org.junit.jupiter.api.BeforeAll;
2526
import org.junit.jupiter.api.BeforeEach;
2627
import org.junit.jupiter.api.TestInstance;
28+
import org.junit.jupiter.api.extension.ExtendWith;
2729
import org.slf4j.Logger;
2830
import org.slf4j.LoggerFactory;
2931

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

3234
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
35+
@ExtendWith(NettyLeakDetectorExtension.class)
3336
public abstract class AbstractBasicTest {
3437
protected static final Logger logger = LoggerFactory.getLogger(AbstractBasicTest.class);
3538
protected static final int TIMEOUT = 30;

Diff for: client/src/test/java/org/asynchttpclient/testserver/HttpTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
*/
1616
package org.asynchttpclient.testserver;
1717

18+
import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
1819
import org.asynchttpclient.AsyncHttpClient;
1920
import org.asynchttpclient.AsyncHttpClientConfig;
2021
import org.asynchttpclient.DefaultAsyncHttpClientConfig;
22+
import org.junit.jupiter.api.extension.ExtendWith;
2123
import org.slf4j.Logger;
2224
import org.slf4j.LoggerFactory;
2325

2426
import static org.asynchttpclient.Dsl.asyncHttpClient;
2527
import static org.asynchttpclient.Dsl.config;
2628

29+
@ExtendWith(NettyLeakDetectorExtension.class)
2730
public abstract class HttpTest {
2831

2932
protected static final String COMPLETED_EVENT = "Completed";

Diff for: pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
<type>pom</type>
113113
<scope>import</scope>
114114
</dependency>
115+
<dependency>
116+
<groupId>io.github.nettyplus</groupId>
117+
<artifactId>netty-leak-detector-junit-extension</artifactId>
118+
<version>0.0.2</version>
119+
</dependency>
115120
</dependencies>
116121
</dependencyManagement>
117122

0 commit comments

Comments
 (0)