Skip to content

Replace JUnit 5 with JUnit 6#3560

Merged
cdietrich merged 9 commits intoeclipse-xtext:mainfrom
trancexpress:gh3552
Mar 19, 2026
Merged

Replace JUnit 5 with JUnit 6#3560
cdietrich merged 9 commits intoeclipse-xtext:mainfrom
trancexpress:gh3552

Conversation

@trancexpress
Copy link
Copy Markdown
Contributor

See: #3552

@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Nov 19, 2025

There is a surprising number of JUnit 5 mentions, including even a quick fix action for adding JUnit 5 to the classpath... Probably for xtend...

This PR so far doesn't touch any of those.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 19, 2025

Test Results

  8 076 files  + 4    8 076 suites  +4   3h 40m 16s ⏱️ - 28m 36s
 43 241 tests ± 0   42 651 ✅  -  5    584 💤 ±0  6 ❌ +5 
212 508 runs  +23  209 581 ✅ +15  2 921 💤 +3  6 ❌ +5 

For more details on these failures, see this check.

Results for commit 84f8e29. ± Comparison against base commit 088392b.

This pull request removes 17 and adds 17 tests. Note that renamed tests count towards both.
org.eclipse.xtend.ide.tests.buildpath.JunitLibClasspathAdderTest ‑ addJUnit5LibToPluginProjectClasspath
org.eclipse.xtend.ide.tests.buildpath.JunitLibClasspathAdderTest ‑ addJUnit5LibToProjectClasspath
org.eclipse.xtend.ide.tests.quickfix.AddJunitLibToClasspathQuickfixTest ‑ addJUnit5LibToPluginProjectClasspath
org.eclipse.xtend.ide.tests.quickfix.AddJunitLibToClasspathQuickfixTest ‑ addJUnit5LibToProjectClasspath
org.eclipse.xtext.testing.tests.junit5.ComposedInjectAnnotationTest ‑ didUseComposedInjectAnnotation
org.eclipse.xtext.testing.tests.junit5.InjectionExtensionNested2Test ‑ outerTest
org.eclipse.xtext.testing.tests.junit5.InjectionExtensionNested2Test$NestedClass ‑ innerTest
org.eclipse.xtext.testing.tests.junit5.InjectionExtensionNested3Test ‑ outerTest
org.eclipse.xtext.testing.tests.junit5.InjectionExtensionNested3Test$NestedClass ‑ innerTest
org.eclipse.xtext.testing.tests.junit5.InjectionExtensionNestedTest ‑ outerTest
…
org.eclipse.xtend.ide.tests.buildpath.JunitLibClasspathAdderTest ‑ addJUnit6LibToPluginProjectClasspath
org.eclipse.xtend.ide.tests.buildpath.JunitLibClasspathAdderTest ‑ addJUnit6LibToProjectClasspath
org.eclipse.xtend.ide.tests.quickfix.AddJunitLibToClasspathQuickfixTest ‑ addJUnit6LibToPluginProjectClasspath
org.eclipse.xtend.ide.tests.quickfix.AddJunitLibToClasspathQuickfixTest ‑ addJUnit6LibToProjectClasspath
org.eclipse.xtext.testing.tests.junit6.ComposedInjectAnnotationTest ‑ didUseComposedInjectAnnotation
org.eclipse.xtext.testing.tests.junit6.InjectionExtensionNested2Test ‑ outerTest
org.eclipse.xtext.testing.tests.junit6.InjectionExtensionNested2Test$NestedClass ‑ innerTest
org.eclipse.xtext.testing.tests.junit6.InjectionExtensionNested3Test ‑ outerTest
org.eclipse.xtext.testing.tests.junit6.InjectionExtensionNested3Test$NestedClass ‑ innerTest
org.eclipse.xtext.testing.tests.junit6.InjectionExtensionNestedTest ‑ outerTest
…

♻️ This comment has been updated with latest results.

@trancexpress trancexpress force-pushed the gh3552 branch 2 times, most recently from 2c93f7a to ad11eb8 Compare November 19, 2025 16:50
@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Nov 19, 2025

Running ./full-build.sh --tp=latest locally results in:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.13:test (default-test) on project org.eclipse.xtext.junit5.tests: No tests found -> [Help 1]

Fully summary:

