Skip to content

WIP: continue migration to JUnit 5 (Plan A)#1320

Closed
KrisLimbo wants to merge 1 commit into
dsldevkit:masterfrom
KrisLimbo:001-acf-13681-A
Closed

WIP: continue migration to JUnit 5 (Plan A)#1320
KrisLimbo wants to merge 1 commit into
dsldevkit:masterfrom
KrisLimbo:001-acf-13681-A

Conversation

@KrisLimbo
Copy link
Copy Markdown
Collaborator

@KrisLimbo KrisLimbo commented Apr 27, 2026

Updated ddk.target file.
Directed tycho to use JUnit5.
Changed swtbot dependency to JUnit5.
Removed JUnit4 dependencies.
Removed custom JUnit4 runners.

Job job = getNextJob();
if (job == null) {
Assert.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs);
org.junit.jupiter.api.Assertions.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); //$NON-NLS-1$ //$NON-NLS-2$
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
org.junit.jupiter.api.Assertions.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); //$NON-NLS-1$ //$NON-NLS-2$
fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); //$NON-NLS-1$ //$NON-NLS-2$

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done.

Comment thread ddk-target/ddk.target Outdated
<unit id="org.eclipse.jdt.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.source.feature.group" version="0.0.0"/>
<unit id="org.apache.lucene.analysis-common" version="0.0.0"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we add lucene?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

removed.

Comment thread ddk-target/ddk.target
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/simrel/maven-osgi/release/4.39.0"/>
<unit id="junit-jupiter-api" version="5.14.3"/>
<unit id="junit-vintage-engine" version="5.14.3"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if we have fully migrated to junit 5 we should be able to remove the junit-vintage-engine, can we?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i think so too. however, for some reason - tycho is using junit5vintage. I do not know how to make tycho use jupiter, and why the tests still keep using the vintage engine, despite best effort to remove the references to junit.
For this reason, "junit-vintage-engine" still remains in the ddk target file, as the tests will return an unresolved error when I remove that entry.

<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/ddk-parent}/../"/>
<intAttribute key="M2_COLORS" value="0"/>
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="clean verify -f ddk-parent/pom.xml --batch-mode --fail-at-end"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we remove the static code analysis?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this was not intended. I was running maven on local workspace with modified configuration, and i accidentally checked this in.

@KrisLimbo KrisLimbo force-pushed the 001-acf-13681-A branch 12 times, most recently from c551216 to 7edfc07 Compare April 28, 2026 02:30
@KrisLimbo
Copy link
Copy Markdown
Collaborator Author

KrisLimbo commented Apr 28, 2026

Current state of this PR:

  1. For some reason - tycho is using junit5vintage.
    I do not know how to make tycho use jupiter, and why the tests still keep using the vintage engine, despite best effort to remove the references to junit.
    For this reason, "junit-vintage-engine" still remains in the ddk target file, as the tests will return an unresolved error when I remove that entry.

  2. Problems with creating/injecting Eclipse UI Workbench:
    com.avaloq.tools.ddk.xtext.ui.quickfix Workbench has not been created yet.
    No implementation for IWorkbench was bound.
    com.avaloq.tools.ddk.check.validation
    com.avaloq.tools.ddk.check.formatting
    com.avaloq.tools.ddk.check.core.test
    com.avaloq.tools.ddk.check.core.generator

  3. There are other test failures as well, but I think other problems are more important for now.

  4. Removed method filters and our custom junit runners, which has implications on our system/Jenkins tests?

  5. What I don't like about this approach is I removed the plug-in of com.avaloq.tools.ddk.xtext.test in ‎com.avaloq.tools.ddk.xtext.test/pom.xml‎. But it seems to be safe, because all it does is launch the other tests?

@KrisLimbo KrisLimbo force-pushed the 001-acf-13681-A branch 4 times, most recently from 5c43feb to 5cb524e Compare April 29, 2026 04:53
@KrisLimbo KrisLimbo changed the title wip: update Orbit repository (1) WIP: continue migration to JUnit 5 (Plan A) Apr 29, 2026
Updated ddk.target file.
Directed tycho to use JUnit5.
Changed swtbot dependency to JUnit5.
Removed JUnit4 dependencies.
Removed custom JUnit4 runners.
joaodinissf added a commit to joaodinissf/dsl-devkit that referenced this pull request May 4, 2026
Tests have been silently reporting "Tests run: 0" since dsldevkit#1292
(2026-04-01) bumped orbit-aggregation from 2025-09 to 4.39.0.
Tycho-Surefire treats zero discovered tests as success, so CI
remained green while test coverage dropped to nothing.

