HBASE-30067 Upgrade hbase-server to use junit5 Part10 (#8121)#8136
Merged
Conversation
Signed-off-by: Duo Zhang <zhangduo@apache.org> (cherry picked from commit 73f8114)
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Migrates a large set of HBase server/RSGroup tests from JUnit 4 to JUnit 5 (Jupiter), including updates for lifecycle annotations, assertions, parameterized execution, and shared test utilities.
Changes:
- Replaced JUnit4 annotations/rules/categories with JUnit5 equivalents (
@BeforeEach/@BeforeAll,@Tag,Assertions.*,assertThrows, etc.). - Converted several parameterized tests to use
@HBaseParameterizedTestTemplate+@TestTemplateand Stream-based parameter sources. - Introduced
AbstractTestRpcServerto share common RPC server test logic across multiple test classes.
Reviewed changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java | JUnit5 migration; switches to Jupiter assertions and assertThrows usage for quota tests. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestRSMobFileCleanerChore.java | JUnit5 migration with @BeforeEach/@AfterEach and @Tag. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobWithByteBuffAllocator.java | JUnit5 migration; replaces Assert.* with Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobUtils.java | JUnit5 migration; adjusts helper to accept method-name string instead of JUnit4 TestName. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java | JUnit5 migration; replaces TestName rule with TestInfo and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreCompaction.java | Converts parameterized test to @HBaseParameterizedTestTemplate + @TestTemplate, updates assertions and test naming. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java | JUnit5 migration with @BeforeEach and @Tag. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileLink.java | JUnit5 migration; uses TestInfo injection and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCleanupUtil.java | JUnit5 migration; lifecycle annotations updated. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java | JUnit5 migration; lifecycle annotations updated. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java | JUnit5 migration; uses TestInfo for per-test naming. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java | JUnit5 migration; swaps @BeforeClass/@AfterClass for @BeforeAll/@AfterAll. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithException.java | JUnit5 migration; uses TestInfo for table naming. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithDefaults.java | Converts parameterized test to @HBaseParameterizedTestTemplate + @TestTemplate, updates assertions and naming. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionRegularRegionBatchMode.java | JUnit5 migration; hooks into superclass JUnit5 setup with TestInfo. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionOptRegionBatchMode.java | JUnit5 migration; hooks into superclass JUnit5 setup with TestInfo. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionOptMode.java | JUnit5 migration; adds @HBaseParameterizedTestTemplate and @Tag. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleanerChore.java | JUnit5 migration; replaces category with multiple @Tags. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java | JUnit5 migration; lifecycle annotations updated and assertions reordered. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java | Converts parameterized test to template-based Jupiter parameterization; updates assertions and naming. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java | JUnit5 migration; switches to Jupiter assertions including assertNull. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobTestUtil.java | Replaces JUnit4 Assert usage with Jupiter assertions inside shared test helper. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcServer.java | Refactors to extend new shared AbstractTestRpcServer and migrate to JUnit5. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java | JUnit5 migration; replaces TestName rule with TestInfo. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestServerCall.java | JUnit5 migration; updates assertions and lifecycle. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSecurityRpcSentBytesMetrics.java | JUnit5 migration; replaces category with @Tag and lifecycle annotations. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSecureSimpleRpcServer.java | Refactors to extend AbstractTestRpcServer; updates secure setup/teardown to JUnit5. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSecureNettyRpcServer.java | Converts to template-based parameterization and JUnit5 lifecycle. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcSkipInitialSaslHandshake.java | JUnit5 migration; replaces category with @Tag and lifecycle annotations. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcServerTraceLogging.java | JUnit5 migration; replaces category with @Tag and lifecycle annotations. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcServerSlowConnectionSetup.java | Converts parameterized test to JUnit5 template + Stream parameters. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java | JUnit5 migration; replaces category with @Tag. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcHandlerException.java | Converts parameterized test to JUnit5 template + Stream parameters. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java | JUnit5 migration; uses TestInfo instead of TestName. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRWQueueRpcExecutor.java | JUnit5 migration; uses TestInfo instead of TestName. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestProtoBufRpc.java | Converts parameterized test to JUnit5 template and uses assertThrows. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java | Converts parameterized test to JUnit5 template; adds per-allocator table name generation. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyIPCCloseConnection.java | JUnit5 migration; lifecycle annotations updated. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyChannelWritability.java | JUnit5 migration; replaces category with @Tag. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestMultipleServerPrincipalsIPC.java | Converts parameterized test to JUnit5 template + Stream parameters. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestMasterFifoRpcScheduler.java | JUnit5 migration; replaces category with @Tag and lifecycle annotations. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestHBaseClient.java | JUnit5 migration; replaces Assert.* with Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestFifoRpcScheduler.java | JUnit5 migration; replaces category with @Tag and lifecycle annotations. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestCallRunner.java | JUnit5 migration; swaps OpenTelemetry JUnit4 rule for JUnit5 extension. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestBufferChain.java | JUnit5 migration; lifecycle annotations updated. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestRpcServer.java | New shared base class encapsulating common RPC server test logic for Jupiter tests. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestUpdateRSGroupConfiguration.java | JUnit5 migration; uses TestInfo to feed base setup and replaces @Ignore with @Disabled. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestTableDescriptorWithRSGroup.java | JUnit5 migration; uses TestInfo for base per-test setup and updates assertions. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java | JUnit5 migration; replaces category with @Tag and lifecycle annotations. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java | JUnit5 migration; refactors to extend TestRSGroupsBase and uses TestInfo. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java | JUnit5 migration; integrates TestInfo-based base setup/teardown. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsFallback.java | JUnit5 migration; integrates TestInfo-based base setup/teardown. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBasics.java | JUnit5 migration; integrates TestInfo-based base setup/teardown. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java | Replaces JUnit4 TestName rule with a TestInfo-driven mechanism for per-test naming. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBalance.java | JUnit5 migration; integrates TestInfo-based base setup/teardown. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java | JUnit5 migration; integrates TestInfo-based base setup and updates assertions. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin1.java | JUnit5 migration; integrates TestInfo-based base setup and updates assertions. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMappingScript.java | JUnit5 migration; replaces Assert with Jupiter assertions and lifecycle annotations. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupConfig.java | JUnit5 migration; switches per-test naming to TestInfo. |
| hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestEnableRSGroups.java | Refactors test into an abstract base for JUnit5 lifecycle (but introduces a class/file naming mismatch). |
| hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupUtil.java | Removes trailing whitespace-only line. |
Comments suppressed due to low confidence (2)
hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java:1
- Typo in assertion message: 'Intial' should be 'Initial'.
hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java:1 - Typo in assertion message: 'Intial' should be 'Initial'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Duo Zhang zhangduo@apache.org
(cherry picked from commit 73f8114)