[INFO] Reactor Summary:
[INFO] 
[INFO] Xtext Parent POM 2.41.0-SNAPSHOT ................... SUCCESS [  0.301 s]
[INFO] org.eclipse.xtext.nodeploy.parent 2.41.0-SNAPSHOT .. SUCCESS [  0.009 s]
[INFO] Xtext Feature Parent 2.41.0-SNAPSHOT ............... SUCCESS [  0.013 s]
[INFO] Eclipse Xtext Developer BOM 2.41.0-SNAPSHOT ........ SUCCESS [  0.041 s]
[INFO] Eclipse Xbase Runtime Library 2.41.0-SNAPSHOT ...... SUCCESS [ 42.603 s]
[INFO] Eclipse Xtend Active Annotations Library 2.41.0-SNAPSHOT SUCCESS [  0.641 s]
[INFO] Eclipse Xtend Runtime Library 2.41.0-SNAPSHOT ...... SUCCESS [  9.411 s]
[INFO] Xtext Utilities 2.41.0-SNAPSHOT .................... SUCCESS [  9.671 s]
[INFO] Xtext Runtime Bundle 2.41.0-SNAPSHOT ............... SUCCESS [ 42.108 s]
[INFO] Common Types Runtime Library 2.41.0-SNAPSHOT ....... SUCCESS [  4.266 s]
[INFO] Xtext Ecore Support 2.41.0-SNAPSHOT ................ SUCCESS [  0.275 s]
[INFO] Xtext Generator 2.41.0-SNAPSHOT .................... SUCCESS [ 12.618 s]
[INFO] Xbase Model 2.41.0-SNAPSHOT ........................ SUCCESS [ 11.470 s]
[INFO] org.eclipse.xtext.web.example.entities 2.41.0-SNAPSHOT SUCCESS [  6.884 s]
[INFO] org.eclipse.xtext.web.example.statemachine 2.41.0-SNAPSHOT SUCCESS [  0.618 s]
[INFO] Xtext IDE Library 2.41.0-SNAPSHOT .................. SUCCESS [  7.316 s]
[INFO] Xtext Testing Library 2.41.0-SNAPSHOT .............. SUCCESS [  9.310 s]
[INFO] Xbase Testing Library 2.41.0-SNAPSHOT .............. SUCCESS [  0.945 s]
[INFO] Xtext Generator Dependencies 2.41.0-SNAPSHOT ....... SUCCESS [  2.886 s]
[INFO] Xtext JSR-45 Smap Installer 2.41.0-SNAPSHOT ........ SUCCESS [  0.358 s]
[INFO] Xtend Core Library 2.41.0-SNAPSHOT ................. SUCCESS [  8.016 s]
[INFO] Bootstrap project for the Xtext language 2.41.0-SNAPSHOT SUCCESS [  0.336 s]
[INFO] Pure Xbase Runtime 2.41.0-SNAPSHOT ................. SUCCESS [  1.189 s]
[INFO] org.eclipse.xtext.ui.codetemplates 2.41.0-SNAPSHOT . SUCCESS [  0.722 s]
[INFO] Xtext Release Engineering Utilities 2.41.0-SNAPSHOT  SUCCESS [  6.734 s]
[INFO] Eclipse Xbase GWT Library 2.41.0-SNAPSHOT .......... SUCCESS [  5.509 s]
[INFO] Eclipse Xtend GWT Library 2.41.0-SNAPSHOT .......... SUCCESS [  0.349 s]
[INFO] Xbase Library Feature 2.41.0-SNAPSHOT .............. SUCCESS [  0.157 s]
[INFO] Tests for Eclipse Xbase Runtime Library 2.41.0-SNAPSHOT SUCCESS [  4.537 s]
[INFO] Xtend Library Feature 2.41.0-SNAPSHOT .............. SUCCESS [  0.128 s]
[INFO] Tests for Eclipse Xtend Runtime Library 2.41.0-SNAPSHOT SUCCESS [  0.650 s]
[INFO] Xtend GWT lib test 2.41.0-SNAPSHOT ................. SUCCESS [ 32.062 s]
[INFO] Xtext Language IDE Support 2.41.0-SNAPSHOT ......... SUCCESS [  0.429 s]
[INFO] Xtext Wizard 2.41.0-SNAPSHOT ....................... SUCCESS [  3.714 s]
[INFO] Common Xtext Testlanguages - Runtime 2.41.0-SNAPSHOT SUCCESS [  2.232 s]
[INFO] Tests for Xtext Testing Library 2.41.0-SNAPSHOT .... SUCCESS [ 19.296 s]
[INFO] Junit 5 Tests for Xtext Testing Library 2.41.0-SNAPSHOT SUCCESS [  1.795 s]
[INFO] Xtext Core Runtime Tests 2.41.0-SNAPSHOT ........... SUCCESS [01:49 min]
[INFO] Common Xtext Testlanguages - IDE Features 2.41.0-SNAPSHOT SUCCESS [  1.776 s]
[INFO] Xtext IDE Tests 2.41.0-SNAPSHOT .................... SUCCESS [ 22.079 s]
[INFO] Xtext Core Runtime JUnit5 Tests 2.41.0-SNAPSHOT .... FAILURE [  7.225 s]
[INFO] Xbase Generic IDE Services 2.41.0-SNAPSHOT ......... SUCCESS [  0.935 s]
[INFO] Xtext Standalone Builder 2.41.0-SNAPSHOT ........... SUCCESS [  0.464 s]
[INFO] Xtext JDT Facade 2.41.0-SNAPSHOT ................... SUCCESS [  0.236 s]
[INFO] Xtext Java Language 2.41.0-SNAPSHOT ................ SUCCESS [  0.350 s]
[INFO] Pure Xbase Generic Ide 2.41.0-SNAPSHOT ............. SUCCESS [  0.582 s]
[INFO] Xbase Test Languages 2.41.0-SNAPSHOT ............... SUCCESS [  1.385 s]
[INFO] Xbase Test Languages Generic IDE Services 2.41.0-SNAPSHOT SUCCESS [  1.207 s]
[INFO] Xbase Test Data 2.41.0-SNAPSHOT .................... SUCCESS [  0.913 s]
[INFO] Pure Xbase Runtime Tests 2.41.0-SNAPSHOT ........... SUCCESS [ 22.276 s]
[INFO] Xtext Eclipse tests plugins parent 2.41.0-SNAPSHOT . SUCCESS [  0.003 s]
[INFO] org.eclipse.xtext.common.types.edit 2.41.0-SNAPSHOT  SUCCESS [  2.152 s]
[INFO] org.eclipse.xtext.ui 2.41.0-SNAPSHOT ............... SUCCESS [ 18.266 s]
[INFO] org.eclipse.xtext.common.types.ui 2.41.0-SNAPSHOT .. SUCCESS [  0.880 s]
[INFO] org.eclipse.xtext.builder 2.41.0-SNAPSHOT .......... SUCCESS [  2.607 s]
[INFO] org.eclipse.xtext.ui.shared 2.41.0-SNAPSHOT ........ SUCCESS [  0.595 s]
[INFO] org.eclipse.xtext.ui.codetemplates.ide 2.41.0-SNAPSHOT SUCCESS [  0.377 s]
[INFO] org.eclipse.xtext.ui.codetemplates.ui 2.41.0-SNAPSHOT SUCCESS [  0.713 s]
[INFO] org.eclipse.xtext.common.types.shared 2.41.0-SNAPSHOT SUCCESS [  0.459 s]
[INFO] org.eclipse.xtext.xbase.ui 2.41.0-SNAPSHOT ......... SUCCESS [ 20.791 s]
[INFO] org.eclipse.xtext.ui.testing 2.41.0-SNAPSHOT ....... SUCCESS [  0.665 s]
[INFO] org.eclipse.xtext.xbase.ui.testing 2.41.0-SNAPSHOT . SUCCESS [  0.453 s]
[INFO] org.eclipse.xtext.logging 2.41.0-SNAPSHOT .......... SUCCESS [  0.139 s]
[INFO] org.eclipse.xtext.purexbase.ui 2.41.0-SNAPSHOT ..... SUCCESS [  0.571 s]
[INFO] org.eclipse.xtext.purexbase.eclipse.tests 2.41.0-SNAPSHOT SUCCESS [01:08 min]
[INFO] Xtext Xbase Tests 2.41.0-SNAPSHOT .................. SUCCESS [03:57 min]
[INFO] Xtext Java Language Tests 2.41.0-SNAPSHOT .......... SUCCESS [ 12.728 s]
[INFO] Xtext Extras Tests 2.41.0-SNAPSHOT ................. SUCCESS [  4.725 s]
[INFO] Xtext Standalone Builder Tests 2.41.0-SNAPSHOT ..... SUCCESS [  8.602 s]
[INFO] Common Types Runtime Library Tests 2.41.0-SNAPSHOT . SUCCESS [02:23 min]
[INFO] org.eclipse.xtext.activities 2.41.0-SNAPSHOT ....... SUCCESS [  0.146 s]
[INFO] org.eclipse.xtext.buildship 2.41.0-SNAPSHOT ........ SUCCESS [  2.506 s]
[INFO] org.eclipse.xtext.ui.codemining 2.41.0-SNAPSHOT .... SUCCESS [  0.323 s]
[INFO] org.eclipse.xtext.common.types.eclipse.tests 2.41.0-SNAPSHOT SUCCESS [02:21 min]
[INFO] org.eclipse.xtext.common.types.shared.jdt38 2.41.0-SNAPSHOT SUCCESS [  0.511 s]
[INFO] org.eclipse.xtext.m2e 2.41.0-SNAPSHOT .............. SUCCESS [  2.751 s]
[INFO] org.eclipse.xtext.ui.ecore 2.41.0-SNAPSHOT ......... SUCCESS [  0.387 s]
[INFO] org.eclipse.xtext.xtext.ui 2.41.0-SNAPSHOT ......... SUCCESS [  0.948 s]
[INFO] org.eclipse.xtext.xtext.ui.graph 2.41.0-SNAPSHOT ... SUCCESS [  1.970 s]
[INFO] org.eclipse.xtext.doc 2.41.0-SNAPSHOT .............. SUCCESS [  0.311 s]
[INFO] org.eclipse.xtext.xtext.ui.examples 2.41.0-SNAPSHOT  SUCCESS [  0.565 s]
[INFO] org.eclipse.xtext.testlanguages.ui 2.41.0-SNAPSHOT . SUCCESS [  0.744 s]
[INFO] org.eclipse.xtext.builder.tests 2.41.0-SNAPSHOT .... SUCCESS [ 59.605 s]
[INFO] org.eclipse.xtext.ui.codetemplates.tests 2.41.0-SNAPSHOT SUCCESS [  7.998 s]
[INFO] org.eclipse.xtext.eclipse.tests 2.41.0-SNAPSHOT .... SUCCESS [  6.760 s]
[INFO] org.eclipse.xtext.ui.tests 2.41.0-SNAPSHOT ......... SUCCESS [02:27 min]
[INFO] org.eclipse.xtext.xbase.testlanguages.ui 2.41.0-SNAPSHOT SUCCESS [  0.688 s]
[INFO] org.eclipse.xtext.xbase.ui.tests 2.41.0-SNAPSHOT ... SUCCESS [07:56 min]
[INFO] org.eclipse.xtext.xtext.ui.graph.tests 2.41.0-SNAPSHOT SUCCESS [  8.155 s]
[INFO] org.eclipse.xtext.xtext.ui.tests 2.41.0-SNAPSHOT ... SUCCESS [ 43.200 s]
[INFO] org.eclipse.xtext.web.example.statemachine.ide 2.41.0-SNAPSHOT SUCCESS [  0.604 s]
[INFO] Xtext Web API 2.41.0-SNAPSHOT ...................... SUCCESS [ 18.398 s]
[INFO] org.eclipse.xtext.web.example.entities.ide 2.41.0-SNAPSHOT SUCCESS [  0.928 s]
[INFO] Xbase Web Integration 2.41.0-SNAPSHOT .............. SUCCESS [  6.749 s]
[INFO] Xtext Servlet 2.41.0-SNAPSHOT ...................... SUCCESS [  1.648 s]
[INFO] org.eclipse.xtext.web.example.jetty 2.41.0-SNAPSHOT  SUCCESS [ 19.227 s]
[INFO] Xtext Maven Plugin Parent POM 2.41.0-SNAPSHOT ...... SUCCESS [  2.256 s]
[INFO] Xtext Maven Plugin 2.41.0-SNAPSHOT ................. SUCCESS [04:40 min]
[INFO] Xtend Maven Plugin Parent POM 2.41.0-SNAPSHOT ...... SUCCESS [  0.008 s]
[INFO] Xtend IDE Common 2.41.0-SNAPSHOT ................... SUCCESS [  3.952 s]
[INFO] Xtend Maven Plugin 2.41.0-SNAPSHOT ................. SUCCESS [02:51 min]
[INFO] Xtend Archetype 2.41.0-SNAPSHOT .................... SUCCESS [ 17.407 s]
[INFO] org.eclipse.xtend.tycho.tests.parent 2.41.0-SNAPSHOT SUCCESS [  0.004 s]
[INFO] Xtend IDE 2.41.0-SNAPSHOT .......................... SUCCESS [  5.646 s]
[INFO] org.eclipse.xtend.ide.tests.data 2.41.0-SNAPSHOT ... SUCCESS [  0.252 s]
[INFO] Xtend Documentation 2.41.0-SNAPSHOT ................ SUCCESS [  0.133 s]
[INFO] Xtend Examples 2.41.0-SNAPSHOT ..................... SUCCESS [  0.349 s]
[INFO] org.eclipse.xtend.m2e 2.41.0-SNAPSHOT .............. SUCCESS [  0.535 s]
[INFO] org.eclipse.xtend.standalone 2.41.0-SNAPSHOT ....... SUCCESS [  0.147 s]
[INFO] Xtend Core Library Tests 2.41.0-SNAPSHOT ........... SUCCESS [02:30 min]
[INFO] org.eclipse.xtend.ide.tests 2.41.0-SNAPSHOT ........ SUCCESS [10:37 min]
[INFO] Xtend Performance Tests 2.41.0-SNAPSHOT ............ SUCCESS [01:40 min]
[INFO] org.eclipse.xtend.swtbot 2.41.0-SNAPSHOT ........... SUCCESS [  3.285 s]
[INFO] org.eclipse.xtend.ide.swtbot.tests 2.41.0-SNAPSHOT . SUCCESS [ 14.889 s]
[INFO] org.eclipse.xtext.docs 2.41.0-SNAPSHOT ............. SUCCESS [  0.086 s]
[INFO] org.eclipse.xtext.runtime 2.41.0-SNAPSHOT .......... SUCCESS [  0.180 s]
[INFO] org.eclipse.xtext.ui 2.41.0-SNAPSHOT ............... SUCCESS [  0.268 s]
[INFO] org.eclipse.xtext.examples 2.41.0-SNAPSHOT ......... SUCCESS [  0.204 s]
[INFO] Xbase Feature 2.41.0-SNAPSHOT ...................... SUCCESS [  0.213 s]
[INFO] org.eclipse.xtext.redist 2.41.0-SNAPSHOT ........... SUCCESS [  0.263 s]
[INFO] org.eclipse.xtext.xtext.ui.graph 2.41.0-SNAPSHOT ... SUCCESS [  0.155 s]
[INFO] org.eclipse.xtext.xtext.ui 2.41.0-SNAPSHOT ......... SUCCESS [  0.285 s]
[INFO] org.eclipse.emf.mwe2.language.sdk 2.24.0.v20250823-0643 SUCCESS [  0.059 s]
[INFO] org.eclipse.xtend.sdk 2.41.0-SNAPSHOT .............. SUCCESS [  0.273 s]
[INFO] org.eclipse.xtext.sdk 2.41.0-SNAPSHOT .............. SUCCESS [  0.406 s]
[INFO] org.eclipse.xtext.p2repository 2.41.0-SNAPSHOT ..... SUCCESS [  3.647 s]
[INFO] org.eclipse.xtext.full.releng 1.0.0-SNAPSHOT ....... SUCCESS [  0.027 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  54:54 min
[INFO] Finished at: 2025-11-19T18:49:37+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.13:test (default-test) on project org.eclipse.xtext.junit5.tests: No tests found -> [Help 1]

At least in JDT/PDE, this was usually an indicator of mixing JUnit 5 and 6 at runtime. It might be something else here. Such as JUnit 4 tests...

Trying this:

➜  org.eclipse.xtext.junit5.tests git:(gh3552) ✗ git diff
diff --git a/org.eclipse.xtext.junit5.tests/pom.xml b/org.eclipse.xtext.junit5.tests/pom.xml
index e469288647..067afd86f5 100644
--- a/org.eclipse.xtext.junit5.tests/pom.xml
+++ b/org.eclipse.xtext.junit5.tests/pom.xml
@@ -26,7 +26,7 @@
                                <groupId>org.eclipse.tycho</groupId>
                                <artifactId>tycho-surefire-plugin</artifactId>
                                <configuration>
-                                       <providerHint>junit5</providerHint>
+                                       <providerHint>junit6</providerHint>
                                </configuration>
                        </plugin>
                </plugins>

Results in:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.13:test (default-test) on project org.eclipse.xtext.junit5.tests: Could not find test framework provider with role hint 'junit6'. Available providers: [junit59withvintage, junit4, junit5, junit56, junit55, junit54, junit59, junit58, junit512withvintage, junit57, junit47, testng, junit512, junit3, junit57withvintage, junit58withvintage] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@cdietrich
Copy link
Copy Markdown
Contributor

maybe this is a way too old tycho?

@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Nov 19, 2025

maybe this is a way too old tycho?

Should I try updating to tycho 5.0 (in a separate PR)?

@cdietrich
Copy link
Copy Markdown
Contributor

cdietrich commented Nov 20, 2025

see #3509
see also https://github.com/eclipse-xtext/xtext/tree/cd_tycho50
but its complicated, cause java 21. implications on wizard etc unclear
see also #3546

we had a brief discussion to look into that someone after the current release
but as said i currently have zero capacity

(building milestones and releases is actually already beyond my cappa)

@cdietrich
Copy link
Copy Markdown
Contributor

the problem with tycho 5 is
we need a solution how to deal with it in

  • wizard
  • domain model example

what happens if use selects java 17 in wizard? should we have a fallback to old version.

this also affecs junit 5/6 what should we offer the user.

@cdietrich
Copy link
Copy Markdown
Contributor

can you also check Jenkinsfile

@trancexpress
Copy link
Copy Markdown
Contributor Author

With maven 3.9.9 and tycho 5.0.0, there is only one error:

[INFO] Xtend Archetype 2.41.0-SNAPSHOT .................... FAILURE [  1.901 s]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-invoker-plugin:3.5.0:install (install dependencies in local test repo) on project xtend-archetype: The following artifacts could not be resolved: p2.eclipse.plugin:de.itemis.xtext.antlr:pom:2.1.1.v201405091103 (absent): Could not find artifact p2.eclipse.plugin:de.itemis.xtext.antlr:pom:2.1.1.v201405091103 in lsp4j-from-jenkins (https://ci.eclipse.org/xtext/job/lsp4j/lastStableBuild/artifact/build/maven-repository) -> [Help 1]

@trancexpress
Copy link
Copy Markdown
Contributor Author

the problem with tycho 5 is we need a solution how to deal with it in

what happens if use selects java 17 in wizard? should we have a fallback to old version.

this also affecs junit 5/6 what should we offer the user.

We can always delay the JUnit 6 update for when xtext supports only Java 21+. That will make things simple.

Advantest is not in a rush, since the workaround is trivial.

@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Mar 17, 2026

Current errors:

 Error:  Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:5.0.2:test (default-test) on project org.eclipse.xtext.junit5.tests: No tests found -> [Help 1]

@trancexpress
Copy link
Copy Markdown
Contributor Author

@cdietrich do we want also renames for bundles? If they have junit5 in the name, rename to junit6?

@cdietrich
Copy link
Copy Markdown
Contributor

yes you can also rename them

@cdietrich
Copy link
Copy Markdown
Contributor

cdietrich commented Mar 17, 2026

can you check JUnitVersion enum and references
am not sure if we need to keep the old enum for compat.
but throw if used

@szarnekow @LorenzoBettini wdyt?

@LorenzoBettini
Copy link
Copy Markdown
Contributor

can you check JUnitVersion enum and references am not sure if we need to keep the old enum for compat. but throw if used

@szarnekow @LorenzoBettini wdyt?

See my comments above. I seem to understand that the enum hasn't been changed.
In general, I'd rather have compilation errors than runtime exceptions, so I'd keep only the new enum.
However, if we don't want to be too disruptive, we can also keep the old one (can we deprecate it?)

@cdietrich
Copy link
Copy Markdown
Contributor

cdietrich commented Mar 17, 2026

i assume no user uses it.

https://github.com/search?q=%22import+org.eclipse.xtext.util.JUnitVersion%22&type=code

maybe we should mark it somehow

@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Mar 17, 2026

Let me know what you decide for the JUnit 5 constant that is currently removed.

Also if I'm missing any changes, I'm not sure what else to grep for.

@cdietrich
Copy link
Copy Markdown
Contributor

then let remove the old constant, use the new one in the tests, wizard fragments etc

@trancexpress trancexpress changed the title Depend on JUnit 6 instead of JUnit 5 Replace JUnit 5 with JUnit 6 Mar 18, 2026
@trancexpress trancexpress marked this pull request as ready for review March 18, 2026 09:09
@trancexpress
Copy link
Copy Markdown
Contributor Author

There are not many JUnit 5/6 tests to check if the move works:

➜  xtext git:(gh3552) ✗ git grep "import org.junit.jupiter.api.Test"
org.eclipse.xtend.maven.archetype/src/main/resources/archetype-resources/src/test/java/HelloXtendTest.xtend:import org.junit.jupiter.api.Test
org.eclipse.xtext.doc/contents/303_runtime_concepts.html:import org.junit.jupiter.api.Test
org.eclipse.xtext.junit6.tests/src/org/eclipse/xtext/validation/junit6/FileAwareTestLanguageValidationJunit6Test.java:import org.junit.jupiter.api.Test;
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/ComposedInjectAnnotationTest.java:import org.junit.jupiter.api.Test;
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionNested2Test.java:import org.junit.jupiter.api.Test;
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionNested3Test.java:import org.junit.jupiter.api.Test;
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionNestedTest.java:import org.junit.jupiter.api.Test;
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionStaticInnerClassesTest.java:import org.junit.jupiter.api.Test;
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionTest.java:import org.junit.jupiter.api.Test;

I ran all of these from Eclipse, there are no issues. What JUnit 4 tests I tried running also work as usual.

@trancexpress
Copy link
Copy Markdown
Contributor Author

Anything else to check here?


<h2 id="testing">Unit Testing</h2>

<p>Automated tests are crucial for the maintainability and the quality of a software product. That is why it is strongly recommended to write unit tests for your language, too. The Xtext project wizard creates test projects for that purpose, which simplify the setup procedure for the basic language implementation as well as platform-specific integrations. It supports an option to either create your tests for JUnit 4 or JUnit 5. Depending on your choice your test layout will vary in some details.</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this needs to be fixed in (https://github.com/eclipse-xtext/xtext-website) pr against main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

<unit id="junit-platform-suite-api" version="[1.0.0,2.0.0)"/>
<unit id="junit-platform-suite-commons" version="[1.0.0,2.0.0)"/>
<unit id="junit-vintage-engine" version="[5.0.0,6.0.0)"/>
<unit id="junit-jupiter-api" version="[6.0.0,7.0.0)"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about the other target platforms

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which targets also need adjustment? Also xtext-r202603.target?

xtext-latest.target 
xtext-r202512.target 
xtext-r202603.target

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

all ?!?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

otherwise it would compile / would it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no idea why it did
https://ci.eclipse.org/xtext/job/xtext/job/PR-3560/9/consoleFull
maybe tycho pulls stuff anyway.

@cdietrich
Copy link
Copy Markdown
Contributor

looks like you missued this one

grafik

@cdietrich
Copy link
Copy Markdown
Contributor

cdietrich commented Mar 18, 2026

i also still see
junitVersion = "5"

in mwe2 files

did you run CliWizardIntegrationTest
(running as main should update expection)

<unit id="junit-platform-suite-api" version="[1.0.0,2.0.0)"/>
<unit id="junit-platform-suite-commons" version="[1.0.0,2.0.0)"/>
<unit id="junit-vintage-engine" version="[5.0.0,6.0.0)"/>
<unit id="junit-jupiter-api" version="[6.0.0,7.0.0)"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the build fails, but i dont know why. can you check

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

junit-platform-runner some bundles are removed, like this one. I keep forgetting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

<p2:Requirement
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:p2="http://www.eclipse.org/oomph/p2/1.0"
name="junit-platform-runner"
versionRange="[1.14.3,1.14.3]"/>

Copy link
Copy Markdown
Contributor Author

@trancexpress trancexpress Mar 18, 2026

Choose a reason for hiding this comment

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

https://docs.junit.org/6.0.0-M1/release-notes/

The junit-platform-runner module that provided the JUnit 4 based JUnitPlatform runner has been discontinued.

For junit-platform-suite-commons I'm not sure where the official mention was, see e.g.: https://medium.com/javarevisited/whats-new-in-junit-6-key-changes-and-improvements-551a84d7ed1f

The junit-platform-suite-commons module is now integrated into junit-platform-suite.

Note that one of the changes in JUnit 6 is to have version 6 in all the bundles, the junit-platform- ones included.

<unit id="junit-platform-commons" version="[6.0.0,7.0.0)"/>
<unit id="junit-platform-engine" version="[6.0.0,7.0.0)"/>
<unit id="junit-platform-launcher" version="[6.0.0,7.0.0)"/>
<unit id="junit-platform-runner" version="[6.0.0,7.0.0)"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wrong version here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See above.

Copy link
Copy Markdown

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 updates Xtext/Xtend build + tooling + wizard/test templates to switch the “modern JUnit” option from JUnit 5 to JUnit 6, including target-platform units, dependency BOM versions, and renamed test bundles/launch configs.

Changes:

  • Update target definitions / manifests / BOM versions to JUnit 6 ranges and remove obsolete JUnit Platform units.
  • Update wizards/generators (UI + CLI + templates) to generate JUnit 6-based projects and workflows.
  • Rename and adjust test bundles and Xtend IDE quickfix/buildpath support from JUnit 5 to JUnit 6.

Reviewed changes

Copilot reviewed 70 out of 96 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xtext-r202603.target Update JUnit installable unit version ranges to JUnit 6.
xtext-r202512.target Update JUnit installable unit version ranges to JUnit 6.
xtext-latest.target Update JUnit installable unit version ranges to JUnit 6.
pom.xml Rename excluded test artifacts to junit6 variants; update comments mentioning JUnit 6.
org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/TestProjectDescriptor.java Update JUnit selection checks and P2/Maven dependency versions to JUnit 6.
org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/TargetPlatformProject.java Update generated target content to JUnit 6 units/versions; remove some platform units.
org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.java Switch workflow generation to treat the “modern JUnit” option as JUnit 6.
org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/TestProjectDescriptor.xtend Update wizard dependency generation to JUnit 6 versions and selection.
org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/TargetPlatformProject.xtend Update wizard target template to JUnit 6 units/versions.
org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.xtend Update workflow template to emit junitVersion = "6".
org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/cli/CliProjectsCreatorMain.java Change CLI default JUnit selection to JUnit 6.
org.eclipse.xtext.xtext.ui/src/org/eclipse/xtext/xtext/ui/wizard/project/AdvancedNewProjectPage.java Update wizard UI radio button from JUnit 5 to JUnit 6.
org.eclipse.xtext.xtext.generator/xtend-gen/org/eclipse/xtext/xtext/generator/junit/JUnitFragment.java Update generator logic to use JUNIT_6 branch for Jupiter annotations/assertions.
org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/junit/JUnitFragment.xtend Update generator templates to use JUNIT_6 for Jupiter-based stubs.
org.eclipse.xtext.util/src/org/eclipse/xtext/util/JUnitVersion.java Replace JUNIT_5 enum value with JUNIT_6 and update parsing.
org.eclipse.xtext.ui.testing/META-INF/MANIFEST.MF Update optional Jupiter import range to JUnit 6.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/pom.xml Rename wizard expectation project coordinates/modules from JUnit 5 to JUnit 6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6/src/mydsl/MyDsl.xtext Add expected grammar file for mavenTychoJUnit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6/src/mydsl/GenerateMyDsl.mwe2 Update expected baseName and junitVersion to “6”.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6/pom.xml Rename artifactId and src-gen copy paths for mavenTychoJUnit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6/META-INF/MANIFEST.MF Rename bundle metadata for mavenTychoJUnit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6/build.properties Add expected build.properties for mavenTychoJUnit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.web/pom.xml Rename web module artifact/dependencies to mavenTychoJUnit6.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ui/pom.xml Rename UI module artifactId to mavenTychoJUnit6.ui.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ui/META-INF/MANIFEST.MF Rename UI bundle metadata and Require-Bundle entries to junit6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ui/build.properties Add expected UI build.properties for junit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ui.tests/pom.xml Rename UI test plugin artifactId to junit6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ui.tests/META-INF/MANIFEST.MF Update UI tests bundle metadata and Jupiter import ranges to JUnit 6.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ui.tests/build.properties Add expected UI tests build.properties for junit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.tests/pom.xml Rename runtime tests plugin artifactId to junit6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.tests/META-INF/MANIFEST.MF Add expected runtime tests MANIFEST for junit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.tests/build.properties Add expected runtime tests build.properties for junit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.target/pom.xml Rename target module artifactId to junit6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.target/mavenTychoJUnit6.target.target Rename target name and update contained JUnit IUs/ranges to JUnit 6.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ide/pom.xml Rename IDE module artifactId to junit6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ide/META-INF/MANIFEST.MF Rename IDE bundle metadata/requirements to junit6 variant.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit6/mavenTychoJUnit6.parent/mavenTychoJUnit6.ide/build.properties Add expected IDE build.properties for junit6 fixture.
org.eclipse.xtext.tests/testdata/wizard-expectations/mavenTychoJUnit5/mavenTychoJUnit5.parent/mavenTychoJUnit5.tests/META-INF/MANIFEST.MF Remove the junit5 fixture runtime tests MANIFEST.
org.eclipse.xtext.tests/testdata/wizard-expectations/gradle/gradle.parent/gradle/src/main/java/mydsl/GenerateMyDsl.mwe2 Update expected junitVersion to “6” for gradle fixture.
org.eclipse.xtext.tests/src/org/eclipse/xtext/xtext/wizard/cli/CliWizardIntegrationTest.java Update CLI wizard integration test to use baseName junit6 + JUNIT_6.
org.eclipse.xtext.tests/pom.xml Update comment to reference forcing JUnit 6.
org.eclipse.xtext.testing/src/org/eclipse/xtext/testing/extensions/InjectionExtension.java Update Javadoc references from JUnit 5 to JUnit 6.
org.eclipse.xtext.testing/src/org/eclipse/xtext/testing/AbstractXtextTests.java Update Javadoc references from JUnit 5 to JUnit 6.
org.eclipse.xtext.testing/META-INF/MANIFEST.MF Update Jupiter/platform import ranges to JUnit 6.
org.eclipse.xtext.testing.tests/src/org/eclipse/xtext/testing/tests/AbstractJUnitIntegrationTest.java Update Javadoc reference from JUnit 5 to JUnit 6.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionTest.java Move tests to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionStaticInnerClassesTest.java Move tests to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionNestedTest.java Move tests to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionNested3Test.java Move tests to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/InjectionExtensionNested2Test.java Move tests to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/ComposedInjectAnnotationTest.java Move tests to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/ComposedInject.java Move helper annotation to junit6 package namespace.
org.eclipse.xtext.testing.junit6.tests/src/org/eclipse/xtext/testing/tests/junit6/AbstractJUnitIntegrationTest.java Move base test class and update Javadoc to JUnit 6.
org.eclipse.xtext.testing.junit6.tests/pom.xml Rename artifactId/name/comments to junit6 tests.
org.eclipse.xtext.testing.junit6.tests/org.eclipse.xtext.testing.junit6.tests.launch Update Eclipse launch config to junit6 project/test kind ids.
org.eclipse.xtext.testing.junit6.tests/META-INF/MANIFEST.MF Rename bundle symbolic name + update Jupiter/platform import ranges to JUnit 6.
org.eclipse.xtext.testing.junit6.tests/build.properties Add PDE build properties for new/renamed bundle.
org.eclipse.xtext.testing.junit6.tests/about.html Add about.html for junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.settings/org.eclipse.xtend.core.Xtend.prefs Add Eclipse Xtend project settings for junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.settings/org.eclipse.m2e.core.prefs Add Eclipse m2e settings for junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.settings/org.eclipse.jdt.ui.prefs Add Eclipse JDT UI prefs for junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.settings/org.eclipse.jdt.core.prefs Add Java 21 compiler prefs for junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.settings/org.eclipse.core.resources.prefs Add project encoding prefs for junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.project Rename Eclipse project to junit6 tests bundle.
org.eclipse.xtext.testing.junit6.tests/.classpath Add Eclipse classpath entries for junit6 tests bundle.
org.eclipse.xtext.junit6.tests/xtext.junit6.tests.launch Update Eclipse launch config to junit6 project/test kind ids.
org.eclipse.xtext.junit6.tests/src/org/eclipse/xtext/validation/junit6/FileAwareTestLanguageValidationJunit6Test.java Move validation test to junit6 package/class naming.
org.eclipse.xtext.junit6.tests/src/log4j.properties Add log4j config for junit6 test bundle.
org.eclipse.xtext.junit6.tests/pom.xml Rename artifactId/name/description; update Tycho provider hint to junit6.
org.eclipse.xtext.junit6.tests/plugin.properties Update pluginName string to “JUnit 6”.
org.eclipse.xtext.junit6.tests/META-INF/MANIFEST.MF Rename bundle symbolic name and update Jupiter/platform import ranges to JUnit 6.
org.eclipse.xtext.junit6.tests/build.properties Add PDE build properties for junit6 test bundle.
org.eclipse.xtext.junit6.tests/about.html Add about.html for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.xtend.core.Xtend.prefs Add Xtend settings for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.pde.prefs Add PDE compiler settings for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.m2e.core.prefs Add m2e settings for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.jdt.ui.prefs Add JDT UI preferences for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.jdt.launching.prefs Add JDT launching prefs for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.jdt.core.prefs Add Java 21 compiler prefs for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.settings/org.eclipse.core.resources.prefs Add project encoding prefs for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.project Rename Eclipse project to junit6 test bundle.
org.eclipse.xtext.junit6.tests/.gitignore Add gitignore rules for junit6 test bundle.
org.eclipse.xtext.junit6.tests/.classpath Add Eclipse classpath entries for junit6 test bundle.
org.eclipse.xtext.full.releng/pom.xml Switch releng module list from junit5 test bundles to junit6.
org.eclipse.xtext.doc/contents/303_runtime_concepts.html Update docs from JUnit 5 wording to JUnit 6 wording.
org.eclipse.xtext.doc/contents/103_domainmodelnextsteps.html Update docs note from JUnit 5 to JUnit 6.
org.eclipse.xtext.dev-bom/pom.xml Bump junit-jupiter/junit-platform versions to 6.0.1; remove junit-platform-runner dependency.
org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/quickfix/XtendQuickfixProvider.java Update quickfix to add JUnit 6 libs/container instead of JUnit 5.
org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/buildpath/Junit6LibClasspathAdder.java Rename/add JUnit 6 classpath adder with updated container path and import ranges.
org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/quickfix/AddJunitLibToClasspathQuickfixTest.java Update generated test expectations to JUnit 6 quickfix label/imports/container.
org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/buildpath/JunitLibClasspathAdderTest.java Update generated buildpath tests to use Junit6LibClasspathAdder.
org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/buildpath/JunitLibClasspathAdderTest.xtend Update source buildpath tests to JUnit 6 lib adder and messages.
org.eclipse.xtend.ide.tests/longrunning/src/org/eclipse/xtend/ide/tests/quickfix/AddJunitLibToClasspathQuickfixTest.xtend Update longrunning quickfix tests for JUnit 6 quickfix label/imports/container.
org.eclipse.xtend.core/src/org/eclipse/xtend/core/validation/XtendValidator.java Rename comment section label from “JUnit5 annotations” to “JUnit6 annotations”.
Comments suppressed due to low confidence (3)

org.eclipse.xtext.testing.junit6.tests/META-INF/MANIFEST.MF:26

  • Automatic-Module-Name is still set to org.eclipse.xtext.testing, which duplicates the main org.eclipse.xtext.testing bundle’s module name. Since this bundle was renamed to org.eclipse.xtext.testing.junit6.tests, the module name should be updated accordingly to avoid JPMS module-name clashes.
    org.eclipse.xtext.testing.junit6.tests/pom.xml:14
  • The Maven project <name> uses "Junit" casing. For consistency with the rest of the repo and the common spelling, this should be "JUnit".
    org.eclipse.xtext.testing.junit6.tests/META-INF/MANIFEST.MF:3
  • The bundle name uses "Junit" casing. Consider changing it to "JUnit" for consistent spelling (e.g., "Xtext Testing Infrastructure JUnit 6 tests").

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

@trancexpress
Copy link
Copy Markdown
Contributor Author

Failures in the Windows build are:

 org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_01 -- Time elapsed: 0.070 s <<< FAILURE!
org.junit.ComparisonFailure: 
expected:<[org.eclipse.xtext.Xtext
org.eclipse.xtext.common.Terminals]> but was:<[]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:357)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:335)
	at org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_01(XtextContentAssistTest.java:129)
org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_02 -- Time elapsed: 0.050 s <<< FAILURE!
org.junit.ComparisonFailure: 
expected:<[org.eclipse.xtext.Xtext
org.eclipse.xtext.common.Terminals]> but was:<[]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:357)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:335)
	at org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_02(XtextContentAssistTest.java:140)
