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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7a681d5  PHOENIX-7266 Fix SSLConfigDir in ITs (#150)
7a681d5 is described below

commit 7a681d53ab5afbba79ad8e840914f10e1b063bce
Author: Aron Meszaros <[email protected]>
AuthorDate: Tue Feb 10 16:06:24 2026 +0100

    PHOENIX-7266 Fix SSLConfigDir in ITs (#150)
---
 .../org/apache/phoenix/end2end/QueryServerEnvironment.java  |  2 +-
 .../phoenix/end2end/SecureQueryServerPhoenixDBIT.java       |  2 +-
 .../src/it/java/org/apache/phoenix/end2end/TlsUtil.java     | 13 ++++---------
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git 
a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
 
b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
index 9a24ce4..7eafc62 100644
--- 
a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
+++ 
b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
@@ -178,7 +178,7 @@ public class QueryServerEnvironment {
         // Generate SSL certs
         File keystoresDir = new 
File(UTIL.getDataTestDir("keystore").toUri().getPath());
         keystoresDir.mkdirs();
-        String sslConfDir = 
TlsUtil.getClasspathDir(QueryServerEnvironment.class);
+        String sslConfDir = TlsUtil.TEST_CLASSES_DIR.getPath();
         TlsUtil.setupSSLConfig(keystoresDir.getAbsolutePath(), sslConfDir, 
conf, false);
 
         // Magic flag to tell hdfs to not fail on using ports above 1024
diff --git 
a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
 
b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
index 8ba86be..099b145 100644
--- 
a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
+++ 
b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
@@ -158,7 +158,7 @@ public class SecureQueryServerPhoenixDBIT {
         // Generate SSL certs
         File keystoresDir = new 
File(UTIL.getDataTestDir("keystore").toUri().getPath());
         keystoresDir.mkdirs();
-        String sslConfDir = 
TlsUtil.getClasspathDir(SecureQueryServerPhoenixDBIT.class);
+        String sslConfDir = TlsUtil.TEST_CLASSES_DIR.getPath();
         TlsUtil.setupSSLConfig(keystoresDir.getAbsolutePath(), sslConfDir, 
conf, false);
 
         // Magic flag to tell hdfs to not fail on using ports above 1024
diff --git 
a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/TlsUtil.java 
b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/TlsUtil.java
index 1261425..bcb950b 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/TlsUtil.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/TlsUtil.java
@@ -51,6 +51,10 @@ public class TlsUtil {
     protected static final String TARGET_DIR_NAME = 
System.getProperty("target.dir", "target");
     protected static final File TARGET_DIR =
             new File(System.getProperty("user.dir"), TARGET_DIR_NAME);
+    protected static final String TEST_CLASSES_DIR_NAME =
+            System.getProperty("test-classes.dir", "test-classes");
+    public static final File TEST_CLASSES_DIR =
+            new File(TARGET_DIR, TEST_CLASSES_DIR_NAME);
     protected static final File KEYSTORE = new File(TARGET_DIR, 
"avatica-test-ks.jks");
     protected static final File TRUSTSTORE = new File(TARGET_DIR, 
"avatica-test-ts.jks");
 
@@ -142,15 +146,6 @@ public class TlsUtil {
         return cert;
     }
 
-    public static String getClasspathDir(Class<?> klass) throws Exception {
-        String file = klass.getName();
-        file = file.replace('.', '/') + ".class";
-        URL url = 
Thread.currentThread().getContextClassLoader().getResource(file);
-        String baseDir = url.toURI().getPath();
-        baseDir = baseDir.substring(0, baseDir.length() - file.length() - 1);
-        return baseDir;
-    }
-
     /**
      * Performs complete setup of SSL configuration in preparation for testing 
an
      * SSLFactory.  This includes keys, certs, keystores, truststores, the 
server

Reply via email to