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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]