org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_03 -- Time elapsed: 0.065 s <<< FAILURE!
org.junit.ComparisonFailure: 
expected:<[org.eclipse.xtext.Xtext
org.eclipse.xtext.common.Terminals]> but was:<[]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:357)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:335)
	at org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_03(XtextContentAssistTest.java:148)
org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_04 -- Time elapsed: 0.066 s <<< FAILURE!
java.lang.AssertionError: No such proposal: Terminals - org.eclipse.xtext.common.Terminals Found: [@, @Deprecated, @Exported, @Final, @Override]
	at org.junit.Assert.fail(Assert.java:89)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertProposalDisplayedAtCursor(ContentAssistProcessorTestBuilder.java:303)
	at org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testCompletionOnDatatypeReference_04(XtextContentAssistTest.java:154)
org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testBug463215_01 -- Time elapsed: 0.048 s <<< FAILURE!
org.junit.ComparisonFailure: expected:<[org.eclipse.xtext.common.Terminals]> but was:<[]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:357)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:335)
	at org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testBug463215_01(XtextContentAssistTest.java:107)
org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testBug463215_02 -- Time elapsed: 0.076 s <<< FAILURE!
org.junit.ComparisonFailure: 
expected:<[org.eclipse.xtext.Xtext
org.eclipse.xtext.common.Terminals]> but was:<[]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:357)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:335)
	at org.eclipse.xtext.xtext.ui.editor.contentassist.XtextContentAssistTest.testBug463215_02(XtextContentAssistTest.java:118)

