File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
clickhouse-client/src/main/java/com/clickhouse/client/config
jdbc-v2/src/test/java/com/clickhouse/jdbc/metadata Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -532,7 +532,17 @@ public static String readVersionFromResource(String resourceFilePath) {
532532 tmpVersion = tmp ;
533533 }
534534 } catch (Exception e ) {
535- // ignore
535+ try (InputStream in = ClickHouseClientOption .class .getClassLoader ().getResourceAsStream (resourceFilePath )) {
536+ Properties p = new Properties ();
537+ p .load (in );
538+
539+ String tmp = p .getProperty ("version" );
540+ if (tmp != null && !tmp .isEmpty () && !tmp .equals ("${revision}" )) {
541+ tmpVersion = tmp ;
542+ }
543+ } catch (Exception ee ) {
544+ // ignore
545+ }
536546 }
537547 return tmpVersion ;
538548 }
Original file line number Diff line number Diff line change 2424import java .util .Properties ;
2525import java .util .Set ;
2626
27- import static org .testng .Assert .assertEquals ;
28- import static org .testng .Assert .assertFalse ;
29- import static org .testng .Assert .assertNull ;
30- import static org .testng .Assert .assertTrue ;
31-
27+ import static org .testng .Assert .*;
3228
3329
3430public class DatabaseMetaDataTest extends JdbcIntegrationTest {
@@ -315,4 +311,13 @@ public void testGetClientInfoProperties() throws Exception {
315311 }
316312 }
317313 }
314+
315+ @ Test (groups = { "integration" })
316+ public void testGetDriverVersion () throws Exception {
317+ try (Connection conn = getJdbcConnection ()) {
318+ DatabaseMetaData dbmd = conn .getMetaData ();
319+ String version = dbmd .getDriverVersion ();
320+ assertNotEquals (version , "unknown" );
321+ }
322+ }
318323}
You can’t perform that action at this time.
0 commit comments