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

duanzhengqiang 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 ddeb138bd45 Refactor: splitting dal-integration-test-cases.xml file 
(#23679)
ddeb138bd45 is described below

commit ddeb138bd456698f721652c83ccf778686f5bad7
Author: gxxiong <[email protected]>
AuthorDate: Tue Jan 31 13:37:59 2023 +0800

    Refactor: splitting dal-integration-test-cases.xml file (#23679)
    
    * Refactor: splitting dal-integration-test-cases.xml file
    
    * fix error
---
 .../shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java   | 4 +++-
 .../org/apache/shardingsphere/test/e2e/cases/SQLCommandType.java    | 2 +-
 .../{dal-integration-test-cases.xml => dal-integration-reset.xml}   | 6 ++----
 .../{dal-integration-test-cases.xml => dal-integration-show.xml}    | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
 
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
index 8f809483bc8..c42fd4fe257 100644
--- 
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
+++ 
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
@@ -45,6 +45,8 @@ import java.util.stream.Collectors;
  */
 public final class IntegrationTestCasesLoader {
     
+    private static final String FILE_EXTENSION = ".xml";
+    
     private static final IntegrationTestCasesLoader INSTANCE = new 
IntegrationTestCasesLoader();
     
     private final Map<SQLCommandType, Collection<IntegrationTestCaseContext>> 
testCaseContexts = new LinkedHashMap<>();
@@ -90,7 +92,7 @@ public final class IntegrationTestCasesLoader {
             
             @Override
             public FileVisitResult visitFile(final Path file, final 
BasicFileAttributes basicFileAttributes) {
-                if 
(file.getFileName().toString().startsWith(sqlCommandType.getFilePrefix()) && 
file.getFileName().toString().endsWith(".xml")) {
+                if 
(file.getFileName().toString().startsWith(sqlCommandType.getFilePrefix()) && 
file.getFileName().toString().endsWith(FILE_EXTENSION)) {
                     result.add(file.toFile());
                 }
                 return FileVisitResult.CONTINUE;
diff --git 
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/SQLCommandType.java
 
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/SQLCommandType.java
index a37e36b3dc8..8a8fb710b3f 100644
--- 
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/SQLCommandType.java
+++ 
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/cases/SQLCommandType.java
@@ -72,7 +72,7 @@ public enum SQLCommandType {
     /**
      * Database administrator Language.
      */
-    DAL(DALStatement.class, "dal-integration-test-cases", true, 
Collections.singletonList("proxy")),
+    DAL(DALStatement.class, "dal-integration", true, 
Collections.singletonList("proxy")),
     
     /**
      * Database control Language.
diff --git 
a/test/e2e/suite/src/test/resources/cases/dal/dal-integration-test-cases.xml 
b/test/e2e/suite/src/test/resources/cases/dal/dal-integration-reset.xml
similarity index 75%
copy from 
test/e2e/suite/src/test/resources/cases/dal/dal-integration-test-cases.xml
copy to test/e2e/suite/src/test/resources/cases/dal/dal-integration-reset.xml
index 0608be52029..5697e8ebf4a 100644
--- a/test/e2e/suite/src/test/resources/cases/dal/dal-integration-test-cases.xml
+++ b/test/e2e/suite/src/test/resources/cases/dal/dal-integration-reset.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   ~ Licensed to the Apache Software Foundation (ASF) under one or more
   ~ contributor license agreements.  See the NOTICE file distributed with
@@ -14,10 +15,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
-<integration-test-cases>
-    <test-case sql="SHOW DATABASES" db-types="MySQL" 
scenario-types="dbtbl_with_readwrite_splitting,readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt,encrypt_and_readwrite_splitting">
-        <assertion expected-data-file="show_databases.xml" />
-    </test-case>
 
+<integration-test-cases>
     <test-case sql="RESET ALL" db-types="PostgreSQL,openGauss" />
 </integration-test-cases>
diff --git 
a/test/e2e/suite/src/test/resources/cases/dal/dal-integration-test-cases.xml 
b/test/e2e/suite/src/test/resources/cases/dal/dal-integration-show.xml
similarity index 94%
rename from 
test/e2e/suite/src/test/resources/cases/dal/dal-integration-test-cases.xml
rename to test/e2e/suite/src/test/resources/cases/dal/dal-integration-show.xml
index 0608be52029..9bdba74996f 100644
--- a/test/e2e/suite/src/test/resources/cases/dal/dal-integration-test-cases.xml
+++ b/test/e2e/suite/src/test/resources/cases/dal/dal-integration-show.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   ~ Licensed to the Apache Software Foundation (ASF) under one or more
   ~ contributor license agreements.  See the NOTICE file distributed with
@@ -14,10 +15,9 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
+
 <integration-test-cases>
     <test-case sql="SHOW DATABASES" db-types="MySQL" 
scenario-types="dbtbl_with_readwrite_splitting,readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt,encrypt_and_readwrite_splitting">
         <assertion expected-data-file="show_databases.xml" />
     </test-case>
-
-    <test-case sql="RESET ALL" db-types="PostgreSQL,openGauss" />
 </integration-test-cases>

Reply via email to