From 369012f45e4ebebc697df77d8b80d2f1a11e0017 Mon Sep 17 00:00:00 2001 From: ZhangCheng Date: Tue, 24 Dec 2024 16:48:53 +0800 Subject: [PATCH] Add skip execute query method in general dql E2E --- .../test/e2e/engine/type/dql/GeneralDQLE2EIT.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java index 3fb3f146b528c..9379586c32fe8 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java @@ -65,8 +65,7 @@ private void assertExecuteQuery(final AssertionTestParameter testParam, final E2 private void assertExecuteQueryWithXmlExpected(final AssertionTestParameter testParam, final E2ETestContext context) throws SQLException { // TODO Fix jdbc adapter and empty_storage_units proxy adapter - if ("jdbc".equals(testParam.getAdapter()) && !"empty_storage_units".equalsIgnoreCase(testParam.getScenario()) - || "proxy".equals(testParam.getAdapter()) && "empty_storage_units".equalsIgnoreCase(testParam.getScenario())) { + if (isNeedSkipExecuteQueryWithXmlExcepted(testParam)) { return; } if (SQLExecuteType.LITERAL == context.getSqlExecuteType()) { @@ -76,6 +75,11 @@ private void assertExecuteQueryWithXmlExpected(final AssertionTestParameter test } } + private boolean isNeedSkipExecuteQueryWithXmlExcepted(final AssertionTestParameter testParam) { + return "jdbc".equals(testParam.getAdapter()) && !"empty_storage_units".equalsIgnoreCase(testParam.getScenario()) + || "proxy".equals(testParam.getAdapter()) && "empty_storage_units".equalsIgnoreCase(testParam.getScenario()); + } + private void assertQueryForStatementWithXmlExpected(final E2ETestContext context) throws SQLException { try ( Connection connection = getEnvironmentEngine().getTargetDataSource().getConnection(); @@ -161,7 +165,7 @@ private void assertExecute(final AssertionTestParameter testParam, final E2ETest private void assertExecuteWithXmlExpected(final AssertionTestParameter testParam, final E2ETestContext context) throws SQLException { // TODO Fix jdbc adapter - if ("jdbc".equals(testParam.getAdapter())) { + if (isNeedSkipExecuteWithXmlExcepted(testParam)) { return; } if (SQLExecuteType.LITERAL == context.getSqlExecuteType()) { @@ -171,6 +175,10 @@ private void assertExecuteWithXmlExpected(final AssertionTestParameter testParam } } + private boolean isNeedSkipExecuteWithXmlExcepted(final AssertionTestParameter testParam) { + return "jdbc".equals(testParam.getAdapter()); + } + private void assertExecuteForStatementWithXmlExpected(final E2ETestContext context) throws SQLException { try ( Connection connection = getEnvironmentEngine().getTargetDataSource().getConnection();