Search in sources :

Example 1 with RoundRobinMasterSlaveLoadBalanceAlgorithm

use of io.shardingjdbc.core.api.algorithm.masterslave.RoundRobinMasterSlaveLoadBalanceAlgorithm in project sharding-jdbc by shardingjdbc.

the class OrchestrationMasterSlaveNamespaceTest method assertTypeMasterSlaveDataSource.

@Test
public void assertTypeMasterSlaveDataSource() {
    MasterSlaveRule randomSlaveRule = getMasterSlaveRule("randomMasterSlaveDataSource");
    MasterSlaveRule roundRobinSlaveRule = getMasterSlaveRule("roundRobinMasterSlaveDataSource");
    assertTrue(randomSlaveRule.getLoadBalanceAlgorithm() instanceof RandomMasterSlaveLoadBalanceAlgorithm);
    assertTrue(roundRobinSlaveRule.getLoadBalanceAlgorithm() instanceof RoundRobinMasterSlaveLoadBalanceAlgorithm);
}
Also used : RoundRobinMasterSlaveLoadBalanceAlgorithm(io.shardingjdbc.core.api.algorithm.masterslave.RoundRobinMasterSlaveLoadBalanceAlgorithm) RandomMasterSlaveLoadBalanceAlgorithm(io.shardingjdbc.core.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm) MasterSlaveRule(io.shardingjdbc.core.rule.MasterSlaveRule) Test(org.junit.Test)

Example 2 with RoundRobinMasterSlaveLoadBalanceAlgorithm

use of io.shardingjdbc.core.api.algorithm.masterslave.RoundRobinMasterSlaveLoadBalanceAlgorithm in project sharding-jdbc by shardingjdbc.

the class MasterSlaveNamespaceTest method assertTypeMasterSlaveDataSource.

@Test
public void assertTypeMasterSlaveDataSource() {
    MasterSlaveRule randomSlaveRule = getMasterSlaveRule("randomMasterSlaveDataSource");
    MasterSlaveRule roundRobinSlaveRule = getMasterSlaveRule("roundRobinMasterSlaveDataSource");
    assertTrue(randomSlaveRule.getLoadBalanceAlgorithm() instanceof RandomMasterSlaveLoadBalanceAlgorithm);
    assertTrue(roundRobinSlaveRule.getLoadBalanceAlgorithm() instanceof RoundRobinMasterSlaveLoadBalanceAlgorithm);
}
Also used : RoundRobinMasterSlaveLoadBalanceAlgorithm(io.shardingjdbc.core.api.algorithm.masterslave.RoundRobinMasterSlaveLoadBalanceAlgorithm) RandomMasterSlaveLoadBalanceAlgorithm(io.shardingjdbc.core.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm) MasterSlaveRule(io.shardingjdbc.core.rule.MasterSlaveRule) Test(org.junit.Test)

Aggregations

RandomMasterSlaveLoadBalanceAlgorithm (io.shardingjdbc.core.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm)2 RoundRobinMasterSlaveLoadBalanceAlgorithm (io.shardingjdbc.core.api.algorithm.masterslave.RoundRobinMasterSlaveLoadBalanceAlgorithm)2 MasterSlaveRule (io.shardingjdbc.core.rule.MasterSlaveRule)2 Test (org.junit.Test)2