@cdietrich
Copy link
Copy Markdown
Contributor

these are known flaky tests
added them to
#3644
as you are a experienced jdt race condition finder maybe you have an idea.
see also
discussion on #3661

org.junit.jupiter.params;version="[6.0.0,7.0.0)",
org.junit.jupiter.params.provider;version="[6.0.0,7.0.0)",
org.junit.platform.commons.support;version="[6.0.0,7.0.0)"
Automatic-Module-Name: org.eclipse.xtext.tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@trancexpress can check this one (also in others)
might be historically bad

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@LorenzoBettini do you rember this was intentional=

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can check this one (also in others) might be historically bad

Please explain what should be checked and why.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automatic-Module-Name: org.eclipse.xtext.tests seems wrong for the bundle name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@LorenzoBettini do you rember this was intentional=

That's for parameterized tests, IIRC.
I don't remember whether we have any parameterized tests; if not, I'd say it could be removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It was added when Eclipse started to complain about the missing module name. Back then, that check was enabled by default, while now it is not anymore.

When that project was created it was probably done with a copy and paste and that value was not updated. Either we update it or remove it. I think all the other projects have that, so it might be worthwhile to update it accordingly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please move this discussion to a separate ticket, I don't see how it relates to this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can’t we for now just copycthe bundle name to automated module named

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The PR is already massive, best to keep it focused only on the JUnit 6 change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Mar 18, 2026

