From 90b9eb879a5cedc94e43b0043a873147552bdaa0 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 22 Oct 2025 07:20:19 +0200 Subject: [PATCH 1/3] Migrate PluginWalkerTest from JUnit 4 to JUnit 5 in org.eclipse.ui.tests.pluginchecks --- .../META-INF/MANIFEST.MF | 7 ++++--- .../tests/pluginchecks/PluginWalkerTest.java | 20 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF index 10c5422f8ec..00bf6a4bf9c 100644 --- a/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF @@ -5,8 +5,7 @@ Bundle-SymbolicName: org.eclipse.ui.tests.pluginchecks;singleton:=true Bundle-Version: 1.2.400.qualifier Automatic-Module-Name: org.eclipse.ui.tests.pluginchecks Bundle-RequiredExecutionEnvironment: JavaSE-17 -Require-Bundle: org.junit;bundle-version="4.12.0", - org.eclipse.core.runtime;bundle-version="3.29.0", +Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0", org.eclipse.e4.ui.css.swt;bundle-version="0.13.200", org.eclipse.e4.ui.model.workbench;bundle-version="2.1.100", org.eclipse.e4.ui.workbench.swt;bundle-version="0.14.300", @@ -28,4 +27,6 @@ Require-Bundle: org.junit;bundle-version="4.12.0", org.eclipse.ui.monitoring;bundle-version="1.1.300" Bundle-ActivationPolicy: lazy Bundle-Vendor: Eclipse.org -Import-Package: org.eclipse.ui.internal +Import-Package: org.eclipse.ui.internal, + org.junit.jupiter.api;version="[5.14.0,6.0.0)", + org.junit.jupiter.api.function;version="[5.14.0,6.0.0)" diff --git a/tests/org.eclipse.ui.tests.pluginchecks/src/org/eclipse/ui/tests/pluginchecks/PluginWalkerTest.java b/tests/org.eclipse.ui.tests.pluginchecks/src/org/eclipse/ui/tests/pluginchecks/PluginWalkerTest.java index 8c4e2b85647..3c98fa3dbe4 100644 --- a/tests/org.eclipse.ui.tests.pluginchecks/src/org/eclipse/ui/tests/pluginchecks/PluginWalkerTest.java +++ b/tests/org.eclipse.ui.tests.pluginchecks/src/org/eclipse/ui/tests/pluginchecks/PluginWalkerTest.java @@ -14,9 +14,9 @@ package org.eclipse.ui.tests.pluginchecks; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.io.InputStream; @@ -37,8 +37,8 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.RegistryFactory; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; @@ -66,10 +66,10 @@ public class PluginWalkerTest { private BundleContext bundleContext; private List bundlesWithPluginXml; - @Before + @BeforeEach public void setup() throws Exception { Bundle bundle = FrameworkUtil.getBundle(PluginWalkerTest.class); - assertNotNull("Make sure you're running this as a plugin test", bundle); + assertNotNull(bundle, "Make sure you're running this as a plugin test"); assertNotNull(bundle); bundleContext = bundle.getBundleContext(); bundlesWithPluginXml = List.of("org.eclipse.e4.ui.css.swt", "org.eclipse.e4.ui.model.workbench", @@ -101,10 +101,8 @@ public void ensurePluginxmlContainsAtLeastOneEntry() throws Exception { boolean hasExtension = extensions.getLength() > 0; boolean hasExtensionPoint = extensionpoint.getLength() > 0; - assertTrue( - "plugin.xml from " + bundleSymbolicName - + " must contain at least one extension point or extension", - hasExtension || hasExtensionPoint); + assertTrue(hasExtension || hasExtensionPoint, "plugin.xml from " + bundleSymbolicName + + " must contain at least one extension point or extension"); } } From e43185b0342bbf60c46e701050fb5f126ae33bfd Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Wed, 22 Oct 2025 05:28:32 +0000 Subject: [PATCH 2/3] Version bump(s) for 4.38 stream --- tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF index 00bf6a4bf9c..82b6c51a31c 100644 --- a/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Pluginchecks Bundle-SymbolicName: org.eclipse.ui.tests.pluginchecks;singleton:=true -Bundle-Version: 1.2.400.qualifier +Bundle-Version: 1.2.500.qualifier Automatic-Module-Name: org.eclipse.ui.tests.pluginchecks Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0", From 40ab2c4b839d13c9c23ae08753f543b222004802 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Thu, 23 Oct 2025 14:27:29 +0200 Subject: [PATCH 3/3] Fix JUnit 5 migration in org.eclipse.ui.tests.pluginchecks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing JUnit platform imports to MANIFEST.MF that are required for JUnit 5 test execution. Without these imports, the test framework fails with: java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: org.junit.jupiter.engine.JupiterTestEngine not a subtype Added imports: - org.junit.platform.commons.function;version="[1.14.0,2.0.0)" - org.junit.platform.suite.api;version="[1.14.0,2.0.0)" These are standard imports required by all JUnit 5 test bundles in the platform.ui repository. Verified by comparing with other successfully migrated test bundles like org.eclipse.jface.tests. All 3 tests now pass: - validateAccessToBundle - ensurePluginxmlContainsAtLeastOneEntry - ensureExtensionPointClassesAreAccessable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF index 82b6c51a31c..2334d4900c4 100644 --- a/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF @@ -29,4 +29,6 @@ Bundle-ActivationPolicy: lazy Bundle-Vendor: Eclipse.org Import-Package: org.eclipse.ui.internal, org.junit.jupiter.api;version="[5.14.0,6.0.0)", - org.junit.jupiter.api.function;version="[5.14.0,6.0.0)" + org.junit.jupiter.api.function;version="[5.14.0,6.0.0)", + org.junit.platform.commons.function;version="[1.14.0,2.0.0)", + org.junit.platform.suite.api;version="[1.14.0,2.0.0)"