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 2022/08/01 07:51:35 UTC

[GitHub] [shardingsphere] tianhao960 opened a new pull request, #19743: Add test cases for RDL (3 branches) in TextProtocolBackendHandlerFact…

tianhao960 opened a new pull request, #19743:
URL: https://github.com/apache/shardingsphere/pull/19743

   …oryTest
   
   Fixes #7522.
   
   Changes proposed in this pull request:
   -Add test cases for RDL (3 branches) in TextProtocolBackendHandlerFactory
   -
   -
   


-- 
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] terrymanu merged pull request #19743: Add test cases for RDL (3 branches) in TextProtocolBackendHandlerFactoryTest

Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #19743:
URL: https://github.com/apache/shardingsphere/pull/19743


-- 
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] tianhao960 commented on a diff in pull request #19743: Add test cases for RDL (3 branches) in TextProtocolBackendHandlerFactoryTest

Posted by GitBox <gi...@apache.org>.
tianhao960 commented on code in PR #19743:
URL: https://github.com/apache/shardingsphere/pull/19743#discussion_r934356462


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/TextProtocolBackendHandlerFactoryTest.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * 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.proxy.backend.handler;
+
+import lombok.SneakyThrows;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.alter.AlterResourceStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.create.AddResourceStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.drop.DropResourceStatement;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.RDLBackendHandlerFactory;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.AddResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.AlterResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.DropResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
+import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.junit.Assert.assertThat;
+
+@RunWith(MockitoJUnitRunner.class)
+public class TextProtocolBackendHandlerFactoryTest extends ProxyContextRestorer {

Review Comment:
   ok, get it . I will move the test class to package org.apache.shardingsphere.proxy.backend.handler.distsql.rdl and change class name.



-- 
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] terrymanu commented on a diff in pull request #19743: Add test cases for RDL (3 branches) in TextProtocolBackendHandlerFactoryTest

Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #19743:
URL: https://github.com/apache/shardingsphere/pull/19743#discussion_r934350002


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/TextProtocolBackendHandlerFactoryTest.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * 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.proxy.backend.handler;
+
+import lombok.SneakyThrows;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.alter.AlterResourceStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.create.AddResourceStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.drop.DropResourceStatement;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.RDLBackendHandlerFactory;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.AddResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.AlterResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.DropResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
+import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.junit.Assert.assertThat;
+
+@RunWith(MockitoJUnitRunner.class)
+public class TextProtocolBackendHandlerFactoryTest extends ProxyContextRestorer {

Review Comment:
   Please add final if class does not design for extend.



##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/TextProtocolBackendHandlerFactoryTest.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * 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.proxy.backend.handler;
+
+import lombok.SneakyThrows;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.alter.AlterResourceStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.create.AddResourceStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.drop.DropResourceStatement;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.RDLBackendHandlerFactory;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.AddResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.AlterResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.resource.DropResourceBackendHandler;
+import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
+import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.junit.Assert.assertThat;
+
+@RunWith(MockitoJUnitRunner.class)
+public class TextProtocolBackendHandlerFactoryTest extends ProxyContextRestorer {

Review Comment:
   Is it necessary to extends `ProxyContextRestorer`?



-- 
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 #19743: Add test cases for RDL (3 branches) in TextProtocolBackendHandlerFact…

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/19743?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 [#19743](https://codecov.io/gh/apache/shardingsphere/pull/19743?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (def4a99) into [master](https://codecov.io/gh/apache/shardingsphere/commit/389c412a69b53147f21ea2fba185104470777c38?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (389c412) will **increase** coverage by `0.00%`.
   > The diff coverage is `32.14%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #19743   +/-   ##
   =========================================
     Coverage     60.08%   60.08%           
     Complexity     2398     2398           
   =========================================
     Files          3853     3853           
     Lines         54912    54913    +1     
     Branches       7668     7668           
   =========================================
   + Hits          32992    32993    +1     
     Misses        19087    19087           
     Partials       2833     2833           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/19743?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...on/optimizer/converter/SQLNodeConverterEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL1NRTE5vZGVDb252ZXJ0ZXJFbmdpbmUuamF2YQ==) | `10.00% <0.00%> (ø)` | |
   | [...ter/segment/expression/impl/FunctionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvZXhwcmVzc2lvbi9pbXBsL0Z1bmN0aW9uQ29udmVydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...gment/expression/impl/ListExpressionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvZXhwcmVzc2lvbi9pbXBsL0xpc3RFeHByZXNzaW9uQ29udmVydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...verter/segment/from/impl/SimpleTableConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvZnJvbS9pbXBsL1NpbXBsZVRhYmxlQ29udmVydGVyLmphdmE=) | `23.07% <0.00%> (ø)` | |
   | [...gment/orderby/item/ColumnOrderByItemConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvb3JkZXJieS9pdGVtL0NvbHVtbk9yZGVyQnlJdGVtQ29udmVydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...rojection/impl/AggregationProjectionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvcHJvamVjdGlvbi9pbXBsL0FnZ3JlZ2F0aW9uUHJvamVjdGlvbkNvbnZlcnRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ent/projection/impl/ColumnProjectionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvcHJvamVjdGlvbi9pbXBsL0NvbHVtblByb2plY3Rpb25Db252ZXJ0ZXIuamF2YQ==) | `10.52% <0.00%> (ø)` | |
   | [...projection/impl/ExpressionProjectionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvcHJvamVjdGlvbi9pbXBsL0V4cHJlc3Npb25Qcm9qZWN0aW9uQ29udmVydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...t/projection/impl/SubqueryProjectionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvcHJvamVjdGlvbi9pbXBsL1N1YnF1ZXJ5UHJvamVjdGlvbkNvbnZlcnRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ario/rulealtered/RuleAlteredJobPersistService.java](https://codecov.io/gh/apache/shardingsphere/pull/19743/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL3NjZW5hcmlvL3J1bGVhbHRlcmVkL1J1bGVBbHRlcmVkSm9iUGVyc2lzdFNlcnZpY2UuamF2YQ==) | `0.00% <ø> (ø)` | |
   | ... and [7 more](https://codecov.io/gh/apache/shardingsphere/pull/19743/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) | |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?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