Skip to content

Conversation

@wenytang-ms
Copy link
Contributor

@wenytang-ms wenytang-ms commented Dec 3, 2025

This is just the initial version that supports JUnit 6, and compatibility is not being considered for now.
test against with redhat/vscode-java 1.51.2025120208
https://github.com/junit-team/junit-examples/tree/main/junit-jupiter-starter-maven
https://github.com/microsoft/vscode-java-test/tree/main/test/test-projects/junit

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds JUnit 6 support to the Java test runner extension, extending the framework to handle the next major version of JUnit Jupiter. The implementation follows the existing JUnit 5 pattern by adding a new TestKind enum value and implementing corresponding searcher and finder classes.

Key Changes:

  • Added JUnit6 enum value to TestKind across TypeScript and Java codebases
  • Implemented JUnit6TestSearcher and JUnit6TestFinder classes for test detection
  • Updated conditional logic throughout to handle JUnit 6 alongside JUnit 5
  • Updated dependencies to include JUnit 6 artifacts (versions 6.0.1) and upgraded JUnit 5 to 5.14.x
  • Modified build scripts to support multiple JUnit versions and updated Eclipse platform target

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/java-test-runner.api.ts Added JUnit6 enum value (3) to TestKind
src/utils/launchUtils.ts Extended tag parsing condition to include JUnit6
src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts Added JUnit6 runner package filter and extended display name logic for JUnit6
src/controller/testController.ts Added JUnit6 case to runner selection and test framework version tracking; minor whitespace fix
scripts/buildJdtlsExt.js Updated bundle list with JUnit6 runtime and refactored updateVersion() to rebuild from actual server folder contents
package.json Added JUnit 6 dependencies (6.0.1) and upgraded JUnit 5 to 5.14.1 and platform to 1.14.1
java-extension/.../com.microsoft.java.test.tp.target Updated Eclipse repository URLs to 4.38-I-builds and 2025-12 release
java-extension/.../JUnit6TestSearcher.java New test searcher implementation for JUnit 6 using JUNIT_PLATFORM_TESTABLE annotation
java-extension/.../JUnit6TestFinder.java New test finder implementation with JUnit 6 loader support
java-extension/.../TestFrameworkUtils.java Added JUNIT6_TEST_SEARCHER constant and case in getSearcherByTestKind()
java-extension/.../TestGenerationUtils.java Extended lifecycle annotations handling to include JUnit6
java-extension/.../TestKindProvider.java Added JUnit6 detection using CoreTestSearchEngine.hasJUnit6TestAnnotation()
java-extension/.../TestKind.java Added JUnit6(3) enum value with fromString() and toString() support; formatting improvements
java-extension/.../JUnitLaunchUtils.java Added JUNIT6_LOADER constant and case in getEclipseTestKind()
java-extension/.../JUnitLaunchConfigurationTemplate.java Added projectName attribute to launch configuration template
java-extension/.../JUnitLaunchConfigurationDelegate.java Extended parameter handling condition to include JUnit6
java-extension/.../JUnitLaunchConfiguration.java Added projectName to value map
java-extension/.../META-INF/MANIFEST.MF Added JUnit 6 bundle dependencies and upgraded JUnit 5 versions; includes both 5.14.x and 6.0.1 versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wenytang-ms wenytang-ms changed the title feat: junit 6 feat: junit 6 support Dec 4, 2025
* to properly detect tests in JUnit 6 projects.
*
* <p><b>Why this class exists:</b> Eclipse JDT does not yet have built-in support for JUnit 6.
* This is a custom implementation that will be needed until Eclipse JDT adds official JUnit 6 support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still expect JDT to support JUNIT 6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, there also some issue or PR list for jdtls

I think they should officially support, but currently the junit 6 is still not ready, so I think in java-test, implement such a finder for junit 6.

@wenytang-ms wenytang-ms merged commit a4f782c into main Dec 4, 2025
4 checks passed
@wenytang-ms wenytang-ms deleted the wenyt/dd1 branch December 4, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants