RFR: 7903934: Add support for query strings to the IntelliJ plugin

Jorn Vernee jvernee at openjdk.org
Tue Jan 21 13:15:23 UTC 2025


This patch adds support for JTReg query strings to the IntelliJ plugin. Query strings can be used to run individual test methods in JUnit and TestNG tests, and nested test classes (`@Nested`) in JUnit tests. When creating a run configuration from an element in a source file, e.g. by clicking on the little green 'play' button in the margin, the plugin will automatically compute a query string to run that element (if it knows how to).

One issue I faced when implementing this, is that the IntelliJ type API `PsiType` does not have a way to retrieve the binary name of that type, which is required to run JUnit tests that take parameters. So, I had to manually implement this. You'll see this back in the code.

I've tested this by creating and running a variety of configurations for different test methods, accepting different parameter types, as well as running `@Nested` test classes.

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

Commit messages:
 - move query string text field + tie to file selection
 - use new query string format
 - Support query string in idea plugin

Changes: https://git.openjdk.org/jtreg/pull/240/files
  Webrev: https://webrevs.openjdk.org/?repo=jtreg&pr=240&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903934
  Stats: 165 lines in 6 files changed: 138 ins; 9 del; 18 mod
  Patch: https://git.openjdk.org/jtreg/pull/240.diff
  Fetch: git fetch https://git.openjdk.org/jtreg.git pull/240/head:pull/240

PR: https://git.openjdk.org/jtreg/pull/240


More information about the jtreg-dev mailing list