You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/11/08 02:40:57 UTC

[shardingsphere] branch master updated: Remove temparory code and comment (#21998)

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

panjuan 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 82958adf2a3 Remove temparory code and comment (#21998)
82958adf2a3 is described below

commit 82958adf2a3bfd1a0e91acb6650265e18ed45c46
Author: 孙念君 Nianjun Sun <su...@apache.org>
AuthorDate: Tue Nov 8 10:40:50 2022 +0800

    Remove temparory code and comment (#21998)
---
 .../sql/parser/env/IntegrationTestEnvironment.java |  4 +-
 ... DynamicLoadingMySQLParserParameterizedIT.java} | 24 +++++++----
 ...micLoadingOpenGaussParserParameterizedTest.java | 40 ------------------
 ...amicLoadingPostgreSQLParserParameterizedIT.java | 49 ++++++++++++++++++++++
 ...icLoadingPostgreSQLParserParameterizedTest.java | 40 ------------------
 5 files changed, 67 insertions(+), 90 deletions(-)

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/sql/parser/env/IntegrationTestEnvironment.java
index c0f271a7917..cde505ed78f 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/sql/parser/env/IntegrationTestEnvironment.java
@@ -34,8 +34,8 @@ public final class IntegrationTestEnvironment {
     
     private IntegrationTestEnvironment() {
         props = loadProperties();
-        String sqlParserITEnabledStr = null == System.getProperty("sql.parser.it.enabled") ? System.getProperty("sql.parser.it.enabled") : props.get("sql.parser.it.enabled").toString();
-        sqlParserITEnabled = null != sqlParserITEnabledStr && Boolean.getBoolean(sqlParserITEnabledStr);
+        String sqlParserITEnabledStr = null == System.getProperty("sql.parser.it.enabled") ? props.get("sql.parser.it.enabled").toString() : System.getProperty("sql.parser.it.enabled");
+        sqlParserITEnabled = null == sqlParserITEnabledStr ? false : Boolean.parseBoolean(sqlParserITEnabledStr);
     }
     
     /**
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedTest.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
similarity index 52%
rename from test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedTest.java
rename to test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
index 56fdd499761..0928b3554a9 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedTest.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/mysql/DynamicLoadingMySQLParserParameterizedIT.java
@@ -17,24 +17,32 @@
 
 package org.apache.shardingsphere.sql.parser.mysql;
 
+import org.apache.shardingsphere.sql.parser.env.IntegrationTestEnvironment;
+import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
+import org.apache.shardingsphere.test.sql.parser.parameterized.engine.DynamicLoadingSQLParserParameterizedTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+
 import java.util.Collection;
 import java.util.Collections;
 
-//@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class DynamicLoadingMySQLParserParameterizedTest {
+@RunWith(ShardingSphereParallelTestParameterized.class)
+public final class DynamicLoadingMySQLParserParameterizedIT extends DynamicLoadingSQLParserParameterizedTest {
     
-    // public DynamicLoadingMySQLParserParameterizedTest(final String sqlCaseId, final String sqlCaseValue) {
-    // super(sqlCaseId, sqlCaseValue, "MySQL");
-    // }
+    public DynamicLoadingMySQLParserParameterizedIT(final String sqlCaseId, final String sqlCaseValue) {
+        super(sqlCaseId, sqlCaseValue, "MySQL");
+    }
     
     /**
      * Get test parameters.
      *
-     * @return Test cases from github.
+     * @return Test cases from GitHub.
      */
-    // @Parameters(name = "{0} (MySQL) -> {1}")
+    @Parameters(name = "{0} (MySQL) -> {1}")
     public static Collection<Object[]> getTestParameters() {
+        if (IntegrationTestEnvironment.getInstance().isSqlParserITEnabled()) {
+            return DynamicLoadingSQLParserParameterizedTest.getTestParameters("https://github.com/mysql/mysql-server/tree/8.0/mysql-test/t");
+        }
         return Collections.emptyList();
-        // return DynamicLoadingSQLParserParameterizedTest.getTestParameters("https://github.com/mysql/mysql-server/tree/8.0/mysql-test/t");
     }
 }
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/DynamicLoadingOpenGaussParserParameterizedTest.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/DynamicLoadingOpenGaussParserParameterizedTest.java
deleted file mode 100644
index b57f99f5db1..00000000000
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/DynamicLoadingOpenGaussParserParameterizedTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.sql.parser.opengauss;
-
-import java.util.Collection;
-import java.util.Collections;
-
-//@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class DynamicLoadingOpenGaussParserParameterizedTest {
-    
-    // public DynamicLoadingOpenGaussParserParameterizedTest(final String sqlCaseId, final String sqlCaseValue) {
-    // super(sqlCaseId, sqlCaseValue, "openGauss");
-    // }
-    
-    /**
-     * Get test parameters.
-     *
-     * @return Test cases from github.
-     */
-    // @Parameters(name = "{0} (openGauss) -> {1}")
-    public static Collection<Object[]> getTestParameters() {
-        return Collections.emptyList();
-        // return DynamicLoadingSQLParserParameterizedTest.getTestParameters("https://github.com/opengauss-mirror/Yat/tree/master/openGaussBase/testcase");
-    }
-}
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/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
new file mode 100644
index 00000000000..a3345a8587d
--- /dev/null
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedIT.java
@@ -0,0 +1,49 @@
+/*
+ * 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.sql.parser.postgresql;
+
+import org.apache.shardingsphere.sql.parser.env.IntegrationTestEnvironment;
+import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
+import org.apache.shardingsphere.test.sql.parser.parameterized.engine.DynamicLoadingSQLParserParameterizedTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+
+@RunWith(ShardingSphereParallelTestParameterized.class)
+public final class DynamicLoadingPostgreSQLParserParameterizedIT extends DynamicLoadingSQLParserParameterizedTest {
+    
+    public DynamicLoadingPostgreSQLParserParameterizedIT(final String sqlCaseId, final String sqlCaseValue) {
+        super(sqlCaseId, sqlCaseValue, "PostgreSQL");
+    }
+    
+    /**
+     * Get test parameters.
+     *
+     * @return Test cases from GitHub.
+     **/
+    @Parameters(name = "{0} (PostgreSQL) -> {1}")
+    public static Collection<Object[]> getTestParameters() throws IOException {
+        if (IntegrationTestEnvironment.getInstance().isSqlParserITEnabled()) {
+            return DynamicLoadingSQLParserParameterizedTest.getTestParameters("https://github.com/postgres/postgres/tree/master/src/test/regress/sql");
+        }
+        return Collections.emptyList();
+    }
+}
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedTest.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedTest.java
deleted file mode 100644
index a1ba806e09c..00000000000
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/DynamicLoadingPostgreSQLParserParameterizedTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.sql.parser.postgresql;
-
-import java.util.Collection;
-import java.util.Collections;
-
-//@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class DynamicLoadingPostgreSQLParserParameterizedTest {
-    
-    // public DynamicLoadingPostgreSQLParserParameterizedTest(final String sqlCaseId, final String sqlCaseValue) {
-    // super(sqlCaseId, sqlCaseValue, "PostgreSQL");
-    // }
-    
-    /**
-     * Get test parameters.
-     *
-     * @return Test cases from github.
-     **/
-    // @Parameters(name = "{0} (PostgreSQL) -> {1}")
-    public static Collection<Object[]> getTestParameters() {
-        return Collections.emptyList();
-        // return DynamicLoadingSQLParserParameterizedTest.getTestParameters("https://github.com/postgres/postgres/tree/master/src/test/regress/sql");
-    }
-}