Migrate testsuite-shading tests to JUnit 5 (#11323)

Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
This commit is contained in:
Riley Park 2021-05-27 06:59:36 -07:00 committed by Norman Maurer
parent 2ea670021b
commit 0ac8835e36

View File

@ -16,11 +16,12 @@
package io.netty.testsuite.shading; package io.netty.testsuite.shading;
import io.netty.util.internal.PlatformDependent; import io.netty.util.internal.PlatformDependent;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.junit.Assume;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
public class ShadingIT { public class ShadingIT {
private static final String SHADING_PREFIX = System.getProperty("shadingPrefix2"); private static final String SHADING_PREFIX = System.getProperty("shadingPrefix2");
@ -29,7 +30,7 @@ public class ShadingIT {
@Test @Test
public void testShadingNativeTransport() throws Exception { public void testShadingNativeTransport() throws Exception {
// Skip on windows. // Skip on windows.
Assume.assumeFalse(PlatformDependent.isWindows()); assumeFalse(PlatformDependent.isWindows());
String className = PlatformDependent.isOsx() ? String className = PlatformDependent.isOsx() ?
"io.netty.channel.kqueue.KQueue" : "io.netty.channel.epoll.Epoll"; "io.netty.channel.kqueue.KQueue" : "io.netty.channel.epoll.Epoll";
@ -40,7 +41,7 @@ public class ShadingIT {
@Test @Test
public void testShadingTcnative() throws Exception { public void testShadingTcnative() throws Exception {
// Skip on windows. // Skip on windows.
Assume.assumeFalse(PlatformDependent.isWindows()); assumeFalse(PlatformDependent.isWindows());
String className = "io.netty.handler.ssl.OpenSsl"; String className = "io.netty.handler.ssl.OpenSsl";
testShading0(SHADING_PREFIX, className); testShading0(SHADING_PREFIX, className);