fix: add module opens for all selected test classes#1884
Closed
wenytang-ms wants to merge 2 commits into
Closed
Conversation
Pass selected class JDT handles to the launch delegate so Eclipse JDT can generate VM arguments for every test package without rediscovering the project. Fixes #1883 Copilot-Session: c3cd113b-dad4-4d4d-90c2-60abfd204405
Contributor
Author
There was a problem hiding this comment.
Pull request overview
This PR addresses JPMS modular-project failures in multi-class JUnit launches by ensuring the upstream JDT delegate can evaluate the full selected test set (not just the first “main type”), so it generates complete --add-opens VM arguments for all involved packages.
Changes:
- Pass JDT handle identifiers for multi-class (class-level) JUnit selections from the TypeScript client to the Java extension.
- Override JDT’s
evaluateTeststo resolve all selectedITypes from handles before VM args are computed, enabling complete--add-opensgeneration. - Add a regression test project + test case covering multi-package modular JUnit selection behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/utils/launchUtils.ts | Adds testHandles (JDT handles) to the resolve-JUnit-arguments request for multi-class class-level runs. |
| java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/launchers/JUnitLaunchUtils.java | Extends the argument payload model to accept testHandles. |
| java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/launchers/JUnitLaunchConfigurationDelegate.java | Overrides evaluateTests to resolve all selected ITypes from handles so JDT can emit --add-opens for each selected package. |
| java-extension/com.microsoft.java.test.plugin.test/src/com/microsoft/java/test/plugin/launchers/JUnitLaunchConfigurationDelegateTest.java | Adds regression test asserting --add-opens is present for multiple packages in a modular project. |
| java-extension/com.microsoft.java.test.plugin.test/projects/modular-junit/src/test/java/p1/FirstTest.java | Adds first test class in package p1 for modular regression coverage. |
| java-extension/com.microsoft.java.test.plugin.test/projects/modular-junit/src/test/java/p2/SecondTest.java | Adds second test class in package p2 for modular regression coverage. |
| java-extension/com.microsoft.java.test.plugin.test/projects/modular-junit/src/main/java/module-info.java | Declares a JPMS module to trigger modular launch behavior in tests. |
| java-extension/com.microsoft.java.test.plugin.test/projects/modular-junit/.project | Eclipse project metadata for importing the new modular regression project. |
| java-extension/com.microsoft.java.test.plugin.test/projects/modular-junit/.classpath | Classpath metadata (JRE + JUnit 5) for the modular regression project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot-Session: c3cd113b-dad4-4d4d-90c2-60abfd204405
chagong
approved these changes
Jul 13, 2026
Contributor
Author
|
Superseded by #1885 to retrigger the missing license/CLA policy check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
--add-opensfor every packageTesting
npm testmvn -f java-extension\pom.xml -pl com.microsoft.java.test.target,com.microsoft.java.test.plugin,com.microsoft.java.test.plugin.test -am verifyFixes #1883