these are known flaky tests added them to #3644 as you are a experienced jdt race condition finder maybe you have an idea. see also discussion on #3661

This is a lot of tests to be looking at, I checked only: org.eclipse.xtext.common.types.xtext.ui.ContentAssistTest.testCustomArrayList_01()

Adding a bit of waiting here: org.eclipse.jdt.internal.core.search.processing.JobManager.requestIfNotWaiting(IJob)

	public synchronized void requestIfNotWaiting(IJob job) {
		if (Thread.currentThread().getName().equals("main") && "AddJrtToIndex".equals(job.getClass().getSimpleName())) {
			new Exception("AddJrtToIndex").printStackTrace(System.out);
			try {Thread.sleep(500L);} catch (InterruptedException e) {}
		}
		if(!isJobWaiting(job)) {
			request(job);
		}
	}

I see frequent (though not always) fails:

org.junit.ComparisonFailure: expected:<...er.ArrayListSupplier[
java.util.ArrayList
java.util.ArrayList.ArrayListSpliterator
java.util.Arrays.ArrayList]> but was:<...er.ArrayListSupplier[]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertTextAtCursorPosition(ContentAssistProcessorTestBuilder.java:357)
	at org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder.assertText(ContentAssistProcessorTestBuilder.java:244)
	at org.eclipse.xtext.common.types.xtext.ui.ContentAssistTest.testCustomArrayList_01(ContentAssistTest.java:99)

