Skip to content

Commit

Permalink
Add skip execute query method in general dql E2E
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingZC committed Dec 24, 2024
1 parent cf0b19a commit 369012f
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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();
Expand Down Expand Up @@ -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()) {
Expand All @@ -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();
Expand Down

0 comments on commit 369012f

Please sign in to comment.