You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ch...@apache.org on 2025/07/07 07:45:15 UTC

(shardingsphere) branch master updated: Minor refactor for SQLStatementCompilerIT and TestCase (#35912)

This is an automated email from the ASF dual-hosted git repository.

chengzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 88070663c3a Minor refactor for SQLStatementCompilerIT and TestCase (#35912)
88070663c3a is described below

commit 88070663c3a236e20ca18d414561b5eaef29845f
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Mon Jul 7 15:45:08 2025 +0800

    Minor refactor for SQLStatementCompilerIT and TestCase (#35912)
---
 .../sqlfederation/compiler/compiler/it/SQLStatementCompilerIT.java  | 2 +-
 .../shardingsphere/sqlfederation/compiler/compiler/it/TestCase.java | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/SQLStatementCompilerIT.java b/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/SQLStatementCompilerIT.java
index 91d9a70d566..5c8b688d88c 100644
--- a/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/SQLStatementCompilerIT.java
+++ b/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/SQLStatementCompilerIT.java
@@ -234,7 +234,7 @@ class SQLStatementCompilerIT {
     void assertCompile(final TestCase testcase) {
         SQLStatement sqlStatement = sqlParserRule.getSQLParserEngine(TypedSPILoader.getService(DatabaseType.class, "MySQL")).parse(testcase.getSql(), false);
         String actual = sqlStatementCompiler.compile(sqlStatement, "MySQL").getPhysicalPlan().explain().replaceAll(System.lineSeparator(), " ");
-        assertThat(actual, is(testcase.getAssertion().getExpectedResult()));
+        assertThat(actual, is(testcase.getAssertion().iterator().next().getExpectedResult()));
     }
     
     private static class TestCaseArgumentsProvider implements ArgumentsProvider {
diff --git a/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/TestCase.java b/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/TestCase.java
index 88bee71830c..78116e7ca08 100644
--- a/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/TestCase.java
+++ b/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/compiler/it/TestCase.java
@@ -18,10 +18,13 @@
 package org.apache.shardingsphere.sqlfederation.compiler.compiler.it;
 
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * XML definition of test case.
  */
@@ -34,7 +37,8 @@ public final class TestCase {
     private String sql;
     
     @JacksonXmlProperty(localName = "assertion")
-    private TestCaseAssertion assertion;
+    @JacksonXmlElementWrapper(useWrapping = false)
+    private List<TestCaseAssertion> assertion;
     
     @Override
     public String toString() {