Search in sources :

Example 11 with ShardingStrategy

use of com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingStrategy in project sharding-jdbc by dangdangdotcom.

the class ShardingStrategyTest method assertDoDynamicShardingForMultipleKeys.

@Test
public void assertDoDynamicShardingForMultipleKeys() {
    ShardingStrategy strategy = new ShardingStrategy("column", new TestMultipleKeysShardingAlgorithm());
    assertThat(strategy.doDynamicSharding(createShardingValues(new ShardingValue<>("logicTable", "column", "1"))), is((Collection<String>) Collections.<String>emptyList()));
}
Also used : ShardingStrategy(com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingStrategy) TestMultipleKeysShardingAlgorithm(com.dangdang.ddframe.rdb.sharding.api.strategy.fixture.TestMultipleKeysShardingAlgorithm) Collection(java.util.Collection) Test(org.junit.Test)

Aggregations

ShardingStrategy (com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingStrategy)11 Test (org.junit.Test)11 Collection (java.util.Collection)8 TestSingleKeyShardingAlgorithm (com.dangdang.ddframe.rdb.sharding.api.strategy.fixture.TestSingleKeyShardingAlgorithm)6 TestMultipleKeysShardingAlgorithm (com.dangdang.ddframe.rdb.sharding.api.strategy.fixture.TestMultipleKeysShardingAlgorithm)2 ShardingValue (com.dangdang.ddframe.rdb.sharding.api.ShardingValue)1