Jacob953 commented on code in PR #21431: URL: https://github.com/apache/shardingsphere/pull/21431#discussion_r1013148500
########## test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/DynamicLoadingSQLParserParameterizedTest.java: ########## @@ -0,0 +1,145 @@ +/* + * 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.sql.parser.parameterized.engine; + +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.sql.parser.exception.SQLParsingException; +import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.testng.asserts.IAssert; +import org.testng.asserts.SoftAssert; + +import java.io.IOException; +import java.util.Collection; +import java.util.LinkedList; +import java.util.Objects; +import java.util.Properties; + +@RunWith(Parameterized.class) +public final class DynamicLoadingSQLParserParameterizedTest extends SoftAssert { + + private static final String SQL_CASE_FILE_MARKER = "js-navigation-open Link--primary"; + + private static final String SQL_CASE_MARKER = "blob-code blob-code-inner js-file-line"; + + private static boolean inBracket; + + private static StringBuilder sqlCase; + + private static int sqlCaseId; + + private static String sqlCaseURL; + + private static String databaseType; + + public DynamicLoadingSQLParserParameterizedTest() { + sqlCaseURL = System.getProperty("url"); + databaseType = System.getProperty("database"); + } + + private static String[] getSqlCaseFiles(final String sqlCaseURL) throws IOException { + Document document = Jsoup.connect(sqlCaseURL).get(); + return document.getElementsByClass(SQL_CASE_FILE_MARKER).text().split("\\s+"); + } + + private static Collection<Object[]> getTestParameters(final String databaseType) throws IOException { Review Comment: fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