The stack traces are:

java.lang.Exception: AddJrtToIndex
	at org.eclipse.jdt.internal.core.search.processing.JobManager.requestIfNotWaiting(JobManager.java:403)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexLibrary(IndexManager.java:769)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexLibrary(IndexManager.java:721)
	at org.eclipse.jdt.internal.core.ClasspathChange.requestIndexing(ClasspathChange.java:576)
	at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2124)
	at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:490)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:342)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:331)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:185)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:473)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1619)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2522)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2533)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:821)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3542)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3502)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3558)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addToClasspath(JavaProjectSetupUtil.java:323)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addJreClasspathEntry(JavaProjectSetupUtil.java:364)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addJreClasspathEntry(JavaProjectSetupUtil.java:353)
	at org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider.createJavaProject(MockJavaProjectProvider.java:167)
	at org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider.setUp(MockJavaProjectProvider.java:71)
	at org.eclipse.xtext.common.types.xtext.ui.ContentAssistTest.createMockJavaProject(ContentAssistTest.java:38)
java.lang.Exception: AddJrtToIndex
	at org.eclipse.jdt.internal.core.search.processing.JobManager.requestIfNotWaiting(JobManager.java:403)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexLibrary(IndexManager.java:769)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexLibrary(IndexManager.java:721)
	at org.eclipse.jdt.internal.core.DeltaProcessor.createExternalArchiveDelta(DeltaProcessor.java:1069)
	at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2138)
	at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:490)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:342)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:331)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:185)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:473)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1619)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2522)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2533)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:821)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3542)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3502)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3558)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addToClasspath(JavaProjectSetupUtil.java:323)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addJreClasspathEntry(JavaProjectSetupUtil.java:364)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addJreClasspathEntry(JavaProjectSetupUtil.java:353)
	at org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider.createJavaProject(MockJavaProjectProvider.java:167)
	at org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider.setUp(MockJavaProjectProvider.java:71)
	at org.eclipse.xtext.common.types.xtext.ui.ContentAssistTest.createMockJavaProject(ContentAssistTest.java:38)
