You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ap...@apache.org on 2024/05/30 10:31:40 UTC
(ignite-3) branch main updated: IGNITE-22368 JDBC integration tests don't close the connection (#3836)
This is an automated email from the ASF dual-hosted git repository.
apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new e4c4da4adc IGNITE-22368 JDBC integration tests don't close the connection (#3836)
e4c4da4adc is described below
commit e4c4da4adc949364fa663bf53699d3c2052c9726
Author: Vadim Pakhnushev <86...@users.noreply.github.com>
AuthorDate: Thu May 30 13:31:35 2024 +0300
IGNITE-22368 JDBC integration tests don't close the connection (#3836)
---
.../internal/jdbc/ItJdbcMetadataSelfTest.java | 40 +++++++++-------------
1 file changed, 16 insertions(+), 24 deletions(-)
diff --git a/modules/jdbc/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcMetadataSelfTest.java b/modules/jdbc/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcMetadataSelfTest.java
index 1d86af8e8c..f6bac123ea 100644
--- a/modules/jdbc/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcMetadataSelfTest.java
+++ b/modules/jdbc/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcMetadataSelfTest.java
@@ -72,8 +72,6 @@ public class ItJdbcMetadataSelfTest extends AbstractJdbcSelfTest {
@Test
public void testNullValuesMetaData() throws Exception {
- Statement stmt = DriverManager.getConnection(URL).createStatement();
-
ResultSet rs = stmt.executeQuery(
"select NULL, substring(null, 1, 2)");
@@ -96,8 +94,6 @@ public class ItJdbcMetadataSelfTest extends AbstractJdbcSelfTest {
@Test
public void testResultSetMetaData() throws Exception {
- Statement stmt = DriverManager.getConnection(URL).createStatement();
-
ResultSet rs = stmt.executeQuery(
"select p.name, o.id as orgId, p.age from PERSON p, ORGANIZATION o where p.orgId = o.id");
@@ -267,9 +263,7 @@ public class ItJdbcMetadataSelfTest extends AbstractJdbcSelfTest {
}
private void createMetaTable() {
- try (Connection conn = DriverManager.getConnection(URL);
- Statement stmt = conn.createStatement();
- ) {
+ try {
StringJoiner joiner = new StringJoiner(",");
// Add columns with All supported types.
@@ -655,23 +649,21 @@ public class ItJdbcMetadataSelfTest extends AbstractJdbcSelfTest {
* @param invalidCat catalog name that is not either
*/
private void checkNoEntitiesFoundForCatalog(String invalidCat) throws SQLException {
- try (Connection conn = DriverManager.getConnection(URL)) {
- DatabaseMetaData meta = conn.getMetaData();
-
- // Intention: we set the other arguments that way, the values to have as many results as possible.
- assertIsEmpty(meta.getTables(invalidCat, null, "%", new String[]{"TABLE"}));
- assertIsEmpty(meta.getColumns(invalidCat, null, "%", "%"));
- assertIsEmpty(meta.getColumnPrivileges(invalidCat, "pers", "PERSON", "%"));
- assertIsEmpty(meta.getTablePrivileges(invalidCat, null, "%"));
- assertIsEmpty(meta.getPrimaryKeys(invalidCat, "pers", "PERSON"));
- assertIsEmpty(meta.getImportedKeys(invalidCat, "pers", "PERSON"));
- assertIsEmpty(meta.getExportedKeys(invalidCat, "pers", "PERSON"));
- // meta.getCrossReference(...) doesn't make sense because we don't have FK constraint.
- assertIsEmpty(meta.getIndexInfo(invalidCat, null, "%", false, true));
- assertIsEmpty(meta.getSuperTables(invalidCat, "%", "%"));
- assertIsEmpty(meta.getSchemas(invalidCat, null));
- assertIsEmpty(meta.getPseudoColumns(invalidCat, null, "%", ""));
- }
+ DatabaseMetaData meta = conn.getMetaData();
+
+ // Intention: we set the other arguments that way, the values to have as many results as possible.
+ assertIsEmpty(meta.getTables(invalidCat, null, "%", new String[]{"TABLE"}));
+ assertIsEmpty(meta.getColumns(invalidCat, null, "%", "%"));
+ assertIsEmpty(meta.getColumnPrivileges(invalidCat, "pers", "PERSON", "%"));
+ assertIsEmpty(meta.getTablePrivileges(invalidCat, null, "%"));
+ assertIsEmpty(meta.getPrimaryKeys(invalidCat, "pers", "PERSON"));
+ assertIsEmpty(meta.getImportedKeys(invalidCat, "pers", "PERSON"));
+ assertIsEmpty(meta.getExportedKeys(invalidCat, "pers", "PERSON"));
+ // meta.getCrossReference(...) doesn't make sense because we don't have FK constraint.
+ assertIsEmpty(meta.getIndexInfo(invalidCat, null, "%", false, true));
+ assertIsEmpty(meta.getSuperTables(invalidCat, "%", "%"));
+ assertIsEmpty(meta.getSchemas(invalidCat, null));
+ assertIsEmpty(meta.getPseudoColumns(invalidCat, null, "%", ""));
}
/**