Skip to content

Migrate OpenProjectExplorerFolderTest to JUnit 5#22

Closed
vogella wants to merge 1 commit into
masterfrom
migrate-openprojectexplorerfolder-junit5
Closed

Migrate OpenProjectExplorerFolderTest to JUnit 5#22
vogella wants to merge 1 commit into
masterfrom
migrate-openprojectexplorerfolder-junit5

Conversation

@vogella
Copy link
Copy Markdown
Owner

@vogella vogella commented May 15, 2026

Drop the JUnit 4 PerformanceTestCaseJunit4 base class and use the established Jupiter pattern with UIPerformanceTestRule registered as an extension and an explicit PerformanceMeter, mirroring CollatorPerformanceTest and the recently migrated ProblemsViewPerformanceTest in this bundle. The scenario id is derived from the class name and the Jupiter TestInfo display name, and the meter is disposed in a finally block.

Drop the JUnit 4 PerformanceTestCaseJunit4 base class and use the
established Jupiter pattern with UIPerformanceTestRule and an explicit
PerformanceMeter, mirroring CollatorPerformanceTest and the recently
migrated ProblemsViewPerformanceTest in this bundle.
@vogella vogella closed this May 15, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the OpenProjectExplorerFolderTest from JUnit 4 to JUnit 5. The changes involve replacing the PerformanceTestCaseJunit4 base class with manual PerformanceMeter management and updating test annotations. Feedback suggests using testInfo.getTestMethod().get().getName() for the scenario ID to ensure consistency with historical performance tracking data and restoring the public and final modifiers to the uiPerformanceTestRule extension.

read = zis.read(b);
public void testOpenNavigatorFolder(TestInfo testInfo) {
Performance perf = Performance.getDefault();
String scenarioId = getClass().getName() + "." + testInfo.getDisplayName();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Using testInfo.getDisplayName() will change the performance scenario ID by including parentheses (e.g., testOpenNavigatorFolder()), whereas the JUnit 4 version used only the method name. This change will likely break performance trend tracking in the build system as the ID will no longer match historical data. It is recommended to use testInfo.getTestMethod().get().getName() to maintain the exact same scenario ID as before.

Suggested change
String scenarioId = getClass().getName() + "." + testInfo.getDisplayName();
String scenarioId = getClass().getName() + "." + testInfo.getTestMethod().get().getName();

Comment on lines +68 to +69
@RegisterExtension
static UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The uiPerformanceTestRule field should remain public and final to match the original JUnit 4 implementation and follow best practices for registered extensions. This ensures the extension is not accidentally modified and remains accessible if needed by the framework or other tests.

Suggested change
@RegisterExtension
static UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule();
@RegisterExtension
public static final UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule();

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