use of com.ctrip.platform.dal.dao.strategy.ShardColModShardStrategy in project dal by ctripcorp.
the class ShardColModShardStrategyTest method testIsShardingEnableForTable.
@Test
public void testIsShardingEnableForTable() {
ShardColModShardStrategy strategy = new ShardColModShardStrategy();
Map<String, String> settings = new HashMap<String, String>();
settings.put(ShardColModShardStrategy.TABLE_COLUMNS, "index,index1");
settings.put(ShardColModShardStrategy.TABLE_MOD, "4");
settings.put(ShardColModShardStrategy.SHARDED_TABLES, "table1, table");
strategy.initialize(settings);
assertTrue(strategy.isShardingByTable());
assertTrue(strategy.isShardingEnable("table"));
assertTrue(strategy.isShardingEnable("table1"));
assertTrue(strategy.isShardingEnable("tablE"));
assertTrue(strategy.isShardingEnable("tabLe1"));
assertTrue(strategy.isShardingEnable("TABLE"));
assertTrue(strategy.isShardingEnable("tabLE1"));
}
Aggregations