-
Notifications
You must be signed in to change notification settings - Fork 227
Migrate org.eclipse.ui.tests.navigator from JUnit 4 to JUnit 5 #3500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate org.eclipse.ui.tests.navigator from JUnit 4 to JUnit 5 #3500
Conversation
9ae2db3 to
d36f069
Compare
d36f069 to
e3000ef
Compare
|
Can you please make the title meaningful? |
|
Please do not review drafts |
I agree with @HannesWell that a PR (regardless of its status) should have a meaningful title and PR description. If you just want to dump some code, just push it to your fork and enable actions for it so you get (except Jenkins) the same checks as when open a PR. Then when it is ready simply close the PR in your fork and reopen a new on against the base repository. We are already approaching 100 open PRs soon and having ones with unclear status and scope does not really help. I now generated a description with copilot and leave the title to you as the author... |
|
Fun fact: Today I received multiple reviews for my draft PR but none for my none draft reviews. |
I'm now looking into my draft review, please do not change it. |
068952c to
633b9d4
Compare
Convert JUnit 4 style assertions (message-first) to JUnit 5 style (message-last) in the following test files: - FirstClassM1Tests.java - GoBackForwardsTest.java - INavigatorContentServiceTests.java This completes the assertion parameter order fixes for PR eclipse-platform#3500.
633b9d4 to
286d18e
Compare
Complete the JUnit 4 to JUnit 5 assertion parameter order migration: - SorterTest.java: Fix 1 assertEquals call - WorkingSetTest.java: Fix 11 assertTrue and assertEquals calls - JstPipelineTest.java: Fix 2 assertEquals and 1 assertTrue call - FoldersAsProjectsContributionTest.java: Fix 6 assertFalse and 2 assertTrue calls - NestedResourcesTests.java: Fix 3 assertTrue calls - PathComparatorTest.java: Fix 1 assertTrue call - ResourceMgmtActionProviderTests.java: Fix 1 assertTrue call All assertions now follow JUnit 5 convention with message parameter last. This resolves all remaining compilation errors in PR eclipse-platform#3500.
This commit migrates the entire org.eclipse.ui.tests.navigator test suite from JUnit 4 to JUnit 5, modernizing the test infrastructure and improving test reliability with better resource management. JUnit 5 Migration Changes: - Updated all test annotations (@before → @beforeeach, @after → @AfterEach, @ignore → @disabled) - Migrated static imports from org.junit.Assert to org.junit.jupiter.api.Assertions - Replaced CloseTestWindowsRule (JUnit 4) with inline window management: - Added @AfterEach tearDown() method - Inlined window listener and shell tracking logic - This avoids needing to add JUnit 5 dependencies to the test harness bundle - Fixed all assertion parameter orders from JUnit 4 style (message-first) to JUnit 5 style (message-last): * assertEquals(message, expected, actual) → assertEquals(expected, actual, message) * assertTrue(message, condition) → assertTrue(condition, message) * assertFalse(message, condition) → assertFalse(condition, message) Test Infrastructure Improvements: manages UI test windows and shell cleanup, replacing the previous JUnit 4 rule-based approach - Updated GoBackForwardsTest to use @RegisterExtension with the new extension - Ensures better test isolation by cleaning up leaked shells between tests Benefits: - Uses modern JUnit 5 features and best practices - Improved resource cleanup prevents test interference - Consistent with Eclipse platform's migration to JUnit 5 - Better test isolation and reliability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
286d18e to
d469ae8
Compare
This pull request migrates the test suite for the
org.eclipse.ui.tests.navigatorpackage from JUnit 4 to JUnit 5, modernizing the test codebase and improving test reliability with better resource cleanup between tests.JUnit 5 Migration
Annotation Updates
@Beforewith@BeforeEachlifecycle annotation@Afterwith@AfterEachlifecycle annotation@Testimports fromorg.junit.Testtoorg.junit.jupiter.api.Test@Ignoreto@Disabledwhere applicableAssertion Updates
org.junit.Asserttoorg.junit.jupiter.api.AssertionsassertEquals(message, expected, actual)→assertEquals(expected, actual, message)assertTrue(message, condition)→assertTrue(condition, message)assertFalse(message, condition)→assertFalse(condition, message)Files Updated
All test files in the navigator test suite were migrated, including:
Benefits
🤖 Generated with Claude Code