RFR: 7903930: Support running individual parameterized tests and @Nested test classes [v2]
Jorn Vernee
jvernee at openjdk.org
Tue Jan 14 16:28:20 UTC 2025
> See the JBS issue for an extended problem description.
>
> This PR adds support for running individual parameterized JUnit test methods, as well as nested test classes, by extending the format that a query string can have. The new proposed format is as follows:
>
>
> <class name>[::<method name>([<param type>[...,<param type>]])]
>
>
> For example, running a method `foo` that takes no parameters would be done using `<test name>?TestClass::foo()`. If `foo` has parameters, then at least for JUnit tests they have to be specified as a comma separated list of binary names between the parentheses. For example:
>
>
> TestDowncallScope::testDowncall(int,java.lang.String,CallGeneratorHelper$Ret,java.util.List,java.util.List)
>
>
> The delimiting characters I choose here `::` and `(...)` have to be quoted when passed through most shells. If this is deemed to be an issue, we could also change the separators for class name/method name/parameters to simple hyphens. Although, in cases where a `$` sign appears in the binary name of a nested class, quoting would be needed either way. (I would personally choose to always quote the argument, just to be sure, so I don't mind using `::` and `(...)`).
>
> This support is intended to be used by the intellij plugin to support running individual methods and nested classes (see https://github.com/openjdk/jtreg/pull/240).
>
> Testing: I've added additional tests for the new cases (as far as I know, TestNG does not support nested test classes though). I've also been using a PoC of this feature as the basis for similar support in the intellij plugin that I'm working on.
Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
update FAQ
-------------
Changes:
- all: https://git.openjdk.org/jtreg/pull/241/files
- new: https://git.openjdk.org/jtreg/pull/241/files/6149386a..54d91bde
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jtreg&pr=241&range=01
- incr: https://webrevs.openjdk.org/?repo=jtreg&pr=241&range=00-01
Stats: 18 lines in 1 file changed: 12 ins; 0 del; 6 mod
Patch: https://git.openjdk.org/jtreg/pull/241.diff
Fetch: git fetch https://git.openjdk.org/jtreg.git pull/241/head:pull/241
PR: https://git.openjdk.org/jtreg/pull/241
More information about the jtreg-dev
mailing list