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 2020/08/20 01:10:16 UTC

[GitHub] [shardingsphere] taojintianxia opened a new pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

taojintianxia opened a new pull request #6945:
URL: https://github.com/apache/shardingsphere/pull/6945


   Fixes #6927.
   
   Changes proposed in this pull request:
   - add more test case
   
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

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



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/test/java/org/apache/shardingsphere/sharding/spring/boot/ShardingSpringBootStarterTest.java
##########
@@ -68,6 +74,47 @@ public void assertKeyGenerateAlgorithm() {
     @Test
     public void assertShardingConfiguration() {
         assertThat(shardingRuleConfiguration.getTables().size(), is(2));
-        // TODO assert sharding configuration
+        List<ShardingTableRuleConfiguration> shardingTableRuleConfigurationList = Lists.newArrayList(shardingRuleConfiguration.getTables());
+        assertThat(shardingTableRuleConfigurationList.get(0).getLogicTable(), is("t_order"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getActualDataNodes(), is("ds_$->{0..1}.t_order_$->{0..1}"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getTableShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingTableRuleConfigurationList.get(0).getTableShardingStrategy()).getShardingColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getTableShardingStrategy().getShardingAlgorithmName(), is("orderTableShardingAlgorithm"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getKeyGenerateStrategy().getColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getKeyGenerateStrategy().getKeyGeneratorName(), is("keyGenerator"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getLogicTable(), is("t_order_item"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getActualDataNodes(), is("ds_$->{0..1}.t_order_item_$->{0..1}"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getTableShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingTableRuleConfigurationList.get(1).getTableShardingStrategy()).getShardingColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getTableShardingStrategy().getShardingAlgorithmName(), is("orderItemTableShardingAlgorithm"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getKeyGenerateStrategy().getColumn(), is("order_item_id"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getKeyGenerateStrategy().getKeyGeneratorName(), is("keyGenerator"));
+
+        assertThat(shardingRuleConfiguration.getBindingTableGroups().size(), is(2));
+        List<String> bindingTableGroupsList = new ArrayList<>(shardingRuleConfiguration.getBindingTableGroups());
+        assertThat(bindingTableGroupsList.get(0), is("t_order"));
+        assertThat(bindingTableGroupsList.get(1), is("t_order_item"));
+
+        assertThat(shardingRuleConfiguration.getBroadcastTables().size(), is(1));
+        assertThat(shardingRuleConfiguration.getBroadcastTables().iterator().next(), is("t_config"));
+
+        assertThat(shardingRuleConfiguration.getDefaultDatabaseShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingRuleConfiguration.getDefaultDatabaseShardingStrategy()).getShardingColumn(), is("user_id"));
+        assertThat(shardingRuleConfiguration.getDefaultDatabaseShardingStrategy().getShardingAlgorithmName(), is("databaseShardingAlgorithm"));
+    
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().size(), is(3));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("t_order_item_$->{order_id % 2}"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("ds_$->{user_id % 2}"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("t_order_$->{order_id % 2}"));
+

Review comment:
       Please remove useless blank 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.

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



[GitHub] [shardingsphere] coveralls edited a comment on pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #6945:
URL: https://github.com/apache/shardingsphere/pull/6945#issuecomment-676892014


   ## Pull Request Test Coverage Report for [Build 13953](https://coveralls.io/builds/32904527)
   
   * **0** of **0**   changed or added relevant lines in **0** files are covered.
   * **193** unchanged lines in **8** files lost coverage.
   * Overall coverage increased (+**0.02%**) to **60.316%**
   
   ---
   
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-control-panel%2Fshardingsphere-orchestration%2Fshardingsphere-orchestration-core%2Fshardingsphere-orchestration-core-config%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Fcore%2Fconfig%2FConfigCenter.java#L175) | 1 | 89.91% |
   | [shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/util/ShardingAlgorithmPropertiesUtil.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-rdl-parser%2Fshardingsphere-rdl-parser-binder%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Frdl%2Fparser%2Fbinder%2Futil%2FShardingAlgorithmPropertiesUtil.java#L64) | 2 | 0% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/parser/DataSourceBeanDefinitionParser.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-spring%2Fshardingsphere-jdbc-orchestration-spring%2Fshardingsphere-jdbc-orchestration-spring-namespace%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fspring%2Fnamespace%2Forchestration%2Fparser%2FDataSourceBeanDefinitionParser.java#L52) | 3 | 86.36% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/orchestration/OrchestrationSpringBootConfiguration.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-spring%2Fshardingsphere-jdbc-orchestration-spring%2Fshardingsphere-jdbc-orchestration-spring-boot-starter%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fspring%2Fboot%2Forchestration%2FOrchestrationSpringBootConfiguration.java#L87) | 8 | 60.0% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/api/OrchestrationShardingSphereDataSourceFactory.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Fapi%2FOrchestrationShardingSphereDataSourceFactory.java#L56) | 10 | 0% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactory.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Fapi%2Fyaml%2FYamlOrchestrationShardingSphereDataSourceFactory.java#L87) | 14 | 54.84% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/internal/datasource/OrchestrationShardingSphereDataSource.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Finternal%2Fdatasource%2FOrchestrationShardingSphereDataSource.java#L108) | 68 | 50.0% |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDMLVisitor.java](https://coveralls.io/builds/32904527/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-dialect%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fmysql%2Fvisitor%2Fimpl%2FMySQLDMLVisitor.java#L203) | 87 | 0% |
   <!-- | **Total:** | **193** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/32904527/badge)](https://coveralls.io/builds/32904527) |
   | :-- | --: |
   | Change from base [Build 13918](https://coveralls.io/builds/32856926): |  0.02% |
   | Covered Lines: | 13772 |
   | Relevant Lines: | 22833 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] terrymanu merged pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

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


   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

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



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/test/java/org/apache/shardingsphere/sharding/spring/boot/ShardingSpringBootStarterTest.java
##########
@@ -68,6 +74,47 @@ public void assertKeyGenerateAlgorithm() {
     @Test
     public void assertShardingConfiguration() {
         assertThat(shardingRuleConfiguration.getTables().size(), is(2));
-        // TODO assert sharding configuration
+        List<ShardingTableRuleConfiguration> shardingTableRuleConfigurationList = Lists.newArrayList(shardingRuleConfiguration.getTables());
+        assertThat(shardingTableRuleConfigurationList.get(0).getLogicTable(), is("t_order"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getActualDataNodes(), is("ds_$->{0..1}.t_order_$->{0..1}"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getTableShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingTableRuleConfigurationList.get(0).getTableShardingStrategy()).getShardingColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getTableShardingStrategy().getShardingAlgorithmName(), is("orderTableShardingAlgorithm"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getKeyGenerateStrategy().getColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getKeyGenerateStrategy().getKeyGeneratorName(), is("keyGenerator"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getLogicTable(), is("t_order_item"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getActualDataNodes(), is("ds_$->{0..1}.t_order_item_$->{0..1}"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getTableShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingTableRuleConfigurationList.get(1).getTableShardingStrategy()).getShardingColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getTableShardingStrategy().getShardingAlgorithmName(), is("orderItemTableShardingAlgorithm"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getKeyGenerateStrategy().getColumn(), is("order_item_id"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getKeyGenerateStrategy().getKeyGeneratorName(), is("keyGenerator"));
+
+        assertThat(shardingRuleConfiguration.getBindingTableGroups().size(), is(2));
+        List<String> bindingTableGroupsList = new ArrayList<>(shardingRuleConfiguration.getBindingTableGroups());
+        assertThat(bindingTableGroupsList.get(0), is("t_order"));
+        assertThat(bindingTableGroupsList.get(1), is("t_order_item"));
+
+        assertThat(shardingRuleConfiguration.getBroadcastTables().size(), is(1));
+        assertThat(shardingRuleConfiguration.getBroadcastTables().iterator().next(), is("t_config"));
+
+        assertThat(shardingRuleConfiguration.getDefaultDatabaseShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingRuleConfiguration.getDefaultDatabaseShardingStrategy()).getShardingColumn(), is("user_id"));
+        assertThat(shardingRuleConfiguration.getDefaultDatabaseShardingStrategy().getShardingAlgorithmName(), is("databaseShardingAlgorithm"));
+    
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().size(), is(3));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("t_order_item_$->{order_id % 2}"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("ds_$->{user_id % 2}"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("t_order_$->{order_id % 2}"));
+

Review comment:
       For example:
   assertShardingConfiguration can be composited by assertTableShardingStrategy, assertDatabaseShardingStrategy, assertKeyGenerator etc...




----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] taojintianxia commented on a change in pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

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



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/test/java/org/apache/shardingsphere/sharding/spring/boot/ShardingSpringBootStarterTest.java
##########
@@ -68,6 +74,47 @@ public void assertKeyGenerateAlgorithm() {
     @Test
     public void assertShardingConfiguration() {
         assertThat(shardingRuleConfiguration.getTables().size(), is(2));
-        // TODO assert sharding configuration
+        List<ShardingTableRuleConfiguration> shardingTableRuleConfigurationList = Lists.newArrayList(shardingRuleConfiguration.getTables());
+        assertThat(shardingTableRuleConfigurationList.get(0).getLogicTable(), is("t_order"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getActualDataNodes(), is("ds_$->{0..1}.t_order_$->{0..1}"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getTableShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingTableRuleConfigurationList.get(0).getTableShardingStrategy()).getShardingColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getTableShardingStrategy().getShardingAlgorithmName(), is("orderTableShardingAlgorithm"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getKeyGenerateStrategy().getColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(0).getKeyGenerateStrategy().getKeyGeneratorName(), is("keyGenerator"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getLogicTable(), is("t_order_item"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getActualDataNodes(), is("ds_$->{0..1}.t_order_item_$->{0..1}"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getTableShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingTableRuleConfigurationList.get(1).getTableShardingStrategy()).getShardingColumn(), is("order_id"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getTableShardingStrategy().getShardingAlgorithmName(), is("orderItemTableShardingAlgorithm"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getKeyGenerateStrategy().getColumn(), is("order_item_id"));
+        assertThat(shardingTableRuleConfigurationList.get(1).getKeyGenerateStrategy().getKeyGeneratorName(), is("keyGenerator"));
+
+        assertThat(shardingRuleConfiguration.getBindingTableGroups().size(), is(2));
+        List<String> bindingTableGroupsList = new ArrayList<>(shardingRuleConfiguration.getBindingTableGroups());
+        assertThat(bindingTableGroupsList.get(0), is("t_order"));
+        assertThat(bindingTableGroupsList.get(1), is("t_order_item"));
+
+        assertThat(shardingRuleConfiguration.getBroadcastTables().size(), is(1));
+        assertThat(shardingRuleConfiguration.getBroadcastTables().iterator().next(), is("t_config"));
+
+        assertThat(shardingRuleConfiguration.getDefaultDatabaseShardingStrategy(), instanceOf(StandardShardingStrategyConfiguration.class));
+        assertThat(((StandardShardingStrategyConfiguration) shardingRuleConfiguration.getDefaultDatabaseShardingStrategy()).getShardingColumn(), is("user_id"));
+        assertThat(shardingRuleConfiguration.getDefaultDatabaseShardingStrategy().getShardingAlgorithmName(), is("databaseShardingAlgorithm"));
+    
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().size(), is(3));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderItemTableShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("t_order_item_$->{order_id % 2}"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("databaseShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("ds_$->{user_id % 2}"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm"), instanceOf(InlineShardingAlgorithm.class));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm").getType(), is("INLINE"));
+        assertThat(shardingRuleConfiguration.getShardingAlgorithms().get("orderTableShardingAlgorithm").getProps().getProperty("algorithm.expression"), is("t_order_$->{order_id % 2}"));
+

Review comment:
       that's for separete the different case . is that not the ss coding rule ? 




----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] taojintianxia commented on pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on pull request #6945:
URL: https://github.com/apache/shardingsphere/pull/6945#issuecomment-677977604


   > Separate the different case please extract different private methods
   
   I removed the blank 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.

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



[GitHub] [shardingsphere] coveralls commented on pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #6945:
URL: https://github.com/apache/shardingsphere/pull/6945#issuecomment-676892014


   ## Pull Request Test Coverage Report for [Build 13923](https://coveralls.io/builds/32875055)
   
   * **0** of **0**   changed or added relevant lines in **0** files are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage remained the same at **60.301%**
   
   ---
   
   
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/32875055/badge)](https://coveralls.io/builds/32875055) |
   | :-- | --: |
   | Change from base [Build 13918](https://coveralls.io/builds/32856926): |  0.0% |
   | Covered Lines: | 13713 |
   | Relevant Lines: | 22741 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] coveralls edited a comment on pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #6945:
URL: https://github.com/apache/shardingsphere/pull/6945#issuecomment-676892014


   ## Pull Request Test Coverage Report for [Build 13939](https://coveralls.io/builds/32884646)
   
   * **0** of **0**   changed or added relevant lines in **0** files are covered.
   * **74** unchanged lines in **6** files lost coverage.
   * Overall coverage decreased (**-0.007%**) to **60.294%**
   
   ---
   
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java](https://coveralls.io/builds/32884646/source?filename=shardingsphere-control-panel%2Fshardingsphere-orchestration%2Fshardingsphere-orchestration-core%2Fshardingsphere-orchestration-core-config%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Fcore%2Fconfig%2FConfigCenter.java#L175) | 1 | 89.91% |
   | [shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/util/ShardingAlgorithmPropertiesUtil.java](https://coveralls.io/builds/32884646/source?filename=shardingsphere-rdl-parser%2Fshardingsphere-rdl-parser-binder%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Frdl%2Fparser%2Fbinder%2Futil%2FShardingAlgorithmPropertiesUtil.java#L64) | 2 | 0% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/orchestration/OrchestrationSpringBootConfiguration.java](https://coveralls.io/builds/32884646/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-spring%2Fshardingsphere-jdbc-orchestration-spring%2Fshardingsphere-jdbc-orchestration-spring-boot-starter%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fspring%2Fboot%2Forchestration%2FOrchestrationSpringBootConfiguration.java#L87) | 8 | 60.0% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/api/OrchestrationShardingSphereDataSourceFactory.java](https://coveralls.io/builds/32884646/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Fapi%2FOrchestrationShardingSphereDataSourceFactory.java#L56) | 10 | 0% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactory.java](https://coveralls.io/builds/32884646/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Fapi%2Fyaml%2FYamlOrchestrationShardingSphereDataSourceFactory.java#L87) | 14 | 54.84% |
   | [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/internal/datasource/OrchestrationShardingSphereDataSource.java](https://coveralls.io/builds/32884646/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Finternal%2Fdatasource%2FOrchestrationShardingSphereDataSource.java#L108) | 39 | 62.33% |
   <!-- | **Total:** | **74** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/32884646/badge)](https://coveralls.io/builds/32884646) |
   | :-- | --: |
   | Change from base [Build 13918](https://coveralls.io/builds/32856926): |  -0.007% |
   | Covered Lines: | 13732 |
   | Relevant Lines: | 22775 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] terrymanu commented on pull request #6945: Add: add test case for shardingRuleConfiguration (#6927)

Posted by GitBox <gi...@apache.org>.
terrymanu commented on pull request #6945:
URL: https://github.com/apache/shardingsphere/pull/6945#issuecomment-678007293


   removed the blank line only is not enough, the assertion method is too long, please separate them to different private methods


----------------------------------------------------------------
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.

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