This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-3 by this push:
new 7c853cfddc9 HBASE-29927 Upgrade hbase-external-blockcache to use
junit5 (#7802)
7c853cfddc9 is described below
commit 7c853cfddc99bb2d2890030cbd741a308bf2e3ae
Author: Liu Xiao <[email protected]>
AuthorDate: Tue Mar 3 22:30:57 2026 +0800
HBASE-29927 Upgrade hbase-external-blockcache to use junit5 (#7802)
Signed-off-by: Duo Zhang <[email protected]>
(cherry picked from commit 9cf99a49a9f602eb5a86803f78aef64f11169fd1)
---
hbase-external-blockcache/pom.xml | 7 -------
.../hbase/io/hfile/TestMemcachedBlockCache.java | 24 ++++++++--------------
.../hadoop/hbase/io/hfile/CacheTestUtils.java | 12 +++++------
3 files changed, 15 insertions(+), 28 deletions(-)
diff --git a/hbase-external-blockcache/pom.xml
b/hbase-external-blockcache/pom.xml
index 090546b68da..80282e3fc37 100644
--- a/hbase-external-blockcache/pom.xml
+++ b/hbase-external-blockcache/pom.xml
@@ -116,14 +116,7 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
- <!--REMOVE-->
-
<build>
<plugins>
<plugin>
diff --git
a/hbase-external-blockcache/src/test/java/org/apache/hadoop/hbase/io/hfile/TestMemcachedBlockCache.java
b/hbase-external-blockcache/src/test/java/org/apache/hadoop/hbase/io/hfile/TestMemcachedBlockCache.java
index 60370f5208b..30d369ed2b6 100644
---
a/hbase-external-blockcache/src/test/java/org/apache/hadoop/hbase/io/hfile/TestMemcachedBlockCache.java
+++
b/hbase-external-blockcache/src/test/java/org/apache/hadoop/hbase/io/hfile/TestMemcachedBlockCache.java
@@ -17,9 +17,9 @@
*/
package org.apache.hadoop.hbase.io.hfile;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
@@ -44,29 +44,24 @@ import net.spy.memcached.ops.OperationState;
import net.spy.memcached.ops.OperationStatus;
import net.spy.memcached.transcoders.Transcoder;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.Waiter;
import org.apache.hadoop.hbase.io.hfile.CacheTestUtils.HFileBlockPair;
import org.apache.hadoop.hbase.testclassification.IOTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
-@Category({ IOTests.class, SmallTests.class })
+@Tag(IOTests.TAG)
+@Tag(SmallTests.TAG)
public class TestMemcachedBlockCache {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestMemcachedBlockCache.class);
-
private MemcachedBlockCache cache;
private ConcurrentMap<String, CachedData> backingMap;
- @Before
+ @BeforeEach
public void setup() throws Exception {
int port = ThreadLocalRandom.current().nextInt(1024, 65536);
Configuration conf = new Configuration();
@@ -153,5 +148,4 @@ public class TestMemcachedBlockCache {
}
Waiter.waitFor(new Configuration(), 10000, () -> backingMap.size() == 0);
}
-
}
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
index 6125aab157d..89b8414fc6b 100644
---
a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
+++
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
@@ -17,12 +17,12 @@
*/
package org.apache.hadoop.hbase.io.hfile;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import java.io.IOException;
import java.nio.ByteBuffer;