From 61ccb9283ad7d5d689a08d1f6c2ce10be7349749 Mon Sep 17 00:00:00 2001 From: Caideyipi <87789683+Caideyipi@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:38:49 +0800 Subject: [PATCH] Update IoTDBSimpleQueryIT.java --- .../iotdb/db/it/IoTDBSimpleQueryIT.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java index 19b487193834..e7bf18b4fd8f 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java @@ -1041,25 +1041,23 @@ public void testInvalidMaxPointNumber() { @Test public void testStorageGroupWithHyphenInName() { - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { statement.setFetchSize(5); statement.execute("CREATE DATABASE root.group_with_hyphen"); - } catch (SQLException e) { + } catch (final SQLException e) { fail(); } - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { - try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES")) { - ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { + try (final ResultSet resultSet = statement.executeQuery("SHOW DATABASES DETAILS")) { while (resultSet.next()) { - StringBuilder builder = new StringBuilder(); - builder.append(resultSet.getString(1)); - Assert.assertEquals(builder.toString(), "root.group_with_hyphen"); + Assert.assertEquals("root.group_with_hyphen", resultSet.getString(1)); + Assert.assertEquals("TREE", resultSet.getString(12)); } } - } catch (SQLException e) { + } catch (final SQLException e) { fail(); } }