GeezerVison is showing github.com — Use Junit5 (#748) · netty/netty-tcnative@7de1330
File tree
Expand file treeCollapse file tree
Open diff view settings
src/test/java/io/netty/internal/tcnative
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: openssl-dynamic/pom.xml +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
161 | 161 | <artifactId>netty-tcnative-classes</artifactId> |
162 | 162 | <version>${project.version}</version> |
163 | 163 | </dependency> |
| 164 | + <dependency> |
| 165 | + <groupId>org.junit.jupiter</groupId> |
| 166 | + <artifactId>junit-jupiter-api</artifactId> |
| 167 | + <version>${junit.version}</version> |
| 168 | + </dependency> |
| 169 | + <dependency> |
| 170 | + <groupId>org.junit.jupiter</groupId> |
| 171 | + <artifactId>junit-jupiter-engine</artifactId> |
| 172 | + <version>${junit.version}</version> |
| 173 | + </dependency> |
164 | 174 | </dependencies> |
165 | 175 |
|
166 | 176 | <profiles> |
|
Collapse file
Copy file name to clipboardExpand all lines: openssl-dynamic/src/test/java/io/netty/internal/tcnative/AbstractNativeTest.java +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
15 | 15 | */ |
16 | 16 | package io.netty.internal.tcnative; |
17 | 17 |
|
18 | | -import org.junit.BeforeClass; |
| 18 | + |
| 19 | +import org.junit.jupiter.api.BeforeAll; |
19 | 20 |
|
20 | 21 | import java.io.File; |
21 | 22 |
|
|
25 | 26 | */ |
26 | 27 | public abstract class AbstractNativeTest { |
27 | 28 |
|
28 | | - @BeforeClass |
| 29 | + @BeforeAll |
29 | 30 | public static void loadNativeLib() throws Exception { |
30 | 31 | String testClassesRoot = AbstractNativeTest.class.getProtectionDomain().getCodeSource().getLocation().getFile(); |
31 | 32 | File[] directories = new File(testClassesRoot + File.separator + "META-INF" + File.separator + "native") |
|
Collapse file
Copy file name to clipboardExpand all lines: openssl-dynamic/src/test/java/io/netty/internal/tcnative/CertificateVerifierTest.java +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
15 | 15 | */ |
16 | 16 | package io.netty.internal.tcnative; |
17 | 17 |
|
18 | | -import org.junit.Assert; |
19 | | -import org.junit.Test; |
| 18 | + |
| 19 | +import org.junit.jupiter.api.Test; |
20 | 20 |
|
21 | 21 | import java.lang.reflect.Field; |
22 | 22 |
|
| 23 | +import static org.junit.jupiter.api.Assertions.assertFalse; |
| 24 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
| 25 | + |
23 | 26 | public class CertificateVerifierTest extends AbstractNativeTest { |
24 | 27 |
|
25 | 28 | @Test |
@@ -28,14 +31,13 @@ public void testValidErrorCode() throws Exception { |
28 | 31 | for (Field field : fields) { |
29 | 32 | if (field.isAccessible()) { |
30 | 33 | int errorCode = field.getInt(null); |
31 | | - Assert.assertTrue( |
32 | | - "errorCode '" + errorCode + "' must be valid", CertificateVerifier.isValid(errorCode)); |
| 34 | + assertTrue(CertificateVerifier.isValid(errorCode), "errorCode '" + errorCode + "' must be valid"); |
33 | 35 | } |
34 | 36 | } |
35 | 37 | } |
36 | 38 |
|
37 | 39 | @Test |
38 | 40 | public void testNonValidErrorCode() { |
39 | | - Assert.assertFalse(CertificateVerifier.isValid(Integer.MIN_VALUE)); |
| 41 | + assertFalse(CertificateVerifier.isValid(Integer.MIN_VALUE)); |
40 | 42 | } |
41 | 43 | } |
Collapse file
Copy file name to clipboardExpand all lines: pom.xml +14-7Lines changed: 14 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
70 | 70 | <enforcer.plugin.version>1.4.1</enforcer.plugin.version> |
71 | 71 | <maven.compiler.source>1.6</maven.compiler.source> |
72 | 72 | <maven.compiler.target>1.6</maven.compiler.target> |
73 | | - <netty.build.version>30</netty.build.version> |
| 73 | + <netty.build.version>31</netty.build.version> |
| 74 | + <junit.version>5.9.0</junit.version> |
74 | 75 | <animal.sniffer.skip>true</animal.sniffer.skip> |
75 | 76 | <forceAutogen>false</forceAutogen> |
76 | 77 | <forceConfigure>false</forceConfigure> |
|
245 | 246 | <exclude>**/*TestUtil*</exclude> |
246 | 247 | </excludes> |
247 | 248 | <runOrder>random</runOrder> |
248 | | - <properties> |
249 | | - <property> |
250 | | - <name>listener</name> |
251 | | - <value>io.netty.build.junit.TimedOutTestsListener</value> |
252 | | - </property> |
253 | | - </properties> |
254 | 249 | <!-- Ensure the whole stacktrace is preserved when an exception is thrown. See https://issues.apache.org/jira/browse/SUREFIRE-1457 --> |
255 | 250 | <trimStackTrace>false</trimStackTrace> |
256 | 251 | </configuration> |
|
477 | 472 | <version>${netty.build.version}</version> |
478 | 473 | <scope>test</scope> |
479 | 474 | </dependency> |
| 475 | + <dependency> |
| 476 | + <groupId>org.junit.jupiter</groupId> |
| 477 | + <artifactId>junit-jupiter-api</artifactId> |
| 478 | + <version>${junit.version}</version> |
| 479 | + <scope>test</scope> |
| 480 | + </dependency> |
| 481 | + <dependency> |
| 482 | + <groupId>org.junit.jupiter</groupId> |
| 483 | + <artifactId>junit-jupiter-engine</artifactId> |
| 484 | + <version>${junit.version}</version> |
| 485 | + <scope>test</scope> |
| 486 | + </dependency> |
480 | 487 | </dependencies> |
481 | 488 | <profiles> |
482 | 489 | <profile> |
|