From 916be38d4b908f8a98a44adbeee40cd562f39bbe Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Fri, 15 May 2026 14:02:37 +0200 Subject: [PATCH] Migrate ProblemsViewPerformanceTest to JUnit 5 Migrate the JUnit 4 PerformanceTestCaseJunit4 base class to its JUnit 5 counterpart PerformanceTestCaseJunit5, which manages the PerformanceMeter via @BeforeEach/@AfterEach, and replace CloseTestWindowsRule with CloseTestWindowsExtension. --- .../ProblemsViewPerformanceTest.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java b/tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java index a4fd01f2b69..74bd0a5c4c7 100644 --- a/tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java +++ b/tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java @@ -16,7 +16,7 @@ import static org.eclipse.ui.tests.harness.util.UITestUtil.openTestWindow; import static org.eclipse.ui.tests.harness.util.UITestUtil.processEvents; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.util.HashMap; import java.util.Map; @@ -26,25 +26,28 @@ import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; -import org.eclipse.test.performance.PerformanceTestCaseJunit4; +import org.eclipse.test.performance.PerformanceTestCaseJunit5; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; -import org.eclipse.ui.tests.harness.util.CloseTestWindowsRule; +import org.eclipse.ui.tests.harness.util.CloseTestWindowsExtension; import org.eclipse.ui.tests.performance.parts.PerformanceProblemsView; import org.eclipse.ui.texteditor.MarkerUtilities; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; /** * The ProblemsViewPerformanceTest is a test of population of the problems view. * * @since 3.2 */ -public class ProblemsViewPerformanceTest extends PerformanceTestCaseJunit4 { +public class ProblemsViewPerformanceTest extends PerformanceTestCaseJunit5 { - @Rule - public final CloseTestWindowsRule closeTestWindows = new CloseTestWindowsRule(); + @RegisterExtension + static UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule(); + + @RegisterExtension + CloseTestWindowsExtension closeTestWindows = new CloseTestWindowsExtension(); private final String EMPTY_PERSPECTIVE_ID = "org.eclipse.ui.tests.harness.util.EmptyPerspective"; @@ -81,7 +84,6 @@ public void testPopulation() { } commitMeasurements(); assertPerformance(); - } /**