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

zhangliang 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 20cae34a66f Refactor usage of AdapterMode (#36646)
20cae34a66f is described below

commit 20cae34a66fa467d22607de911e7bb126cbf5694
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Sep 20 20:28:02 2025 +0800

    Refactor usage of AdapterMode (#36646)
    
    * Refactor usage of AdapterMode
    
    * Refactor usage of AdapterMode
    
    * Refactor usage of AdapterMode
    
    * Refactor usage of AdapterMode
---
 .../test/e2e/env/runtime/E2ETestEnvironment.java          |  7 +++++--
 .../test/e2e/sql/cases/dataset/DataSetLoader.java         |  9 +++++----
 .../param/array/ClusterTestParameterArrayGenerator.java   |  4 ++--
 .../framework/param/array/E2ETestParameterFactory.java    | 15 +++++++--------
 .../framework/param/array/E2ETestParameterGenerator.java  |  7 ++++---
 .../param/array/JdbcStandaloneTestParameterGenerator.java |  4 ++--
 .../array/ProxyStandaloneTestParameterGenerator.java      |  4 ++--
 .../sql/framework/param/model/AssertionTestParameter.java |  3 ++-
 .../e2e/sql/framework/param/model/CaseTestParameter.java  |  3 ++-
 .../e2e/sql/framework/param/model/E2ETestParameter.java   |  3 ++-
 .../apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java   |  5 ++---
 .../test/e2e/sql/it/sql/dql/BaseDQLE2EIT.java             |  3 ++-
 12 files changed, 37 insertions(+), 30 deletions(-)

diff --git 
a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/runtime/E2ETestEnvironment.java
 
b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/runtime/E2ETestEnvironment.java
index 27a767b13d3..921706479ea 100644
--- 
a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/runtime/E2ETestEnvironment.java
+++ 
b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/runtime/E2ETestEnvironment.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.test.e2e.env.runtime;
 
 import com.google.common.base.Splitter;
 import lombok.Getter;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import 
org.apache.shardingsphere.test.e2e.env.container.constants.StorageContainerConstants;
 import 
org.apache.shardingsphere.test.e2e.env.runtime.cluster.ClusterEnvironment;
 import 
org.apache.shardingsphere.test.e2e.env.runtime.scenario.path.ScenarioCommonPath;
@@ -28,6 +29,7 @@ import java.io.InputStream;
 import java.util.Collection;
 import java.util.Properties;
 import java.util.TimeZone;
+import java.util.stream.Collectors;
 
 /**
  * E2E test environment.
@@ -37,7 +39,7 @@ public final class E2ETestEnvironment {
     
     private static final E2ETestEnvironment INSTANCE = new 
E2ETestEnvironment();
     
-    private final Collection<String> runModes;
+    private final Collection<AdapterMode> runModes;
     
     private final boolean runAdditionalTestCases;
     
@@ -59,7 +61,8 @@ public final class E2ETestEnvironment {
     
     private E2ETestEnvironment() {
         Properties props = loadProperties();
-        runModes = 
Splitter.on(",").trimResults().splitToList(props.getProperty("it.run.modes"));
+        runModes = 
Splitter.on(",").trimResults().splitToList(props.getProperty("it.run.modes", 
"")).stream()
+                .filter(each -> !each.isEmpty()).map(each -> 
AdapterMode.valueOf(each.toUpperCase())).collect(Collectors.toList());
         runAdditionalTestCases = 
Boolean.parseBoolean(props.getProperty("it.run.additional.cases"));
         
TimeZone.setDefault(TimeZone.getTimeZone(props.getProperty("it.timezone", 
"UTC")));
         scenarios = getScenarios(props);
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/dataset/DataSetLoader.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/dataset/DataSetLoader.java
index 1d45f082328..ed451dccf5c 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/dataset/DataSetLoader.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/dataset/DataSetLoader.java
@@ -22,6 +22,7 @@ import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.SneakyThrows;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
@@ -48,14 +49,14 @@ public final class DataSetLoader {
      * @return data set
      */
     @SneakyThrows({JAXBException.class, IOException.class})
-    public static DataSet load(final String parentPath, final String scenario, 
final DatabaseType databaseType, final String mode, final String dataSetFile) {
+    public static DataSet load(final String parentPath, final String scenario, 
final DatabaseType databaseType, final AdapterMode mode, final String 
dataSetFile) {
         try (FileReader reader = new FileReader(getFile(parentPath, scenario, 
databaseType, mode, dataSetFile))) {
             return (DataSet) 
JAXBContext.newInstance(DataSet.class).createUnmarshaller().unmarshal(reader);
         }
     }
     
-    private static String getFile(final String parentPath, final String 
scenario, final DatabaseType databaseType, final String mode, final String 
dataSetFile) {
-        String result = String.join(File.separator, parentPath, 
DATA_SET_FOLDER_NAME, scenario, mode.toLowerCase(), 
databaseType.getType().toLowerCase(), dataSetFile);
+    private static String getFile(final String parentPath, final String 
scenario, final DatabaseType databaseType, final AdapterMode mode, final String 
dataSetFile) {
+        String result = String.join(File.separator, parentPath, 
DATA_SET_FOLDER_NAME, scenario, mode.name().toLowerCase(), 
databaseType.getType().toLowerCase(), dataSetFile);
         if (new File(result).exists()) {
             return result;
         }
@@ -69,7 +70,7 @@ public final class DataSetLoader {
                 return result;
             }
         }
-        result = String.join(File.separator, parentPath, DATA_SET_FOLDER_NAME, 
scenario, mode.toLowerCase(), dataSetFile);
+        result = String.join(File.separator, parentPath, DATA_SET_FOLDER_NAME, 
scenario, mode.name().toLowerCase(), dataSetFile);
         if (new File(result).exists()) {
             return result;
         }
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ClusterTestParameterArrayGenerator.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ClusterTestParameterArrayGenerator.java
index 97556b752be..13c1d0ebe33 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ClusterTestParameterArrayGenerator.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ClusterTestParameterArrayGenerator.java
@@ -42,7 +42,7 @@ public final class ClusterTestParameterArrayGenerator {
      * @return assertion test parameter
      */
     public static Collection<AssertionTestParameter> 
getAssertionTestParameter(final SQLCommandType sqlCommandType) {
-        return new 
E2ETestParameterGenerator(ENV.getClusterEnvironment().getAdapters(), 
ENV.getScenarios(), AdapterMode.CLUSTER.name(),
+        return new 
E2ETestParameterGenerator(ENV.getClusterEnvironment().getAdapters(), 
ENV.getScenarios(), AdapterMode.CLUSTER,
                 ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke()).getAssertionTestParameter(sqlCommandType);
     }
     
@@ -53,7 +53,7 @@ public final class ClusterTestParameterArrayGenerator {
      * @return case parameter
      */
     public static Collection<E2ETestParameter> getCaseTestParameter(final 
SQLCommandType sqlCommandType) {
-        return new 
E2ETestParameterGenerator(ENV.getClusterEnvironment().getAdapters(), 
ENV.getScenarios(), AdapterMode.CLUSTER.name(),
+        return new 
E2ETestParameterGenerator(ENV.getClusterEnvironment().getAdapters(), 
ENV.getScenarios(), AdapterMode.CLUSTER,
                 ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke()).getCaseTestParameter(sqlCommandType);
     }
 }
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterFactory.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterFactory.java
index 27547d1cce5..02345daa3c0 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterFactory.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterFactory.java
@@ -44,12 +44,12 @@ public final class E2ETestParameterFactory {
      */
     public static Collection<AssertionTestParameter> 
getAssertionTestParameters(final SQLCommandType sqlCommandType) {
         Collection<AssertionTestParameter> result = new LinkedList<>();
-        for (String each : ENV.getRunModes()) {
-            if (AdapterMode.STANDALONE.name().equalsIgnoreCase(each)) {
+        for (AdapterMode each : ENV.getRunModes()) {
+            if (AdapterMode.STANDALONE == each) {
                 result.addAll(isDistSQLCommandType(sqlCommandType)
                         ? 
ProxyStandaloneTestParameterGenerator.getAssertionTestParameter(sqlCommandType)
                         : 
JdbcStandaloneTestParameterGenerator.getAssertionTestParameter(sqlCommandType));
-            } else if (AdapterMode.CLUSTER.name().equalsIgnoreCase(each)) {
+            } else if (AdapterMode.CLUSTER == each) {
                 
result.addAll(ClusterTestParameterArrayGenerator.getAssertionTestParameter(sqlCommandType));
             }
         }
@@ -64,12 +64,12 @@ public final class E2ETestParameterFactory {
      */
     public static Collection<E2ETestParameter> getCaseTestParameters(final 
SQLCommandType sqlCommandType) {
         Collection<E2ETestParameter> result = new LinkedList<>();
-        for (String each : ENV.getRunModes()) {
-            if (AdapterMode.STANDALONE.name().equalsIgnoreCase(each)) {
+        for (AdapterMode each : ENV.getRunModes()) {
+            if (AdapterMode.STANDALONE == each) {
                 result.addAll(isDistSQLCommandType(sqlCommandType)
                         ? 
ProxyStandaloneTestParameterGenerator.getCaseTestParameter(sqlCommandType)
                         : 
JdbcStandaloneTestParameterGenerator.getCaseTestParameter(sqlCommandType));
-            } else if (AdapterMode.CLUSTER.name().equalsIgnoreCase(each)) {
+            } else if (AdapterMode.CLUSTER == each) {
                 
result.addAll(ClusterTestParameterArrayGenerator.getCaseTestParameter(sqlCommandType));
             }
         }
@@ -86,7 +86,6 @@ public final class E2ETestParameterFactory {
      * @return contains or not
      */
     public static boolean containsTestParameter() {
-        return E2ETestEnvironment.getInstance().getRunModes().stream()
-                .anyMatch(each -> 
AdapterMode.STANDALONE.name().equalsIgnoreCase(each) || 
AdapterMode.CLUSTER.name().equalsIgnoreCase(each));
+        return 
E2ETestEnvironment.getInstance().getRunModes().stream().anyMatch(each -> 
AdapterMode.STANDALONE == each || AdapterMode.CLUSTER == each);
     }
 }
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterGenerator.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterGenerator.java
index 9fb096c42ec..f9c42f5c311 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterGenerator.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/E2ETestParameterGenerator.java
@@ -25,6 +25,7 @@ import 
org.apache.shardingsphere.distsql.statement.type.ral.RALStatement;
 import org.apache.shardingsphere.distsql.statement.type.rdl.RDLStatement;
 import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
 import 
org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import org.apache.shardingsphere.test.e2e.sql.cases.SQLE2ETestCasesXMLLoader;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.casse.SQLE2ETestCaseContext;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.casse.assertion.SQLE2ETestCaseAssertion;
@@ -52,7 +53,7 @@ public final class E2ETestParameterGenerator {
     
     private final Collection<String> envScenarios;
     
-    private final String envMode;
+    private final AdapterMode adapterMode;
     
     private final Collection<DatabaseType> envDatabaseTypes;
     
@@ -123,7 +124,7 @@ public final class E2ETestParameterGenerator {
                                                                          final 
SQLExecuteType sqlExecuteType, final SQLCommandType sqlCommandType) {
         Collection<String> scenarios = null == 
testCaseContext.getTestCase().getScenarioTypes() ? Collections.emptyList() : 
Arrays.asList(testCaseContext.getTestCase().getScenarioTypes().split(","));
         return envScenarios.stream().filter(each -> filterScenarios(each, 
scenarios, sqlCommandType.getSqlStatementClass()))
-                .map(each -> new AssertionTestParameter(testCaseContext, 
assertion, adapter, each, envMode, databaseType, sqlExecuteType, 
sqlCommandType)).collect(Collectors.toList());
+                .map(each -> new AssertionTestParameter(testCaseContext, 
assertion, adapter, each, adapterMode, databaseType, sqlExecuteType, 
sqlCommandType)).collect(Collectors.toList());
     }
     
     private Collection<AssertionTestParameter> 
getAssertionTestParameterFilterBySmoke(final SQLE2ETestCaseContext 
testCaseContext, final SQLCommandType sqlCommandType) {
@@ -190,7 +191,7 @@ public final class E2ETestParameterGenerator {
         }
         Collection<String> scenarios = null == 
testCaseContext.getTestCase().getScenarioTypes() ? Collections.emptyList() : 
Arrays.asList(testCaseContext.getTestCase().getScenarioTypes().split(","));
         return envScenarios.stream().filter(each -> scenarios.isEmpty() || 
scenarios.contains(each))
-                .map(each -> new CaseTestParameter(testCaseContext, adapter, 
each, envMode, databaseType, sqlCommandType)).collect(Collectors.toList());
+                .map(each -> new CaseTestParameter(testCaseContext, adapter, 
each, adapterMode, databaseType, sqlCommandType)).collect(Collectors.toList());
     }
     
     private Collection<DatabaseType> getDatabaseTypes(final String 
databaseTypes) {
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/JdbcStandaloneTestParameterGenerator.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/JdbcStandaloneTestParameterGenerator.java
index 570ffd0956e..689d08de82e 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/JdbcStandaloneTestParameterGenerator.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/JdbcStandaloneTestParameterGenerator.java
@@ -46,7 +46,7 @@ public final class JdbcStandaloneTestParameterGenerator {
      * @return assertion test parameter
      */
     public static Collection<AssertionTestParameter> 
getAssertionTestParameter(final SQLCommandType sqlCommandType) {
-        return new E2ETestParameterGenerator(ADAPTERS, ENV.getScenarios(), 
AdapterMode.STANDALONE.name(), ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke())
+        return new E2ETestParameterGenerator(ADAPTERS, ENV.getScenarios(), 
AdapterMode.STANDALONE, ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke())
                 .getAssertionTestParameter(sqlCommandType);
     }
     
@@ -57,7 +57,7 @@ public final class JdbcStandaloneTestParameterGenerator {
      * @return case test parameter
      */
     public static Collection<E2ETestParameter> getCaseTestParameter(final 
SQLCommandType sqlCommandType) {
-        return new E2ETestParameterGenerator(ADAPTERS, ENV.getScenarios(), 
AdapterMode.STANDALONE.name(), ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke())
+        return new E2ETestParameterGenerator(ADAPTERS, ENV.getScenarios(), 
AdapterMode.STANDALONE, ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke())
                 .getCaseTestParameter(sqlCommandType);
     }
 }
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ProxyStandaloneTestParameterGenerator.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ProxyStandaloneTestParameterGenerator.java
index 22a78283946..4d02b45185d 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ProxyStandaloneTestParameterGenerator.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/array/ProxyStandaloneTestParameterGenerator.java
@@ -43,7 +43,7 @@ public final class ProxyStandaloneTestParameterGenerator {
      */
     public static Collection<AssertionTestParameter> 
getAssertionTestParameter(final SQLCommandType sqlCommandType) {
         return new 
E2ETestParameterGenerator(ENV.getClusterEnvironment().getAdapters(),
-                ENV.getScenarios(), AdapterMode.STANDALONE.name(), 
ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke()).getAssertionTestParameter(sqlCommandType);
+                ENV.getScenarios(), AdapterMode.STANDALONE, 
ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke()).getAssertionTestParameter(sqlCommandType);
     }
     
     /**
@@ -54,6 +54,6 @@ public final class ProxyStandaloneTestParameterGenerator {
      */
     public static Collection<E2ETestParameter> getCaseTestParameter(final 
SQLCommandType sqlCommandType) {
         return new 
E2ETestParameterGenerator(ENV.getClusterEnvironment().getAdapters(),
-                ENV.getScenarios(), AdapterMode.STANDALONE.name(), 
ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke()).getCaseTestParameter(sqlCommandType);
+                ENV.getScenarios(), AdapterMode.STANDALONE, 
ENV.getClusterEnvironment().getDatabaseTypes(), 
ENV.isSmoke()).getCaseTestParameter(sqlCommandType);
     }
 }
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
index 234cda44260..9ca29f4a924 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
@@ -20,6 +20,7 @@ package 
org.apache.shardingsphere.test.e2e.sql.framework.param.model;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.casse.SQLE2ETestCaseContext;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.casse.assertion.SQLE2ETestCaseAssertion;
 import org.apache.shardingsphere.test.e2e.sql.framework.type.SQLCommandType;
@@ -40,7 +41,7 @@ public final class AssertionTestParameter implements 
E2ETestParameter {
     
     private final String scenario;
     
-    private final String mode;
+    private final AdapterMode mode;
     
     private final DatabaseType databaseType;
     
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
index 3b13cf9c298..1215c31c0fb 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
@@ -20,6 +20,7 @@ package 
org.apache.shardingsphere.test.e2e.sql.framework.param.model;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.casse.SQLE2ETestCaseContext;
 import org.apache.shardingsphere.test.e2e.sql.framework.type.SQLCommandType;
 
@@ -36,7 +37,7 @@ public final class CaseTestParameter implements 
E2ETestParameter {
     
     private final String scenario;
     
-    private final String mode;
+    private final AdapterMode mode;
     
     private final DatabaseType databaseType;
     
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/E2ETestParameter.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/E2ETestParameter.java
index ea47c56ce82..a0c379ade4b 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/E2ETestParameter.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/E2ETestParameter.java
@@ -18,6 +18,7 @@
 package org.apache.shardingsphere.test.e2e.sql.framework.param.model;
 
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.casse.SQLE2ETestCaseContext;
 import org.apache.shardingsphere.test.e2e.sql.framework.type.SQLCommandType;
 
@@ -59,7 +60,7 @@ public interface E2ETestParameter {
      *
      * @return mode
      */
-    String getMode();
+    AdapterMode getMode();
     
     /**
      * Get sql command type.
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
index 55d7d0df29c..c0bb95b22e6 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.test.e2e.sql.it;
 
-import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterType;
 import org.apache.shardingsphere.test.e2e.sql.env.SQLE2EEnvironmentEngine;
 import 
org.apache.shardingsphere.test.e2e.sql.framework.param.model.E2ETestParameter;
@@ -64,8 +63,8 @@ public interface SQLE2EIT {
         }
         
         private void setEnvironmentEngine(final ExtensionContext 
extensionContext, final E2ETestParameter testParam) {
-            SQLE2EEnvironmentEngine environmentEngine = new 
SQLE2EEnvironmentEngine(testParam.getKey(), testParam.getScenario(), 
testParam.getDatabaseType(),
-                    AdapterMode.valueOf(testParam.getMode().toUpperCase()), 
AdapterType.valueOf(testParam.getAdapter().toUpperCase()));
+            SQLE2EEnvironmentEngine environmentEngine = new 
SQLE2EEnvironmentEngine(
+                    testParam.getKey(), testParam.getScenario(), 
testParam.getDatabaseType(), testParam.getMode(), 
AdapterType.valueOf(testParam.getAdapter().toUpperCase()));
             ((SQLE2EIT) 
extensionContext.getRequiredTestInstance()).setEnvironmentEngine(environmentEngine);
         }
     }
diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/BaseDQLE2EIT.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/BaseDQLE2EIT.java
index a1e67df2c88..2008e0a3472 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/BaseDQLE2EIT.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/BaseDQLE2EIT.java
@@ -21,6 +21,7 @@ import lombok.AccessLevel;
 import lombok.Getter;
 import lombok.Setter;
 import org.apache.shardingsphere.infra.util.datetime.DateTimeFormatterFactory;
+import 
org.apache.shardingsphere.test.e2e.env.container.adapter.enums.AdapterMode;
 import 
org.apache.shardingsphere.test.e2e.env.runtime.scenario.path.ScenarioDataPath;
 import 
org.apache.shardingsphere.test.e2e.env.runtime.scenario.path.ScenarioDataPath.Type;
 import 
org.apache.shardingsphere.test.e2e.sql.cases.dataset.metadata.DataSetColumn;
@@ -133,7 +134,7 @@ public abstract class BaseDQLE2EIT implements SQLE2EIT {
             if ("db_tbl_sql_federation".equals(testParam.getScenario())) {
                 continue;
             }
-            if ("jdbc".equals(testParam.getAdapter()) && 
"Cluster".equals(testParam.getMode()) && 
"encrypt".equals(testParam.getScenario())
+            if ("jdbc".equals(testParam.getAdapter()) && AdapterMode.CLUSTER 
== testParam.getMode() && "encrypt".equals(testParam.getScenario())
                     || "MySQL".equals(testParam.getDatabaseType().getType()) 
&& "passthrough".equals(testParam.getScenario())) {
                 // FIXME correct columnType with proxy adapter and other jdbc 
scenario
                 assertThat(actualResultSetMetaData.getColumnType(i + 1), 
is(expectedResultSetMetaData.getColumnType(i + 1)));

Reply via email to