Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Netty leak detector extension #1932

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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