java.lang.Exception: AddJrtToIndex
	at org.eclipse.jdt.internal.core.search.processing.JobManager.requestIfNotWaiting(JobManager.java:403)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexLibrary(IndexManager.java:769)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexLibrary(IndexManager.java:721)
	at org.eclipse.jdt.internal.core.ClasspathChange.requestIndexing(ClasspathChange.java:576)
	at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2124)
	at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:490)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:342)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:331)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:185)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:473)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1619)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2522)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2533)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:821)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3542)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3502)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3558)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addToClasspath(JavaProjectSetupUtil.java:323)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addJreClasspathEntry(JavaProjectSetupUtil.java:364)
	at org.eclipse.xtext.ui.testing.util.JavaProjectSetupUtil.addJreClasspathEntry(JavaProjectSetupUtil.java:353)
	at org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider.createJavaProject(MockJavaProjectProvider.java:167)
	at org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider.setUp(MockJavaProjectProvider.java:83)
	at org.eclipse.xtext.common.types.xtext.ui.ContentAssistTest.createMockJavaProject(ContentAssistTest.java:38)

This doesn't help:

diff --git a/org.eclipse.xtext.common.types.eclipse.tests/tests/org/eclipse/xtext/common/types/access/jdt/MockJavaProjectProvider.java b/org.eclipse.xtext.common.types.eclipse.tests/tests/org/eclipse/xtext/common/types/access/jdt/Moc
kJavaProjectProvider.java
index 4028f7a3a6..870946334d 100755
--- a/org.eclipse.xtext.common.types.eclipse.tests/tests/org/eclipse/xtext/common/types/access/jdt/MockJavaProjectProvider.java
+++ b/org.eclipse.xtext.common.types.eclipse.tests/tests/org/eclipse/xtext/common/types/access/jdt/MockJavaProjectProvider.java
@@ -165,6 +165,7 @@ public class MockJavaProjectProvider implements IJavaProjectProvider {
                        javaProject.setRawClasspath(classpathEntries.toArray(new IClasspathEntry[classpathEntries.size()]),
                                        null);
                        JavaProjectSetupUtil.addJreClasspathEntry(javaProject);
+                       IResourcesSetupUtil.waitForBuild();
 
                        makeJava8Compliant(javaProject);

I'll keep looking, I assume something is running in parallel and expecting the indexer results sooner.

@trancexpress trancexpress mentioned this pull request Mar 18, 2026
@cdietrich cdietrich merged commit 0e1cd73 into eclipse-xtext:main Mar 19, 2026
13 of 14 checks passed
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.

5 participants