You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/11/12 14:47:59 UTC

[shardingsphere] branch master updated: Move sql parser test packages (#22122)

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 59ab177c4dc Move sql parser test packages (#22122)
59ab177c4dc is described below

commit 59ab177c4dcaaf8da7133263239a0a53dd43dc2d
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Nov 12 22:47:53 2022 +0800

    Move sql parser test packages (#22122)
    
    * Move sql parser test packages
    
    * Add javadoc
    
    * fix checkstyle
    
    * fix checkstyle
---
 .../DynamicLoadingSQLParserParameterizedIT.java    | 57 ++++++++++++++++++++++
 .../sql/parser/env/IntegrationTestEnvironment.java |  2 +-
 .../sql/parser/loader/SQLCaseLoadStrategy.java     | 18 +++++--
 .../sql/parser/loader/SQLCaseLoader.java           | 10 ++--
 .../loader/impl/GitHubSQLCaseLoadStrategy.java     | 12 ++---
 .../loader/impl/LocalFileSQLCaseLoadStrategy.java  |  8 +--
 .../DynamicLoadingMySQLParserParameterizedIT.java  | 15 ++----
 ...amicLoadingPostgreSQLParserParameterizedIT.java | 15 ++----
 .../parser/result/SQLParserCSVResultProcessor.java |  4 +-
 .../parser/result/SQLParserLogResultProcessor.java |  2 +-
 .../parser/result/SQLParserResultProcessor.java    |  2 +-
 .../result/SQLParserResultProcessorManager.java    |  4 +-
 12 files changed, 104 insertions(+), 45 deletions(-)

diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/base/DynamicLoadingSQLParserParameterizedIT.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/base/DynamicLoadingSQLParserParameterizedIT.java
new file mode 100644
index 00000000000..97c7ce0ea5d
--- /dev/null
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/base/DynamicLoadingSQLParserParameterizedIT.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.test.integration.sql.parser.base;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.infra.util.exception.external.ShardingSphereExternalException;
+import org.apache.shardingsphere.sql.parser.api.CacheOption;
+import org.apache.shardingsphere.sql.parser.api.SQLParserEngine;
+import org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
+import org.apache.shardingsphere.test.integration.sql.parser.result.SQLParserResultProcessor;
+import org.junit.Test;
+
+import java.util.Properties;
+
+@RequiredArgsConstructor
+@Slf4j
+public abstract class DynamicLoadingSQLParserParameterizedIT {
+    
+    private final String sqlCaseId;
+    
+    private final String sql;
+    
+    private final String databaseType;
+    
+    // TODO this will refactor as an abstract
+    private final SQLParserResultProcessor resultGenerator;
+    
+    @Test
+    public final void assertParseSQL() {
+        String result = "success";
+        try {
+            ParseASTNode parseASTNode = new SQLParserEngine(databaseType, new CacheOption(128, 1024L)).parse(sql, false);
+            new SQLVisitorEngine(databaseType, "STATEMENT", true, new Properties()).visit(parseASTNode);
+        } catch (final ShardingSphereExternalException | ClassCastException | NullPointerException | IllegalArgumentException | IndexOutOfBoundsException ignore) {
+            result = "failed";
+            log.warn("ParserError: " + sqlCaseId + " value: " + sql + " db-type: " + databaseType);
+        }
+        resultGenerator.processResult(sqlCaseId, databaseType, result, sql);
+    }
+}
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/env/IntegrationTestEnvironment.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/env/IntegrationTestEnvironment.java
similarity index 97%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/env/IntegrationTestEnvironment.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/env/IntegrationTestEnvironment.java
index b5d86fdab5d..d321ac1bbea 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/env/IntegrationTestEnvironment.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/env/IntegrationTestEnvironment.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.env;
+package org.apache.shardingsphere.test.integration.sql.parser.env;
 
 import lombok.Getter;
 import lombok.SneakyThrows;
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/SQLCaseLoadStrategy.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/SQLCaseLoadStrategy.java
similarity index 69%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/SQLCaseLoadStrategy.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/SQLCaseLoadStrategy.java
index eb65aafdac4..054eef96531 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/SQLCaseLoadStrategy.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/SQLCaseLoadStrategy.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.loader;
+package org.apache.shardingsphere.test.integration.sql.parser.loader;
 
 import java.net.URI;
 import java.util.Collection;
@@ -26,7 +26,19 @@ import java.util.Map;
  */
 public interface SQLCaseLoadStrategy {
     
-    Collection<Map<String, String>> loadSQLCaseFiles(final URI uri);
+    /**
+     * Load SQL cases.
+     * 
+     * @param uri URL to be loaded
+     * @return loaded SQL cases
+     */
+    Collection<Map<String, String>> loadSQLCases(URI uri);
     
-    Map<String, String> loadSQLCaseResultFiles(final URI uri);
+    /**
+     * Load SQL cases result.
+     * 
+     * @param uri URL to be loaded
+     * @return loaded SQL case results
+     */
+    Map<String, String> loadSQLCaseResults(URI uri);
 }
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/SQLCaseLoader.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/SQLCaseLoader.java
similarity index 94%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/SQLCaseLoader.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/SQLCaseLoader.java
index 35dea8aa921..c107b6cefa9 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/SQLCaseLoader.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/SQLCaseLoader.java
@@ -15,11 +15,11 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.loader;
+package org.apache.shardingsphere.test.integration.sql.parser.loader;
 
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.sql.parser.env.IntegrationTestEnvironment;
+import org.apache.shardingsphere.test.integration.sql.parser.env.IntegrationTestEnvironment;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -48,13 +48,13 @@ public final class SQLCaseLoader {
      *
      * @return Test cases from with strategy
      */
-    public Collection<Object[]> load(URI sqlCaseURI, URI sqlCaseResultURI) {
+    public Collection<Object[]> load(final URI sqlCaseURI, final URI sqlCaseResultURI) {
         if (!IntegrationTestEnvironment.getInstance().isSqlParserITEnabled()) {
             return Collections.emptyList();
         }
         Collection<Object[]> result = new LinkedList<>();
-        Collection<Map<String, String>> sqlCases = loadStrategy.loadSQLCaseFiles(sqlCaseURI);
-        Map<String, String> resultResponse = loadStrategy.loadSQLCaseResultFiles(sqlCaseResultURI);
+        Collection<Map<String, String>> sqlCases = loadStrategy.loadSQLCases(sqlCaseURI);
+        Map<String, String> resultResponse = loadStrategy.loadSQLCaseResults(sqlCaseResultURI);
         for (Map<String, String> each : sqlCases) {
             String sqlCaseFileName = each.get("name").split("\\.")[0];
             String sqlCaseTestFileContent = loadContent(URI.create(each.get("download_url")));
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/impl/GitHubSQLCaseLoadStrategy.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/impl/GitHubSQLCaseLoadStrategy.java
similarity index 88%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/impl/GitHubSQLCaseLoadStrategy.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/impl/GitHubSQLCaseLoadStrategy.java
index 58467884a1c..6f59dd11392 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/impl/GitHubSQLCaseLoadStrategy.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/impl/GitHubSQLCaseLoadStrategy.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.loader.impl;
+package org.apache.shardingsphere.test.integration.sql.parser.loader.impl;
 
 import com.google.common.collect.ImmutableMap;
 import com.jayway.jsonpath.JsonPath;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.sql.parser.loader.SQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.integration.sql.parser.loader.SQLCaseLoadStrategy;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -41,7 +41,7 @@ import java.util.stream.Collectors;
 public final class GitHubSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
     
     @Override
-    public Collection<Map<String, String>> loadSQLCaseFiles(final URI uri) {
+    public Collection<Map<String, String>> loadSQLCases(final URI uri) {
         String caseContent = loadContent(getGitHubApiUri(uri));
         if (caseContent.isEmpty()) {
             return Collections.emptyList();
@@ -56,7 +56,7 @@ public final class GitHubSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
             if ("file".equals(casesType.get(each))) {
                 result.add(ImmutableMap.of("name", casesName.get(each), "download_url", casesDownloadURL.get(each)));
             } else if ("dir".equals(casesType.get(each))) {
-                result.addAll(loadSQLCaseFiles(URI.create(casesHtmlURL.get(each))));
+                result.addAll(loadSQLCases(URI.create(casesHtmlURL.get(each))));
             }
         }
         return result;
@@ -81,9 +81,9 @@ public final class GitHubSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
     }
     
     @Override
-    public Map<String, String> loadSQLCaseResultFiles(final URI uri) {
+    public Map<String, String> loadSQLCaseResults(final URI uri) {
         Map<String, String> result = new HashMap<>();
-        for (Map<String, String> each : loadSQLCaseFiles(uri)) {
+        for (Map<String, String> each : loadSQLCases(uri)) {
             result.put(each.get("name").split("\\.")[0], each.get("download_url"));
         }
         return result;
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/impl/LocalFileSQLCaseLoadStrategy.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/impl/LocalFileSQLCaseLoadStrategy.java
similarity index 79%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/impl/LocalFileSQLCaseLoadStrategy.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/impl/LocalFileSQLCaseLoadStrategy.java
index 9b3a2565dec..115ead58f2c 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/loader/impl/LocalFileSQLCaseLoadStrategy.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/loader/impl/LocalFileSQLCaseLoadStrategy.java
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.loader.impl;
+package org.apache.shardingsphere.test.integration.sql.parser.loader.impl;
 
-import org.apache.shardingsphere.sql.parser.loader.SQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.integration.sql.parser.loader.SQLCaseLoadStrategy;
 
 import java.net.URI;
 import java.util.Collection;
@@ -30,13 +30,13 @@ import java.util.Map;
 public final class LocalFileSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
     
     @Override
-    public Collection<Map<String, String>> loadSQLCaseFiles(final URI uri) {
+    public Collection<Map<String, String>> loadSQLCases(final URI uri) {
         // TODO
         return Collections.emptyList();
     }
     
     @Override
-    public Map<String, String> loadSQLCaseResultFiles(final URI uri) {
+    public Map<String, String> loadSQLCaseResults(final URI uri) {
         // TODO
         return Collections.emptyMap();
     }
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
similarity index 79%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
index f2fcdc1e6fd..b30ca800983 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.mysql;
+package org.apache.shardingsphere.test.integration.sql.parser.mysql;
 
-import org.apache.shardingsphere.sql.parser.base.DynamicLoadingSQLParserParameterizedIT;
-import org.apache.shardingsphere.sql.parser.loader.SQLCaseLoader;
-import org.apache.shardingsphere.sql.parser.loader.impl.GitHubSQLCaseLoadStrategy;
-import org.apache.shardingsphere.sql.parser.result.SQLParserResultProcessorManager;
+import org.apache.shardingsphere.test.integration.sql.parser.base.DynamicLoadingSQLParserParameterizedIT;
+import org.apache.shardingsphere.test.integration.sql.parser.loader.SQLCaseLoader;
+import org.apache.shardingsphere.test.integration.sql.parser.loader.impl.GitHubSQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.integration.sql.parser.result.SQLParserResultProcessorManager;
 import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized.Parameters;
@@ -35,11 +35,6 @@ public final class DynamicLoadingMySQLParserParameterizedIT extends DynamicLoadi
         super(sqlCaseId, sqlCaseValue, "MySQL", SQLParserResultProcessorManager.getProcessor("MySQL"));
     }
     
-    /**
-     * Get test parameters.
-     *
-     * @return Test cases from GitHub.
-     */
     @Parameters(name = "{0} (MySQL) -> {1}")
     public static Collection<Object[]> getTestParameters() {
         return new SQLCaseLoader(new GitHubSQLCaseLoadStrategy()).load(
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
similarity index 79%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
index c3458e5dfc3..1a2fb17958e 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.postgresql;
+package org.apache.shardingsphere.test.integration.sql.parser.postgresql;
 
-import org.apache.shardingsphere.sql.parser.base.DynamicLoadingSQLParserParameterizedIT;
-import org.apache.shardingsphere.sql.parser.loader.SQLCaseLoader;
-import org.apache.shardingsphere.sql.parser.loader.impl.GitHubSQLCaseLoadStrategy;
-import org.apache.shardingsphere.sql.parser.result.SQLParserCSVResultProcessor;
+import org.apache.shardingsphere.test.integration.sql.parser.base.DynamicLoadingSQLParserParameterizedIT;
+import org.apache.shardingsphere.test.integration.sql.parser.loader.SQLCaseLoader;
+import org.apache.shardingsphere.test.integration.sql.parser.loader.impl.GitHubSQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.integration.sql.parser.result.SQLParserCSVResultProcessor;
 import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized.Parameters;
@@ -35,11 +35,6 @@ public final class DynamicLoadingPostgreSQLParserParameterizedIT extends Dynamic
         super(sqlCaseId, sqlCaseValue, "PostgreSQL", new SQLParserCSVResultProcessor("PostgreSQL"));
     }
     
-    /**
-     * Get test parameters.
-     *
-     * @return Test cases from GitHub.
-     **/
     @Parameters(name = "{0} (PostgreSQL) -> {1}")
     public static Collection<Object[]> getTestParameters() {
         return new SQLCaseLoader(new GitHubSQLCaseLoadStrategy()).load(
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserCSVResultProcessor.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserCSVResultProcessor.java
similarity index 94%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserCSVResultProcessor.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserCSVResultProcessor.java
index 302a8ce8176..d12c90779c0 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserCSVResultProcessor.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserCSVResultProcessor.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.result;
+package org.apache.shardingsphere.test.integration.sql.parser.result;
 
 import lombok.Getter;
 import org.apache.commons.csv.CSVFormat;
 import org.apache.commons.csv.CSVPrinter;
-import org.apache.shardingsphere.sql.parser.env.IntegrationTestEnvironment;
+import org.apache.shardingsphere.test.integration.sql.parser.env.IntegrationTestEnvironment;
 
 import java.io.File;
 import java.io.FileWriter;
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserLogResultProcessor.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserLogResultProcessor.java
similarity index 94%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserLogResultProcessor.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserLogResultProcessor.java
index 6c508e51891..8636a732535 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserLogResultProcessor.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserLogResultProcessor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.result;
+package org.apache.shardingsphere.test.integration.sql.parser.result;
 
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserResultProcessor.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserResultProcessor.java
similarity index 94%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserResultProcessor.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserResultProcessor.java
index 512fc2f5ff9..e570ebe2417 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserResultProcessor.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserResultProcessor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.result;
+package org.apache.shardingsphere.test.integration.sql.parser.result;
 
 /**
  * SQL parser result processor.
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserResultProcessorManager.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserResultProcessorManager.java
similarity index 95%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserResultProcessorManager.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserResultProcessorManager.java
index d588fbcc0ce..0efe216cb9a 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/result/SQLParserResultProcessorManager.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/SQLParserResultProcessorManager.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.result;
+package org.apache.shardingsphere.test.integration.sql.parser.result;
 
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.sql.parser.env.IntegrationTestEnvironment;
+import org.apache.shardingsphere.test.integration.sql.parser.env.IntegrationTestEnvironment;
 
 import java.io.File;
 import java.lang.reflect.Constructor;