Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Nov 4, 2025

This commit migrates the CloseTestWindowsRule from JUnit 4 to JUnit 5 by creating a new CloseTestWindowsExtension and updating all tests that use it.

Changes:

  • Created CloseTestWindowsExtension as a JUnit 5 extension implementing BeforeEachCallback and AfterEachCallback interfaces
  • Updated UITestCase to use JUnit 5 annotations and CloseTestWindowsExtension
  • Migrated 123 test files from using @rule CloseTestWindowsRule to @ExtendWith(CloseTestWindowsExtension.class)
  • Updated all test annotations from JUnit 4 to JUnit 5:
  • Updated imports from org.junit.* to org.junit.jupiter.api.*
  • Updated assertions from org.junit.Assert to org.junit.jupiter.api.Assertions
  • Marked CloseTestWindowsRule as @deprecated to guide users to the new extension

Affected test bundles:

  • org.eclipse.ui.tests.harness
  • org.eclipse.ui.tests.navigator
  • org.eclipse.ui.tests.performance
  • org.eclipse.ui.tests

All test files now use JUnit 5 extension mechanism for window cleanup.

This commit migrates the CloseTestWindowsRule from JUnit 4 to JUnit 5
by creating a new CloseTestWindowsExtension and updating all tests that
use it.

Changes:
- Created CloseTestWindowsExtension as a JUnit 5 extension implementing
  BeforeEachCallback and AfterEachCallback interfaces
- Updated UITestCase to use JUnit 5 annotations and CloseTestWindowsExtension
- Migrated 123 test files from using @rule CloseTestWindowsRule to
  @ExtendWith(CloseTestWindowsExtension.class)
- Updated all test annotations from JUnit 4 to JUnit 5:
  * @before -> @beforeeach
  * @after -> @AfterEach
  * @ignore -> @disabled
  * @BeforeClass -> @BeforeAll
  * @afterclass -> @afterall
- Updated imports from org.junit.* to org.junit.jupiter.api.*
- Updated assertions from org.junit.Assert to org.junit.jupiter.api.Assertions
- Marked CloseTestWindowsRule as @deprecated to guide users to the new extension

Affected test bundles:
- org.eclipse.ui.tests.harness
- org.eclipse.ui.tests.navigator
- org.eclipse.ui.tests.performance
- org.eclipse.ui.tests

All test files now use JUnit 5 extension mechanism for window cleanup.
@vogella vogella marked this pull request as draft November 4, 2025 21:30
@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

tests/org.eclipse.ui.tests.harness/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From c9c053f4cd3525a5151708a7605fe9d38289b9ef Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Tue, 4 Nov 2025 21:39:50 +0000
Subject: [PATCH] Version bump(s) for 4.38 stream


diff --git a/tests/org.eclipse.ui.tests.harness/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests.harness/META-INF/MANIFEST.MF
index 259fee3e99..8cdb2f2c5f 100644
--- a/tests/org.eclipse.ui.tests.harness/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.ui.tests.harness/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Harness Plug-in
 Bundle-SymbolicName: org.eclipse.ui.tests.harness;singleton:=true
-Bundle-Version: 1.10.600.qualifier
+Bundle-Version: 1.10.700.qualifier
 Eclipse-BundleShape: dir
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
-- 
2.51.2

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Test Results

1 134 files   -  1 884  1 134 suites   - 1 884   17m 54s ⏱️ - 2h 0m 12s
3 538 tests  -  4 696  3 521 ✅  -  4 464  17 💤  - 232  0 ❌ ±0 
9 621 runs   - 14 001  9 564 ✅  - 13 264  57 💤  - 737  0 ❌ ±0 

Results for commit 0e8c631. ± Comparison against base commit 9c171a0.

This pull request removes 4696 tests.
AllTests AllActionTests ContributionItemTest ‑ testForceModeText
AllTests AllActionTests ContributionItemTest ‑ testParentLink
AllTests AllActionTests CoolBarManagerTest ‑ testResetItemOrderBug293433
AllTests AllActionTests MenuManagerTest ‑ testAddingConcreteItemToMenuWithNoConcreteVisibleItems
AllTests AllActionTests MenuManagerTest ‑ testDisposedMenuIsDirty
AllTests AllActionTests MenuManagerTest ‑ testEmptyMenuManagerNPE
AllTests AllActionTests MenuManagerTest ‑ testMenuWithNoConcreteVisibleItemsIsHidden
AllTests AllActionTests ToolBarManagerTest ‑ testActionImagesAreSet
AllTests AllActionTests ToolBarManagerTest ‑ testControlContributionIsSet
AllTests AllActionTests ToolBarManagerTest ‑ testCreateControlWhenParentNull
…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants