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


##########
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, is this OK?
   
   @yangsen00 You can submit a new pr to cover this case, I will reopen this 
issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to