You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/07/02 08:30:13 UTC

[GitHub] [shardingsphere] zzq1314zll opened a new pull request #11107: [ISSUE #10992] Add unit test for SQLParserEngine

zzq1314zll opened a new pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107


   [ISSUE #10992] Add unit test for SQLParserEngine
   -
   -
   -
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] soulasuna commented on a change in pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#discussion_r662909337



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {

Review comment:
       No annotations are required for test classes.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        
+        Field modifiersField = Field.class.getDeclaredField("modifiers");

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        sqlParserExecutorFiled.setAccessible(true);
+        parseTreeCacheField.setAccessible(true);
+        
+        sqlParserExecutorFiled.set(sqlParserEngine, sqlParserExecutor);
+        parseTreeCacheField.set(sqlParserEngine, parseTreeCache);
+        
+        sqlParserEngine.parse(SQL, true);

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        sqlParserExecutorFiled.setAccessible(true);

Review comment:
       Modify the extra blank lines.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * SQL parser engine test.
+ *
+ * @author zzq
+ */
+public class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        
+        sqlParserExecutorFiled.setAccessible(true);
+        parseTreeCacheField.setAccessible(true);
+        
+        sqlParserExecutorFiled.set(sqlParserEngine, sqlParserExecutor);
+        parseTreeCacheField.set(sqlParserEngine, parseTreeCache);
+        
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, false);
+        verify(sqlParserExecutor, times(2)).parse(SQL);
+    }
+    
+}

Review comment:
       Modify the extra blank lines.
   Leave a blank line on the last line




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] zzq1314zll commented on a change in pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
zzq1314zll commented on a change in pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#discussion_r663716795



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public final class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        sqlParserExecutorFiled.setAccessible(true);
+        parseTreeCacheField.setAccessible(true);
+        sqlParserExecutorFiled.set(sqlParserEngine, sqlParserExecutor);
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        parseTreeCacheField.set(sqlParserEngine, parseTreeCache);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, false);
+        verify(sqlParserExecutor, times(2)).parse(SQL);
+    }
+    

Review comment:
       I may not be familiar with SS, the last test can not be completed, sorry!Wait until I get familiar with it before continuing.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on a change in pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#discussion_r663644153



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public final class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        sqlParserExecutorFiled.setAccessible(true);
+        parseTreeCacheField.setAccessible(true);
+        sqlParserExecutorFiled.set(sqlParserEngine, sqlParserExecutor);
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        parseTreeCacheField.set(sqlParserEngine, parseTreeCache);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, false);
+        verify(sqlParserExecutor, times(2)).parse(SQL);
+    }
+    

