/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * Licensed 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.
 * </p>
 */

package io.shardingsphere.orchestration.internal.rule;

import io.shardingsphere.api.config.ShardingRuleConfiguration;
import io.shardingsphere.api.config.TableRuleConfiguration;
import org.junit.Before;

public class OrchestrationShardingRuleTest {
    
    private OrchestrationShardingRule orchestrationShardingRule;
    
    @Before
    public void setUp() {
    
    }
    
    private ShardingRuleConfiguration getShardingRuleConfiguration() {
        ShardingRuleConfiguration result = new ShardingRuleConfiguration();
        result.set
    }
    
    private TableRuleConfiguration createTableRuleConfig() {
        TableRuleConfiguration result = new TableRuleConfiguration();
        result.setLogicTable("t_order");
        result.setActualDataNodes("ds_${0..1}.t_order_${0..2}");
        return result;
    }
    
}
    
@@ -702,125 +702,469 @@
 api.
-config.ShardingRuleConfiguration;%0Aimport io.shardingsphere.api.config.TableRuleConfiguration;%0Aimport org.junit.Before
+algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm;%0Aimport io.shardingsphere.api.config.MasterSlaveRuleConfiguration;%0Aimport io.shardingsphere.api.config.ShardingRuleConfiguration;%0Aimport io.shardingsphere.api.config.TableRuleConfiguration;%0Aimport io.shardingsphere.api.config.strategy.InlineShardingStrategyConfiguration;%0Aimport io.shardingsphere.api.config.strategy.NoneShardingStrategyConfiguration;%0Aimport org.junit.Before;%0A%0Aimport java.util.Arrays
 ;%0A%0Ap
@@ -1320,24 +1320,174 @@
 tUp() %7B%0A    
+    orchestrationShardingRule = new OrchestrationShardingRule(getShardingRuleConfiguration(), Arrays.asList(%22master_db%22, %22slave_db_0%22, %22slave_db_1%22));
 %0A    %7D%0A    %0A
@@ -1641,26 +1641,1049 @@
         
-result.set
+TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration();%0A        tableRuleConfig.setLogicTable(%22t_order%22);%0A        tableRuleConfig.setActualDataNodes(%22ds_ms.t_order_$%7B0..1%7D%22);%0A        result.getTableRuleConfigs().add(tableRuleConfig);%0A        result.getMasterSlaveRuleConfigs().add(getMasterSlaveRuleConfiguration());%0A        result.setDefaultDatabaseShardingStrategyConfig(new NoneShardingStrategyConfiguration());%0A        result.setDefaultTableShardingStrategyConfig(new InlineShardingStrategyConfiguration(%22order_id%22, %22t_order_$%7Border_id %25 2%7D%22));%0A        return result;%0A    %7D%0A    %0A    private MasterSlaveRuleConfiguration getMasterSlaveRuleConfiguration() %7B%0A        MasterSlaveRuleConfiguration result = new MasterSlaveRuleConfiguration();%0A        result.setName(%22ds_ms%22);%0A        result.setLoadBalanceAlgorithm(new RandomMasterSlaveLoadBalanceAlgorithm());%0A        result.setMasterDataSourceName(%22master_db%22);%0A        result.setSlaveDataSourceNames(Arrays.asList(%22slave_db_0%22, %22slave_db_1%22));%0A        return result;
 %0A    %7D%0A 

modify setUp()