This is an automated email from the ASF dual-hosted git repository.

lokiore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f1f01224b PHOENIX-7495 :- ADDENDUM to fix tests with HBase 2.4 build 
(#2132)
1f1f01224b is described below

commit 1f1f01224b611b7ec4af25bddceaae969a356dd6
Author: Lokesh Khurana <khuranalokes...@gmail.com>
AuthorDate: Tue Apr 29 10:16:22 2025 -0700

    PHOENIX-7495 :- ADDENDUM to fix tests with HBase 2.4 build (#2132)
---
 .../java/org/apache/phoenix/jdbc/ClusterRoleRecordTest.java    | 10 ++++++++++
 .../org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java     |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/ClusterRoleRecordTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/ClusterRoleRecordTest.java
index ca1b6c559b..cb801f7d1d 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/ClusterRoleRecordTest.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/ClusterRoleRecordTest.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
 
 import java.io.File;
 import java.io.IOException;
@@ -35,8 +36,10 @@ import java.util.Optional;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.hadoop.hbase.util.VersionInfo;
 import org.apache.phoenix.jdbc.ClusterRoleRecord.ClusterRole;
 import org.apache.phoenix.util.JacksonUtil;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -85,6 +88,13 @@ public class ClusterRoleRecordTest {
         return file.getPath();
     }
 
+    @Before
+    public void setUp() throws Exception {
+        if (registryType == ClusterRoleRecord.RegistryType.RPC) {
+            assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(), 
"2.5.0")>=0);
+        }
+    }
+
     @Test
     public void testReadWriteJsonToFile() throws IOException {
         ClusterRoleRecord record = 
getClusterRoleRecord(testName.getMethodName(),
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java
index 1af2fd4180..9261c8f06f 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java
@@ -600,6 +600,7 @@ public class PhoenixEmbeddedDriverTest {
 
     @Test
     public void testRPCIPv6() throws SQLException{
+        assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(), 
"2.5.0")>=0);
         Configuration config = 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
         config.set("hbase.client.registry.impl",
                 "org.apache.hadoop.hbase.client.RpcConnectionRegistry");
@@ -697,7 +698,7 @@ public class PhoenixEmbeddedDriverTest {
                 props.get(HConstants.ZOOKEEPER_QUORUM));
         
assertEquals("127.23.45.678:12345,host987:12345,localhost:12345,v3:12345",
                 props.get(HConstants.CLIENT_ZOOKEEPER_QUORUM));
-
+        assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(), 
"2.5.0")>=0);
         connectionInfo = ConnectionInfo.create("jdbc:phoenix+rpc:"
                 + 
"localhost\\:2181,127.23.45.678\\:7634,v3\\:1,host123.48576\\:723::;"
                 + "test=true", null, null);

Reply via email to