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/04/14 02:19:21 UTC

[GitHub] [shardingsphere] yangsen00 commented on a diff in pull request #16767: Add more unit test for TableRule. (#16289)

yangsen00 commented on code in PR #16767:
URL: https://github.com/apache/shardingsphere/pull/16767#discussion_r850030257


##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/TableRuleTest.java:
##########
@@ -154,4 +157,29 @@ public void assertActualDataNodesNotConfigured() {
         shardingTableRuleConfig.setTableShardingStrategy(new StandardShardingStrategyConfiguration("shardingColumn", "INLINE"));
         new TableRule(shardingTableRuleConfig, Arrays.asList("ds0", "ds1"), null);
     }
+
+    @Test
+    public void assertDatNodeGroups() {
+        LinkedList<String> dataSourceNames = new LinkedList<>();
+        String logicTableName = "table_0";
+        dataSourceNames.add("ds0");
+        dataSourceNames.add("ds1");
+        TableRule actual = new TableRule(dataSourceNames, logicTableName);
+        Map<String, List<DataNode>> dataNodeGroups = actual.getDataNodeGroups();
+        assertThat(dataNodeGroups.size(), is(2));
+        assertTrue(dataNodeGroups.get("ds0").contains(new DataNode("ds0", "table_0")));
+        assertTrue(dataNodeGroups.get("ds1").contains(new DataNode("ds1", "table_0")));
+    }
+
+    @Test
+    public void assertCreateAutoTableRuleWithdataSourceNames() {

Review Comment:
   hello, I have not solve this question,but this PR was closed, it will be OK?



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