RFR: 8301767: Convert virtual thread tests to JUnit

Alan Bateman alanb at openjdk.org
Tue Feb 7 07:13:40 UTC 2023


The non-hotspot tests integrated with JEP 425/428 were mostly TestNG tests. We'd like to convert these JUnit in the main line in advance of other updates to these tests in 21.  The changes are mostly mechanical and trivial:

- BeforeClass/AfterClass changed to static BeforeAll/AfterAll methods
- Tests using data providers are changed to parameterized tests
- The order of the parameters to assertEquals are swapped so that the expected result is the first parameter
- Usages of expectThrows are changed to assertThrows
- Tests that threw SkipException are changed to the Assumptions API

There are a small number of drive-by changes to the tests, nothing significant, e.g.

- GetStackTrace and ParkWithFixedThreadPool changed from "@run testng" to "@run main" as they aren't TestNG tests.
- A few of the tests in StructuredTaskScopeTest for joinXXX are changed to use a CountDownLatch rather than sleeping, as the original tests weren't very robust.

-------------

Commit messages:
 - Fix typos in comments
 - GetStackTrace.java test missing @requires vm.continuations
 - Initial commit

Changes: https://git.openjdk.org/jdk/pull/12426/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12426&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8301767
  Stats: 1416 lines in 34 files changed: 205 ins; 79 del; 1132 mod
  Patch: https://git.openjdk.org/jdk/pull/12426.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12426/head:pull/12426

PR: https://git.openjdk.org/jdk/pull/12426


More information about the serviceability-dev mailing list