From 8748b6c20a0e9f01f6a9b765e26520adb32d95f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Thu, 30 Apr 2026 22:58:50 +0200 Subject: [PATCH 1/4] fix: pin orbit-aggregation to 4.37.0 to restore test discovery 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) --- ddk-target/ddk.target | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ddk-target/ddk.target b/ddk-target/ddk.target index aff6ba174c..a2ade38df0 100644 --- a/ddk-target/ddk.target +++ b/ddk-target/ddk.target @@ -1,6 +1,6 @@ - + @@ -20,10 +20,6 @@ - - - - @@ -46,23 +42,27 @@ - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + From acdf4e65876f7e1defd538343df2aee371c56b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Thu, 30 Apr 2026 23:45:21 +0200 Subject: [PATCH 2/4] fix: align XtextBuildTriggerTest verify with single-arg scheduleBuildIfNecessary call XtextBuildTrigger.scheduleFullBuild() invokes buildScheduler.scheduleBuildIfNecessary(projects) - single arg, no IBuildFlag varargs - but the test verified the call with two matchers: eq(projects) and ArgumentMatchers.any(). Mockito 5.x treats the second matcher as expecting a second explicit argument, not "varargs may be empty", so verify reports an argument-count mismatch: Wanted: scheduleBuildIfNecessary([], ); Actual: scheduleBuildIfNecessary([]); The test passed under Mockito 4.x where vararg `any()` matched zero or more vararg invocations. This isn't introduced by step 1's 5.21->5.19 patch bump; both are strict. Master has had Mockito 5.x in scope since orbit-aggregation 4.39 (PR #1292), but tests being silent-zero (Tycho-Surefire reporting `Tests run: 0` as success) hid the failure. Step 1 restores test discovery, which surfaces this latent mismatch and makes the test fail deterministically (verified locally: 307 tests, 1 failure on this exact assertion). Drop the second matcher on both verify sites (the never() check and the positive verify); they now match the production single-arg call. The IBuildFlag import is no longer needed. Bundled in PR #1323 so its "restored 307 tests" claim lands green; splitting would ship the orbit-pin PR with a known-failing test. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../tools/ddk/xtext/builder/XtextBuildTriggerTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java index c5a430401b..96b4e5dd0e 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java @@ -23,7 +23,6 @@ import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.xtext.builder.impl.BuildScheduler; -import org.eclipse.xtext.builder.impl.IBuildFlag; import org.eclipse.xtext.testing.InjectWith; import org.eclipse.xtext.testing.extensions.InjectionExtension; import org.junit.jupiter.api.BeforeEach; @@ -60,7 +59,7 @@ public void testTriggerRespectsAutoBuilding() { // auto-build disabled when(workspace.isAutoBuilding()).thenReturn(false); buildTrigger.scheduleFullBuild(); - verify(scheduler, never()).scheduleBuildIfNecessary(ArgumentMatchers.> any(), ArgumentMatchers. any()); + verify(scheduler, never()).scheduleBuildIfNecessary(ArgumentMatchers.> any()); reset(workspace); reset(scheduler); @@ -72,6 +71,6 @@ public void testTriggerRespectsAutoBuilding() { when(workspace.getRoot()).thenReturn(root); when(root.getProjects()).thenReturn(projects); buildTrigger.scheduleFullBuild(); - verify(scheduler).scheduleBuildIfNecessary(eq(Arrays.asList(projects)), ArgumentMatchers. any()); + verify(scheduler).scheduleBuildIfNecessary(eq(Arrays.asList(projects))); } } From 7241fcf106b81fea243e46adb4077cae7a8a7a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Thu, 30 Apr 2026 23:45:34 +0200 Subject: [PATCH 3/4] ci: fail on missing surefire reports Tycho-Surefire reports `Tests run: 0` as exit code 0, so a broken test discovery yields a green build with no tests run. PR #1292 went undetected for ~30 days for this reason: orbit-aggregation 4.39.0 introduced JUnit 5.x and 6.x simultaneously, breaking JUnit Platform discovery, and CI happily reported pass. Tycho-Surefire writes no TEST-*.xml when discovery yields zero, so a file-existence check on `**/target/surefire-reports/TEST-*.xml` suffices to catch the silent-zero failure mode. The step runs with `if: always()` so it fires even after build failures. Verified empirically: master (orbit-4.39.0, silent-zero) produces 0 TEST-*.xml; the check correctly fails. Working state (orbit-4.37.0, 357 tests) produces 81 TEST-*.xml; check passes. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/verify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 1be908ba85..159f8d581b 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -50,6 +50,14 @@ jobs: # Run pmd:pmd and pmd:cpd first to generate reports for all modules, then run pmd:check and pmd:cpd-check # This ensures all violations are collected and reported before the build fails run: xvfb-run mvn clean verify checkstyle:check pmd:pmd pmd:cpd pmd:check pmd:cpd-check spotbugs:check -f ./ddk-parent/pom.xml --batch-mode --fail-at-end + - name: Fail on missing surefire reports + # Tycho-Surefire writes no TEST-*.xml when discovery is empty — fail the job in that case. + if: always() + run: | + if ! find . -path '*/target/surefire-reports/TEST-*.xml' -print -quit | grep -q .; then + echo "::error::No surefire reports found. Test discovery is likely broken." + exit 1 + fi - name: Archive Tycho Surefire Plugin if: ${{ failure() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 From 61326eeaeafaa0bc7c409a993ae1a1bcfca21632 Mon Sep 17 00:00:00 2001 From: U004437 Date: Wed, 6 May 2026 08:54:04 +0800 Subject: [PATCH 4/4] fix: JUnit5 test environment 1. Select the plugin versions in the target file. 2. Re-pin orbit aggregation back to 4.39.0. Removed reference to org.junit 4.13.2. 3. Upgrade Eclipse release to 2026-03. 4. Removed references to junit-vintage-engine. 5. Migrate remaining JUnit4 Assert Calls as per PR1325. --- .../.classpath | 1 - .../META-INF/MANIFEST.MF | 1 - .../.classpath | 1 - .../META-INF/MANIFEST.MF | 3 +- .../META-INF/MANIFEST.MF | 3 +- .../test/core/mock/ExtensionRegistryMock.java | 4 +- .../tools/ddk/test/core/mock/ServiceMock.java | 9 +- .../tools/ddk/test/core/util/JobMatcher.java | 10 +- .../test/core/util/SimpleProgressMonitor.java | 4 +- .../META-INF/MANIFEST.MF | 4 +- .../ddk/test/ui/swtbot/CoreSwtbotTools.java | 6 +- .../ddk/test/ui/swtbot/SwtWizardBot.java | 12 +- .../test/ui/swtbot/util/SwtBotWizardUtil.java | 4 +- .../AcfContentAssistProcessorTestBuilder.java | 12 +- .../AbstractAcfContentAssistTest.java | 14 +- .../tools/ddk/xtext/test/model/ModelUtil.java | 4 +- .../META-INF/MANIFEST.MF | 1 - com.avaloq.tools.ddk.xtext.test/pom.xml | 5 +- ddk-configuration/launches/devkit-run.launch | 2 - ddk-target/ddk.target | 949 +++++++++++++++++- 20 files changed, 970 insertions(+), 79 deletions(-) diff --git a/com.avaloq.tools.ddk.check.core.test/.classpath b/com.avaloq.tools.ddk.check.core.test/.classpath index bad5dd7a27..ea3640ba13 100644 --- a/com.avaloq.tools.ddk.check.core.test/.classpath +++ b/com.avaloq.tools.ddk.check.core.test/.classpath @@ -3,7 +3,6 @@ - diff --git a/com.avaloq.tools.ddk.check.core.test/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.check.core.test/META-INF/MANIFEST.MF index 0bd941889e..d5412a8e0d 100644 --- a/com.avaloq.tools.ddk.check.core.test/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.check.core.test/META-INF/MANIFEST.MF @@ -29,7 +29,6 @@ Require-Bundle: com.avaloq.tools.ddk.check.core, org.eclipse.xtext.xbase.testing, junit-jupiter-api, junit-jupiter-engine, - junit-vintage-engine, junit-platform-suite-api Export-Package: com.avaloq.tools.ddk.check.core.test, com.avaloq.tools.ddk.check.core.test.util, diff --git a/com.avaloq.tools.ddk.check.test.runtime.tests/.classpath b/com.avaloq.tools.ddk.check.test.runtime.tests/.classpath index a0c3adab0f..1b7ceb1beb 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.tests/.classpath +++ b/com.avaloq.tools.ddk.check.test.runtime.tests/.classpath @@ -10,7 +10,6 @@ - diff --git a/com.avaloq.tools.ddk.check.test.runtime.tests/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.check.test.runtime.tests/META-INF/MANIFEST.MF index 1154b3c5e0..1477542dc0 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.tests/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.check.test.runtime.tests/META-INF/MANIFEST.MF @@ -19,8 +19,7 @@ Require-Bundle: com.avaloq.tools.ddk.check.runtime.core, org.eclipse.xtext.xbase.lib, junit-jupiter-api, junit-jupiter-engine, - junit-platform-suite-api, - junit-vintage-engine + junit-platform-suite-api Import-Package: org.hamcrest.core Bundle-RequiredExecutionEnvironment: JavaSE-21 Export-Package: com.avaloq.tools.ddk.check.test.runtime, diff --git a/com.avaloq.tools.ddk.sample.helloworld.ui.test/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.sample.helloworld.ui.test/META-INF/MANIFEST.MF index c5372c62e6..dc244afce0 100644 --- a/com.avaloq.tools.ddk.sample.helloworld.ui.test/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.sample.helloworld.ui.test/META-INF/MANIFEST.MF @@ -20,8 +20,7 @@ Require-Bundle: com.avaloq.tools.ddk.sample.helloworld, org.eclipse.xtext.xbase.ui.testing, junit-jupiter-api, junit-jupiter-engine, - junit-platform-suite-api, - junit-vintage-engine + junit-platform-suite-api Bundle-RequiredExecutionEnvironment: JavaSE-21 Export-Package: com.avaloq.tools.ddk.sample.helloworld.test, com.avaloq.tools.ddk.sample.helloworld.ui;x-internal=true diff --git a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ExtensionRegistryMock.java b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ExtensionRegistryMock.java index d9b1b5bb1b..b6da91dc6c 100644 --- a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ExtensionRegistryMock.java +++ b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ExtensionRegistryMock.java @@ -25,7 +25,7 @@ import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.RegistryFactory; import org.eclipse.emf.common.util.WrappedException; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.mockito.stubbing.Answer; import com.google.common.collect.LinkedHashMultimap; @@ -179,7 +179,7 @@ public static void assertUnMocked() { if (registrySpy != null) { try { String extensionPointId = configurationElements.keySet().iterator().next(); - Assert.fail("Extension point " + extensionPointId + " still has mocked configuration elements."); //$NON-NLS-1$ //$NON-NLS-2$ + Assertions.fail("Extension point " + extensionPointId + " still has mocked configuration elements."); //$NON-NLS-1$ //$NON-NLS-2$ } catch (NoSuchElementException e) { // shouldn't happen throw new IllegalStateException("The extension registry mock is in an unexpected state.", e); //$NON-NLS-1$ } diff --git a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ServiceMock.java b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ServiceMock.java index 11ab1a0811..21f9ebdd44 100644 --- a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ServiceMock.java +++ b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/mock/ServiceMock.java @@ -11,10 +11,9 @@ package com.avaloq.tools.ddk.test.core.mock; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; /** @@ -46,10 +45,8 @@ public static boolean isMocked(final Class classToCheck) { */ public static void assertAllMocksRemoved() { if (!originalServices.keySet().isEmpty()) { - Iterator> iterator = originalServices.keySet().iterator(); - while (iterator.hasNext()) { - Class clazz = iterator.next(); - Assert.fail("Service " + clazz.getName() + " is still mocked."); //$NON-NLS-1$//$NON-NLS-2$ + for (Class clazz : originalServices.keySet()) { + Assertions.fail("Service " + clazz.getName() + " is still mocked."); //$NON-NLS-1$//$NON-NLS-2$ } } } diff --git a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/JobMatcher.java b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/JobMatcher.java index 6605221f6f..3c3a8d56e6 100644 --- a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/JobMatcher.java +++ b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/JobMatcher.java @@ -19,7 +19,7 @@ import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.JobChangeAdapter; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; @@ -214,7 +214,7 @@ public final void deregister() { * the expected number of jobs */ public final void assertNumberOfNewJobs(final int expected) { - Assert.assertEquals("Wrong number of jobs were scheduled", expected, newJobs.size()); + Assertions.assertEquals(expected, newJobs.size(), "Wrong number of jobs were scheduled"); } /** @@ -227,13 +227,13 @@ public final void assertNumberOfNewJobs(final int expected) { public final void assertNewJobsFinished() { try { List expectedJobs = Lists.newArrayList(newJobs); - Assert.assertFalse("No matching new jobs were scheduled: " + finder, expectedJobs.isEmpty()); + Assertions.assertFalse(expectedJobs.isEmpty(), "No matching new jobs were scheduled: " + finder); expectedJobs.removeAll(finishedJobs); while (!expectedJobs.isEmpty()) { try { Job job = getNextJob(); if (job == null) { - Assert.fail("Expected new jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); + Assertions.fail("Expected new jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); } expectedJobs.remove(job); } catch (InterruptedException e) { @@ -261,7 +261,7 @@ public final void waitForExistingJobs() { try { Job job = getNextJob(); if (job == null) { - Assert.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); + Assertions.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); } expectedJobs.remove(job); } catch (InterruptedException e) { diff --git a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/SimpleProgressMonitor.java b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/SimpleProgressMonitor.java index 01cf8bedd8..754acb8607 100644 --- a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/SimpleProgressMonitor.java +++ b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/util/SimpleProgressMonitor.java @@ -11,7 +11,7 @@ package com.avaloq.tools.ddk.test.core.util; import org.eclipse.core.runtime.IProgressMonitor; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; /** @@ -169,7 +169,7 @@ public void waitForTermination() { final long timeStarted = System.currentTimeMillis(); while (!isTerminated()) { long remainingWaitTime = TIMEOUT + timeStarted - System.currentTimeMillis(); - Assert.assertFalse("Progress monitor did not get done signal", remainingWaitTime <= 0); //$NON-NLS-1$ + Assertions.assertFalse(remainingWaitTime <= 0, "Progress monitor did not get done signal"); //$NON-NLS-1$ try { this.wait(remainingWaitTime); } catch (InterruptedException e) /* CHECKSTYLE:OFF */ { diff --git a/com.avaloq.tools.ddk.test.ui/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.test.ui/META-INF/MANIFEST.MF index 020b707efc..2f8751bc15 100644 --- a/com.avaloq.tools.ddk.test.ui/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.test.ui/META-INF/MANIFEST.MF @@ -28,6 +28,8 @@ Export-Package: com.avaloq.tools.ddk.test.ui, com.avaloq.tools.ddk.test.ui.swtbot, com.avaloq.tools.ddk.test.ui.swtbot.condition, com.avaloq.tools.ddk.test.ui.swtbot.util -Import-Package: org.slf4j, org.apache.logging.log4j +Import-Package: org.apache.logging.log4j, + org.junit.jupiter.api;version="[5.14.0,6.0.0)", + org.slf4j Eclipse-RegisterBuddy: org.eclipse.swtbot.swt.finder Automatic-Module-Name: com.avaloq.tools.ddk.test.ui diff --git a/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/CoreSwtbotTools.java b/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/CoreSwtbotTools.java index 0098da9e6b..ecf30f58c6 100644 --- a/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/CoreSwtbotTools.java +++ b/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/CoreSwtbotTools.java @@ -11,7 +11,7 @@ package com.avaloq.tools.ddk.test.ui.swtbot; import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.awt.AWTException; import java.awt.Robot; @@ -455,7 +455,7 @@ public static void openView(final SWTWorkbenchBot bot, final String category, fi } } } - assertTrue("View or Category found", bot.button().isEnabled()); + assertTrue(bot.button().isEnabled(), "View or Category found"); bot.button("OK").click(); } @@ -498,7 +498,7 @@ public static SWTBotTreeItem findTreeItem(final SWTWorkbenchBot bot, final SWTBo } } while (itemCount > 0); - assertTrue("Searching TreeItem", itemFound); + assertTrue(itemFound, "Searching TreeItem"); return botTreeItem; diff --git a/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/SwtWizardBot.java b/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/SwtWizardBot.java index d22130a94d..9e390078c1 100644 --- a/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/SwtWizardBot.java +++ b/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/SwtWizardBot.java @@ -12,7 +12,7 @@ import static com.avaloq.tools.ddk.test.ui.swtbot.util.SwtBotWizardUtil.selectItem; import static org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.syncExec; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; @@ -49,7 +49,7 @@ public class SwtWizardBot extends SwtWorkbenchBot { public void closeWizard() { SWTBotShell activeShell = activeShell(); boolean wizardIsActive = isWizard(activeShell); - assertTrue("Wizard is active on close", wizardIsActive); + assertTrue(wizardIsActive, "Wizard is active on close"); activeShell.close(); } @@ -155,13 +155,13 @@ public void openExportWizard(final String wizardName) { * name of the wizard to be activated */ private void activateWizard(final String wizardName) { - assertTrue("A wizard dialog must be active", syncExec(() -> { + assertTrue(syncExec(() -> { SWTBotShell wizardShell = activeShell(); return wizardShell.widget.getData() instanceof WizardDialog; - })); - assertTrue("Wizard '" + wizardName + "' does not exist.", syncExec(() -> { + }), "A wizard dialog must be active"); + assertTrue(syncExec(() -> { return selectItem(tree(), wizardName); - })); + }), "Wizard '" + wizardName + "' does not exist."); clickButton(NEXT); } diff --git a/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/util/SwtBotWizardUtil.java b/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/util/SwtBotWizardUtil.java index fc73ed9588..582706d1d0 100644 --- a/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/util/SwtBotWizardUtil.java +++ b/com.avaloq.tools.ddk.test.ui/src/com/avaloq/tools/ddk/test/ui/swtbot/util/SwtBotWizardUtil.java @@ -18,7 +18,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; import org.eclipse.ui.PlatformUI; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import com.avaloq.tools.ddk.test.ui.swtbot.SwtWorkbenchBot; @@ -48,7 +48,7 @@ public static void selectProjectFolder(final SwtWorkbenchBot bot, final String f final Tree tree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), comp); PlatformUI.getWorkbench().getDisplay().syncExec(() -> { SWTBotTree botTree = new SWTBotTree(tree); - Assert.assertTrue("folder was not found", selectItem(botTree, folderName)); + Assertions.assertTrue(selectItem(botTree, folderName), "folder was not found"); }); } diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/AcfContentAssistProcessorTestBuilder.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/AcfContentAssistProcessorTestBuilder.java index 9193c91fc4..c3a5303078 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/AcfContentAssistProcessorTestBuilder.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/AcfContentAssistProcessorTestBuilder.java @@ -11,7 +11,7 @@ package com.avaloq.tools.ddk.xtext.test; // CHECKSTYLE:OFF -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.text.MessageFormat; import java.util.concurrent.atomic.AtomicReference; @@ -35,7 +35,7 @@ import org.eclipse.xtext.util.Pair; import org.eclipse.xtext.util.StringInputStream; import org.eclipse.xtext.util.Tuples; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import com.google.inject.Injector; @@ -111,7 +111,7 @@ public AcfContentAssistProcessorTestBuilder applyText(final String expectedDispl break; } } - assertNotNull(MessageFormat.format("\"{0}\" not a valid completion proposal", expectedDisplayString), proposal); + assertNotNull(proposal, MessageFormat.format("\"{0}\" not a valid completion proposal", expectedDisplayString)); String text = ""; if (proposal instanceof ConfigurableCompletionProposal) { text = ((ConfigurableCompletionProposal) proposal).getReplacementString(); @@ -180,11 +180,11 @@ public ContentAssistProcessorTestBuilder assertMatchString(final String matchStr ContentAssistContext.Factory factory = get(ContentAssistContext.Factory.class); ContentAssistContext[] contexts = factory.create(sourceViewer, currentModelToParse.length(), xtextResource); for (ContentAssistContext context : contexts) { - Assert.assertTrue("matchString = '" + matchString + "', actual: '" + context.getPrefix() + "'", "".equals(context.getPrefix()) - || matchString.equals(context.getPrefix())); + Assertions.assertTrue("".equals(context.getPrefix()) || matchString.equals(context.getPrefix()), "matchString = '" + matchString + "', actual: '" + + context.getPrefix() + "'"); } } else { - Assert.fail("No content assistant for content type " + contentType); + Assertions.fail("No content assistant for content type " + contentType); } } catch (BadLocationException e) { exception.set(e); diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java index af4c279989..a6c6392b5e 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java @@ -10,9 +10,9 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext.test.contentassist; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.text.MessageFormat; import java.util.Arrays; @@ -91,7 +91,7 @@ private String getCompletionProposalDisplayStrings(final ICompletionProposal... * the expected proposals as display strings */ private void assertCompletionProposal(final ICompletionProposal[] computedProposals, final boolean positiveTest, final String... proposals) { - assertNotEquals(AT_LEAST_ONE_PROPOSAL_WAS_PROVIDED, proposals.length, 0); + assertNotEquals(0, proposals.length, AT_LEAST_ONE_PROPOSAL_WAS_PROVIDED); for (final String s : proposals) { boolean foundProposal = false; for (ICompletionProposal p : computedProposals) { @@ -156,7 +156,7 @@ protected void assertNotCompletionProposal(final ICompletionProposal[] computedP * the expected proposals as display strings */ protected void assertExactlyCompletionProposal(final ICompletionProposal[] computedProposals, final String... expectedProposals) { - assertNotEquals(AT_LEAST_ONE_PROPOSAL_WAS_PROVIDED, expectedProposals.length, 0); + assertNotEquals(0, expectedProposals.length, AT_LEAST_ONE_PROPOSAL_WAS_PROVIDED); Set computedProposalsAsSet = new HashSet(); for (ICompletionProposal p : computedProposals) { @@ -191,8 +191,8 @@ protected void assertExactlyCompletionProposal(final ICompletionProposal[] compu private void assertSourceProposals(final String sourceFileName) { try { AcfContentAssistProcessorTestBuilder builder = newBuilder().append(getTestSource(sourceFileName).getContent()); - assertFalse(EXPECTED_PROPOSALS_NOT_SET, (acfContentAssistMarkerTagInfo.expectedProposalMap.isEmpty() - && acfContentAssistMarkerTagInfo.notExpectedProposalMap.isEmpty() && acfContentAssistMarkerTagInfo.expectedExactlyProposalMap.isEmpty())); + assertFalse((acfContentAssistMarkerTagInfo.expectedProposalMap.isEmpty() && acfContentAssistMarkerTagInfo.notExpectedProposalMap.isEmpty() + && acfContentAssistMarkerTagInfo.expectedExactlyProposalMap.isEmpty()), EXPECTED_PROPOSALS_NOT_SET); for (int markerId : getUsedTagsItems()) { final ICompletionProposal[] proposals = builder.computeCompletionProposals(getOffsetForTag(markerId)); if (acfContentAssistMarkerTagInfo.expectedProposalMap.containsKey(markerId)) { diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/model/ModelUtil.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/model/ModelUtil.java index 3141572b4f..60cbc6239c 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/model/ModelUtil.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/model/ModelUtil.java @@ -14,7 +14,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; @@ -84,7 +84,7 @@ public Iterable getAllInstancesOf(final EObject context, // CHECKSTYLE:ON return Iterables.filter(getAllInstancesOf(context, type), input -> { if (input.eClass().getEStructuralFeature(feature.getFeatureID()) != feature) { - Assert.fail("Feature " + feature + " is not a feature of " + input.eClass()); //$NON-NLS-1$ //$NON-NLS-2$ + Assertions.fail("Feature " + feature + " is not a feature of " + input.eClass()); //$NON-NLS-1$ //$NON-NLS-2$ } final Object valueOfFeature = input.eGet(feature); return valueOfFeature != null && valueOfFeature.equals(value); diff --git a/com.avaloq.tools.ddk.xtext.test/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.xtext.test/META-INF/MANIFEST.MF index 2c06458a3e..ef98b20242 100644 --- a/com.avaloq.tools.ddk.xtext.test/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.xtext.test/META-INF/MANIFEST.MF @@ -28,7 +28,6 @@ Require-Bundle: com.avaloq.tools.ddk.xtext, org.eclipse.emf.ecore, junit-jupiter-api, junit-jupiter-engine, - junit-vintage-engine, junit-platform-suite-api, org.eclipse.xtext.testing, org.opentest4j diff --git a/com.avaloq.tools.ddk.xtext.test/pom.xml b/com.avaloq.tools.ddk.xtext.test/pom.xml index b94f0de796..50f58bb3ea 100644 --- a/com.avaloq.tools.ddk.xtext.test/pom.xml +++ b/com.avaloq.tools.ddk.xtext.test/pom.xml @@ -17,6 +17,7 @@ tycho-surefire-plugin ${tycho.version} + junit5 false false ${test.testClass} @@ -49,8 +50,8 @@ 0.0.0 - eclipse-feature - org.eclipse.pde + eclipse-plugin + org.eclipse.pde.junit.runtime 0.0.0 diff --git a/ddk-configuration/launches/devkit-run.launch b/ddk-configuration/launches/devkit-run.launch index 0229f0ddcc..da20fcf741 100644 --- a/ddk-configuration/launches/devkit-run.launch +++ b/ddk-configuration/launches/devkit-run.launch @@ -269,7 +269,6 @@ - @@ -293,7 +292,6 @@ - diff --git a/ddk-target/ddk.target b/ddk-target/ddk.target index a2ade38df0..cb1c3b8372 100644 --- a/ddk-target/ddk.target +++ b/ddk-target/ddk.target @@ -6,15 +6,17 @@ - - - - - + + + + + + + @@ -42,27 +44,924 @@ - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file