You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/11/25 04:55:50 UTC

[shardingsphere] branch master updated: Refactor SQLCaseFileLoader (#22400)

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

zhaojinchao 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 1c2f666c2f2 Refactor SQLCaseFileLoader (#22400)
1c2f666c2f2 is described below

commit 1c2f666c2f265d67e66b5e831441d0fdf881ff65
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Nov 25 12:55:42 2022 +0800

    Refactor SQLCaseFileLoader (#22400)
    
    * Move SQLChecker
    
    * Remove SQLCheckResult
    
    * Remove SQLCheckResult
    
    * Refactor SQLCaseFileLoader
---
 .../internal/cases/parser/registry/SQLParserTestCasesRegistry.java    | 2 +-
 .../test/sql/parser/internal/loader/SQLCaseFileLoader.java            | 4 ++--
 .../test/sql/parser/internal/loader/SQLCasesLoader.java               | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/cases/parser/registry/SQLParserTestCasesRegistry.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/cases/parser/registry/SQLParserTestCasesRegistry.java
index 19f249d940a..b8f492450c2 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/cases/parser/registry/SQLParserTestCasesRegistry.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/cases/parser/registry/SQLParserTestCasesRegistry.java
@@ -63,7 +63,7 @@ public final class SQLParserTestCasesRegistry {
     
     private Map<String, SQLParserTestCase> loadFromTargetDirectory(final String directory) throws IOException, JAXBException {
         Map<String, SQLParserTestCase> result = new HashMap<>(Short.MAX_VALUE, 1);
-        for (File each : SQLCaseFileLoader.loadFilesFromTargetDirectory(directory)) {
+        for (File each : SQLCaseFileLoader.loadFilesFromDirectory(directory)) {
             try (FileInputStream fileInputStream = new FileInputStream(each)) {
                 Map<String, SQLParserTestCase> sqlParserTestCaseMap = createSQLParserTestCases(fileInputStream);
                 checkDuplicate(result, sqlParserTestCaseMap);
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCaseFileLoader.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCaseFileLoader.java
index 18178c8caff..e7116299717 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCaseFileLoader.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCaseFileLoader.java
@@ -69,13 +69,13 @@ public final class SQLCaseFileLoader {
     }
     
     /**
-     * Load test case files from target directory.
+     * Load test case files from directory.
      *
      * @param path test cases path
      * @return test case files
      */
     @SneakyThrows({URISyntaxException.class, IOException.class})
-    public static Collection<File> loadFilesFromTargetDirectory(final String path) {
+    public static Collection<File> loadFilesFromDirectory(final String path) {
         URL url = SQLCaseFileLoader.class.getClassLoader().getResource(path);
         if (null == url) {
             return Collections.emptyList();
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCasesLoader.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCasesLoader.java
index 878b9ec472f..2cdf8fb73b1 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCasesLoader.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/loader/SQLCasesLoader.java
@@ -73,7 +73,7 @@ public final class SQLCasesLoader {
     
     private Map<String, SQLCase> loadFromTargetDirectory(final String path) throws JAXBException, FileNotFoundException {
         Map<String, SQLCase> result = new TreeMap<>();
-        for (File each : SQLCaseFileLoader.loadFilesFromTargetDirectory(path)) {
+        for (File each : SQLCaseFileLoader.loadFilesFromDirectory(path)) {
             buildCaseMap(result, new FileInputStream(each));
         }
         return result;