Review comment:
       Hi @zzq1314zll Thanks for this Nice job. ;-)
   
   Actually, we suggest our contributors remove redundant blank lines. If you really need a new line to split your programming, which means you need a new function to handle it. Therefore, this line 73 is expected to be removed.  Sometimes, developers will feel dull about these checkstyle or formatting issues, but please believe people all over the world will enjoy your elegant programming.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero merged pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#issuecomment-873060937


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11107](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (28538bd) into [master](https://codecov.io/gh/apache/shardingsphere/commit/965765269a07d30ba0b1e103bd38388dc010dcf2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9657652) will **increase** coverage by `0.05%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11107/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11107      +/-   ##
   ============================================
   + Coverage     63.91%   63.97%   +0.05%     
   - Complexity     1022     1023       +1     
   ============================================
     Files          2175     2175              
     Lines         33306    33335      +29     
     Branches       5829     5833       +4     
   ============================================
   + Hits          21289    21325      +36     
   + Misses        10320    10312       -8     
   - Partials       1697     1698       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ackend/communication/SQLStatementSchemaHolder.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL1NRTFN0YXRlbWVudFNjaGVtYUhvbGRlci5qYXZh) | `33.33% <0.00%> (-33.34%)` | :arrow_down: |
   | [...config/YamlDatabaseDiscoveryRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYmRpc2NvdmVyeS95YW1sL2NvbmZpZy9ZYW1sRGF0YWJhc2VEaXNjb3ZlcnlSdWxlQ29uZmlndXJhdGlvbi5qYXZh) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `80.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [...ackend/text/TextProtocolBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L1RleHRQcm90b2NvbEJhY2tlbmRIYW5kbGVyRmFjdG9yeS5qYXZh) | `71.42% <0.00%> (-6.70%)` | :arrow_down: |
   | [.../DropShardingBindingTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC91cGRhdGUvRHJvcFNoYXJkaW5nQmluZGluZ1RhYmxlUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `50.00% <0.00%> (-5.56%)` | :arrow_down: |
   | [...ropShardingBroadcastTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC91cGRhdGUvRHJvcFNoYXJkaW5nQnJvYWRjYXN0VGFibGVSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `50.00% <0.00%> (-5.56%)` | :arrow_down: |
   | [...terShardingBroadcastTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC91cGRhdGUvQWx0ZXJTaGFyZGluZ0Jyb2FkY2FzdFRhYmxlUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `66.66% <0.00%> (-4.77%)` | :arrow_down: |
   | [...DatabaseDiscoveryRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYmRpc2NvdmVyeS95YW1sL3N3YXBwZXIvRGF0YWJhc2VEaXNjb3ZlcnlSdWxlQ29uZmlndXJhdGlvbllhbWxTd2FwcGVyLmphdmE=) | `87.50% <0.00%> (-4.17%)` | :arrow_down: |
   | [...y/binary/execute/PostgreSQLComExecuteExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvZnJvbnRlbmQvcG9zdGdyZXNxbC9jb21tYW5kL3F1ZXJ5L2JpbmFyeS9leGVjdXRlL1Bvc3RncmVTUUxDb21FeGVjdXRlRXhlY3V0b3IuamF2YQ==) | `66.66% <0.00%> (-3.93%)` | :arrow_down: |
   | [...istsql/update/DropEncryptRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC91cGRhdGUvRHJvcEVuY3J5cHRSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `73.91% <0.00%> (-3.36%)` | :arrow_down: |
   | ... and [52 more](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9657652...28538bd](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#issuecomment-873060937


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11107](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2905d35) into [master](https://codecov.io/gh/apache/shardingsphere/commit/965765269a07d30ba0b1e103bd38388dc010dcf2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9657652) will **increase** coverage by `0.03%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11107/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11107      +/-   ##
   ============================================
   + Coverage     63.91%   63.95%   +0.03%     
   - Complexity     1022     1023       +1     
   ============================================
     Files          2175     2175              
     Lines         33306    33350      +44     
     Branches       5829     5833       +4     
   ============================================
   + Hits          21289    21330      +41     
   - Misses        10320    10322       +2     
   - Partials       1697     1698       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ackend/communication/SQLStatementSchemaHolder.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL1NRTFN0YXRlbWVudFNjaGVtYUhvbGRlci5qYXZh) | `33.33% <0.00%> (-33.34%)` | :arrow_down: |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `80.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [...ackend/text/TextProtocolBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L1RleHRQcm90b2NvbEJhY2tlbmRIYW5kbGVyRmFjdG9yeS5qYXZh) | `71.42% <0.00%> (-6.70%)` | :arrow_down: |
   | [.../DropShardingBindingTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC91cGRhdGUvRHJvcFNoYXJkaW5nQmluZGluZ1RhYmxlUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `50.00% <0.00%> (-5.56%)` | :arrow_down: |
   | [...ropShardingBroadcastTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC91cGRhdGUvRHJvcFNoYXJkaW5nQnJvYWRjYXN0VGFibGVSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `50.00% <0.00%> (-5.56%)` | :arrow_down: |
   | [...terShardingBroadcastTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC91cGRhdGUvQWx0ZXJTaGFyZGluZ0Jyb2FkY2FzdFRhYmxlUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `66.66% <0.00%> (-4.77%)` | :arrow_down: |
   | [...y/binary/execute/PostgreSQLComExecuteExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvZnJvbnRlbmQvcG9zdGdyZXNxbC9jb21tYW5kL3F1ZXJ5L2JpbmFyeS9leGVjdXRlL1Bvc3RncmVTUUxDb21FeGVjdXRlRXhlY3V0b3IuamF2YQ==) | `66.66% <0.00%> (-3.93%)` | :arrow_down: |
   | [...istsql/update/DropEncryptRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC91cGRhdGUvRHJvcEVuY3J5cHRSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `73.91% <0.00%> (-3.36%)` | :arrow_down: |
   | [...ate/DropDatabaseDiscoveryRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYmRpc2NvdmVyeS9kaXN0c3FsL3VwZGF0ZS9Ecm9wRGF0YWJhc2VEaXNjb3ZlcnlSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `73.91% <0.00%> (-3.36%)` | :arrow_down: |
   | [...te/DropReadwriteSplittingRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9kaXN0c3FsL3VwZGF0ZS9Ecm9wUmVhZHdyaXRlU3BsaXR0aW5nUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `75.00% <0.00%> (-3.27%)` | :arrow_down: |
   | ... and [38 more](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9657652...2905d35](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#issuecomment-873060937


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11107](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (711891f) into [master](https://codecov.io/gh/apache/shardingsphere/commit/965765269a07d30ba0b1e103bd38388dc010dcf2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9657652) will **decrease** coverage by `0.29%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11107/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11107      +/-   ##
   ============================================
   - Coverage     63.91%   63.62%   -0.30%     
   + Complexity     1022     1021       -1     
   ============================================
     Files          2175     2166       -9     
     Lines         33306    33287      -19     
     Branches       5829     5835       +6     
   ============================================
   - Hits          21289    21179     -110     
   - Misses        10320    10412      +92     
   + Partials       1697     1696       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ackend/communication/SQLStatementSchemaHolder.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL1NRTFN0YXRlbWVudFNjaGVtYUhvbGRlci5qYXZh) | `33.33% <0.00%> (-33.34%)` | :arrow_down: |
   | [...config/YamlDatabaseDiscoveryRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYmRpc2NvdmVyeS95YW1sL2NvbmZpZy9ZYW1sRGF0YWJhc2VEaXNjb3ZlcnlSdWxlQ29uZmlndXJhdGlvbi5qYXZh) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...onfig/YamlReadwriteSplittingRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy95YW1sL2NvbmZpZy9ZYW1sUmVhZHdyaXRlU3BsaXR0aW5nUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...rypt/yaml/config/YamlEncryptRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9jb25maWcvWWFtbEVuY3J5cHRSdWxlQ29uZmlndXJhdGlvbi5qYXZh) | `80.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `80.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [...ShardingAutoTableRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9zd2FwcGVyL3J1bGUvU2hhcmRpbmdBdXRvVGFibGVSdWxlQ29uZmlndXJhdGlvbllhbWxTd2FwcGVyLmphdmE=) | `66.66% <0.00%> (-16.67%)` | :arrow_down: |
   | [...ing/yaml/config/YamlShardingRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9jb25maWcvWWFtbFNoYXJkaW5nUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `87.50% <0.00%> (-12.50%)` | :arrow_down: |
   | [.../swapper/ShardingRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9zd2FwcGVyL1NoYXJkaW5nUnVsZUNvbmZpZ3VyYXRpb25ZYW1sU3dhcHBlci5qYXZh) | `80.70% <0.00%> (-12.29%)` | :arrow_down: |
   | [...thm/sharding/hint/HintInlineShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2hpbnQvSGludElubGluZVNoYXJkaW5nQWxnb3JpdGhtLmphdmE=) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [...ackend/text/TextProtocolBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L1RleHRQcm90b2NvbEJhY2tlbmRIYW5kbGVyRmFjdG9yeS5qYXZh) | `71.42% <0.00%> (-6.70%)` | :arrow_down: |
   | ... and [133 more](https://codecov.io/gh/apache/shardingsphere/pull/11107/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9657652...711891f](https://codecov.io/gh/apache/shardingsphere/pull/11107?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on a change in pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#discussion_r663485777



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class SQLParserEngineTest {

Review comment:
       Hi @zzq1314zll 
   Thanks for your first PR here. ;-) 
   Could U define these test classes as final classes? As you know, these classes are bound to have no child classes extending them, aren't they?

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class SQLParserEngineTest {

Review comment:
       Generally LGTM. 




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] zzq1314zll commented on a change in pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
zzq1314zll commented on a change in pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#discussion_r663600527



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class SQLParserEngineTest {

Review comment:
       Okay thank you




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] zzq1314zll commented on a change in pull request #11107: [ISSUE #10992] Add unit test for shardingsphere-sql-parser-engine

Posted by GitBox <gi...@apache.org>.
zzq1314zll commented on a change in pull request #11107:
URL: https://github.com/apache/shardingsphere/pull/11107#discussion_r663716795



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/api/SQLParserEngineTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.api;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor;
+import org.junit.Test;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public final class SQLParserEngineTest {
+    
+    private static final String SQL = "SELECT COUNT(*) FROM user";
+    
+    @Test
+    public void assertParse() throws NoSuchFieldException, IllegalAccessException {
+        SQLParserExecutor sqlParserExecutor = mock(SQLParserExecutor.class);
+        when(sqlParserExecutor.parse(SQL)).thenReturn(mock(ParseTree.class));
+        SQLParserEngine sqlParserEngine = new SQLParserEngine("H2");
+        Field sqlParserExecutorFiled = sqlParserEngine.getClass().getDeclaredField("sqlParserExecutor");
+        Field modifiersField = Field.class.getDeclaredField("modifiers");
+        modifiersField.setAccessible(true);
+        modifiersField.setInt(sqlParserExecutorFiled, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        Field modifiersField2 = Field.class.getDeclaredField("modifiers");
+        modifiersField2.setAccessible(true);
+        Field parseTreeCacheField = sqlParserEngine.getClass().getDeclaredField("parseTreeCache");
+        modifiersField2.setInt(parseTreeCacheField, sqlParserExecutorFiled.getModifiers() & ~Modifier.FINAL);
+        sqlParserExecutorFiled.setAccessible(true);
+        parseTreeCacheField.setAccessible(true);
+        sqlParserExecutorFiled.set(sqlParserEngine, sqlParserExecutor);
+        LoadingCache<String, ParseTree> parseTreeCache = CacheBuilder.newBuilder().softValues().initialCapacity(128)
+                .maximumSize(1024).concurrencyLevel(4).build(new CacheLoader<String, ParseTree>() {
+                    @ParametersAreNonnullByDefault
+                    @Override
+                    public ParseTree load(final String sql) {
+                        return sqlParserExecutor.parse(sql);
+                    }
+                });
+        parseTreeCacheField.set(sqlParserEngine, parseTreeCache);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, true);
+        verify(sqlParserExecutor, times(1)).parse(SQL);
+        sqlParserEngine.parse(SQL, false);
+        verify(sqlParserExecutor, times(2)).parse(SQL);
+    }
+    

Review comment:
       I may not be familiar with SS, the last test can not be completed, sorry!Wait until I get familiar with it before continuing.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org