Root cause: orbit-aggregation 4.38.0+ ships every JUnit Jupiter,
Platform, and Vintage IU at both the 5.x and 6.x version families
simultaneously. Tycho's planner pulls in both families, so the
OSGi runtime ends up with two Class<?> instances of JUnit Platform
types, producing LinkageError / ArrayStoreException during test
discovery (different classloaders for the same FQN).

orbit-aggregation 4.37.0 (Sept 2025) is the last release that
ships JUnit at a single family (5.13.4 / Platform 1.13.4) and
matches Eclipse 4.34's PDE JUnit runtime bridge. Pinning to it,
removing the now-redundant maven-osgi/release/4.39.0 location,
and inlining the JUnit IUs at 5.13.4 / 1.13.4 restores the three
JUnit-Platform-bearing classloaders to a single agreed version.

Also dropped: the unused releases/2022-12 UML2 location, which
was a stealth source of additional JUnit 5.9.1 / 1.9.1 IUs (DDK
does not consume any UML2 features).

Verified locally on macOS aarch64: 307 tests across 75 classes,
0 failures. Tycho-Surefire's auto-detection selects the
junit5vintage provider given Jupiter + vintage-engine on the
classpath; no providerHint override is needed.

This is step 1 of a staged plan. Subsequent PRs will:
  step 2 - migrate remaining JUnit 4 source surface to Jupiter
  step 3 - drop org.junit 4.13.2 and junit-vintage-engine entirely
  step 4 - upgrade to JUnit 6 + Eclipse 4.39 atomically

Credit: Kris Limbo's dsldevkit#1320 / dsldevkit#1321 (Plan A / Plan B) proved the
JUnit 5 migration direction; both encountered the same LinkageError
during diagnosis that this fix sidesteps via version alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@KrisLimbo
Copy link
Copy Markdown
Collaborator Author

#1324 and related PRs document the way forward to fix the JUnit tests for the DDK.
According to PR#1324, the problem with this PR and PR#1321 is as follows:

Root cause: orbit-aggregation 4.38.0+ ships every JUnit Jupiter, Platform, and Vintage IU at both the 5.x and 6.x version families simultaneously. Tycho's planner pulls in both families, so the OSGi runtime ends up with two Class<?> instances of JUnit Platform types, producing LinkageError / ArrayStoreException during test discovery (different classloaders for the same FQN).

orbit-aggregation 4.37.0 (Sept 2025) is the last release that ships JUnit at a single family (5.13.4 / Platform 1.13.4) and
matches Eclipse 4.34's PDE JUnit runtime bridge.

@KrisLimbo KrisLimbo closed this May 5, 2026
joaodinissf added a commit that referenced this pull request May 6, 2026
Tests have been silently reporting "Tests run: 0" since #1292
(2026-04-01) bumped orbit-aggregation from 2025-09 to 4.39.0.
Tycho-Surefire treats zero discovered tests as success, so CI
remained green while test coverage dropped to nothing.

Root cause: orbit-aggregation 4.38.0+ ships every JUnit Jupiter,
Platform, and Vintage IU at both the 5.x and 6.x version families
simultaneously. Tycho's planner pulls in both families, so the
OSGi runtime ends up with two Class<?> instances of JUnit Platform
types, producing LinkageError / ArrayStoreException during test
discovery (different classloaders for the same FQN).

orbit-aggregation 4.37.0 (Sept 2025) is the last release that
ships JUnit at a single family (5.13.4 / Platform 1.13.4) and
matches Eclipse 4.34's PDE JUnit runtime bridge. Pinning to it,
removing the now-redundant maven-osgi/release/4.39.0 location,
and inlining the JUnit IUs at 5.13.4 / 1.13.4 restores the three
JUnit-Platform-bearing classloaders to a single agreed version.

Also dropped: the unused releases/2022-12 UML2 location, which
was a stealth source of additional JUnit 5.9.1 / 1.9.1 IUs (DDK
does not consume any UML2 features).

Verified locally on macOS aarch64: 307 tests across 75 classes,
0 failures. Tycho-Surefire's auto-detection selects the
junit5vintage provider given Jupiter + vintage-engine on the
classpath; no providerHint override is needed.

This is step 1 of a staged plan. Subsequent PRs will:
  step 2 - migrate remaining JUnit 4 source surface to Jupiter
  step 3 - drop org.junit 4.13.2 and junit-vintage-engine entirely
  step 4 - upgrade to JUnit 6 + Eclipse 4.39 atomically

Credit: Kris Limbo's #1320 / #1321 (Plan A / Plan B) proved the
JUnit 5 migration direction; both encountered the same LinkageError
during diagnosis that this fix sidesteps via version alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@KrisLimbo KrisLimbo deleted the 001-acf-13681-A branch May 7, 2026 00:16
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.

2 participants