This is an automated email from the ASF dual-hosted git repository.
FlyingZC 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 96090bd0c1e Minor refactor SQLE2ETestCaseAssertion (#38841)
96090bd0c1e is described below
commit 96090bd0c1ecc488d80d85b1a052344b04bbf608
Author: Zhengqiang Duan <[email protected]>
AuthorDate: Thu Jun 11 11:06:28 2026 +0800
Minor refactor SQLE2ETestCaseAssertion (#38841)
---
.../test/resources/container/mysql/cnf/5/my.cnf | 1 +
.../test/resources/container/mysql/cnf/8/my.cnf | 1 +
.../casse/assertion/SQLE2ETestCaseAssertion.java | 22 ++++++++--------------
.../resources/env/container/mysql/cnf/5/my.cnf | 1 +
.../resources/env/container/mysql/cnf/8/my.cnf | 1 +
5 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/test/e2e/env/src/test/resources/container/mysql/cnf/5/my.cnf
b/test/e2e/env/src/test/resources/container/mysql/cnf/5/my.cnf
index 1caae67ce8a..a1c08fe4511 100644
--- a/test/e2e/env/src/test/resources/container/mysql/cnf/5/my.cnf
+++ b/test/e2e/env/src/test/resources/container/mysql/cnf/5/my.cnf
@@ -26,3 +26,4 @@ innodb_lock_wait_timeout=5
default-time-zone='+00:00'
default-authentication-plugin=mysql_native_password
sql_mode=
+plugin_dir=/var/lib/mysql-files
diff --git a/test/e2e/env/src/test/resources/container/mysql/cnf/8/my.cnf
b/test/e2e/env/src/test/resources/container/mysql/cnf/8/my.cnf
index 4a49407aa3d..988b95f369a 100644
--- a/test/e2e/env/src/test/resources/container/mysql/cnf/8/my.cnf
+++ b/test/e2e/env/src/test/resources/container/mysql/cnf/8/my.cnf
@@ -26,6 +26,7 @@ innodb_lock_wait_timeout=5
default-time-zone='+00:00'
default-authentication-plugin=mysql_native_password
sql_mode=
+plugin_dir=/var/lib/mysql-files
# For MySQL 8.0
secure_file_priv=/var/lib/mysql
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/casse/assertion/SQLE2ETestCaseAssertion.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/casse/assertion/SQLE2ETestCaseAssertion.java
index de75d389ddb..ebe7edb1ede 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/casse/assertion/SQLE2ETestCaseAssertion.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/casse/assertion/SQLE2ETestCaseAssertion.java
@@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
@@ -72,7 +71,7 @@ public final class SQLE2ETestCaseAssertion {
}
Collection<SQLValue> result = new LinkedList<>();
int count = 0;
- for (String each :
Splitter.on(",").trimResults().splitToList(parameters)) {
+ for (String each : Splitter.on(",").splitToList(parameters)) {
List<String> parameterPair = parse(each);
result.add(new SQLValue(parameterPair.get(0),
parameterPair.get(1), ++count));
}
@@ -80,19 +79,14 @@ public final class SQLE2ETestCaseAssertion {
}
private List<String> parse(final String param) {
- List<String> result =
Splitter.on(":").trimResults().splitToList(param);
- int size = result.size();
- if (size <= 2) {
- return result;
- }
- return parseComplex(param);
- }
-
- private List<String> parseComplex(final String param) {
- List<String> result = new ArrayList<>(2);
int index = param.lastIndexOf(":");
- result.add(param.substring(0, index));
- result.add(param.substring(index + 1));
+ if (index < 0) {
+ return Splitter.on(":").trimResults().splitToList(param);
+ }
+ List<String> result = new LinkedList<>();
+ String value = param.substring(0, index);
+ result.add(value.trim().isEmpty() ? value : value.trim());
+ result.add(param.substring(index + 1).trim());
return result;
}
}
diff --git a/test/e2e/sql/src/test/resources/env/container/mysql/cnf/5/my.cnf
b/test/e2e/sql/src/test/resources/env/container/mysql/cnf/5/my.cnf
index d6f61ca7e02..1d499bcad2f 100644
--- a/test/e2e/sql/src/test/resources/env/container/mysql/cnf/5/my.cnf
+++ b/test/e2e/sql/src/test/resources/env/container/mysql/cnf/5/my.cnf
@@ -26,3 +26,4 @@ innodb_lock_wait_timeout=5
default-time-zone='+00:00'
default-authentication-plugin=mysql_native_password
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
+plugin_dir=/var/lib/mysql-files
diff --git a/test/e2e/sql/src/test/resources/env/container/mysql/cnf/8/my.cnf
b/test/e2e/sql/src/test/resources/env/container/mysql/cnf/8/my.cnf
index c9528e4cfdc..8414814d4cd 100644
--- a/test/e2e/sql/src/test/resources/env/container/mysql/cnf/8/my.cnf
+++ b/test/e2e/sql/src/test/resources/env/container/mysql/cnf/8/my.cnf
@@ -26,6 +26,7 @@ innodb_lock_wait_timeout=5
default-time-zone='+00:00'
default-authentication-plugin=mysql_native_password
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
+plugin_dir=/var/lib/mysql-files
# For MySQL 8.0
secure_file_priv=/var/lib/mysql