Migrate OpenProjectExplorerFolderTest to JUnit 5#22
Conversation
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
| String scenarioId = getClass().getName() + "." + testInfo.getDisplayName(); | |
| String scenarioId = getClass().getName() + "." + testInfo.getTestMethod().get().getName(); |
| @RegisterExtension | ||
| static UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule(); |
There was a problem hiding this comment.
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.
| @RegisterExtension | |
| static UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule(); | |
| @RegisterExtension | |
| public static final UIPerformanceTestRule uiPerformanceTestRule = new UIPerformanceTestRule(); |
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.