Search in sources :

Example 6 with NoneDatabaseShardingAlgorithm

use of com.dangdang.ddframe.rdb.sharding.api.strategy.database.NoneDatabaseShardingAlgorithm in project sharding-jdbc by dangdangdotcom.

the class TableRuleTest method assertTableRuleForDynamicWithAllStrategies.

@Test
public void assertTableRuleForDynamicWithAllStrategies() {
    TableRule actual = TableRule.builder("logicTable").dynamic(true).dataSourceRule(createDataSourceRule()).databaseShardingStrategy(new DatabaseShardingStrategy("", new NoneDatabaseShardingAlgorithm())).tableShardingStrategy(new TableShardingStrategy("", new NoneTableShardingAlgorithm())).build();
    assertDynamicTable(actual);
    assertNotNull(actual.getDatabaseShardingStrategy());
    assertNotNull(actual.getTableShardingStrategy());
}
Also used : DatabaseShardingStrategy(com.dangdang.ddframe.rdb.sharding.api.strategy.database.DatabaseShardingStrategy) NoneDatabaseShardingAlgorithm(com.dangdang.ddframe.rdb.sharding.api.strategy.database.NoneDatabaseShardingAlgorithm) TableShardingStrategy(com.dangdang.ddframe.rdb.sharding.api.strategy.table.TableShardingStrategy) NoneTableShardingAlgorithm(com.dangdang.ddframe.rdb.sharding.api.strategy.table.NoneTableShardingAlgorithm) Test(org.junit.Test)

Aggregations

DatabaseShardingStrategy (com.dangdang.ddframe.rdb.sharding.api.strategy.database.DatabaseShardingStrategy)6 NoneDatabaseShardingAlgorithm (com.dangdang.ddframe.rdb.sharding.api.strategy.database.NoneDatabaseShardingAlgorithm)6 DataSourceRule (com.dangdang.ddframe.rdb.sharding.api.rule.DataSourceRule)3 TableShardingStrategy (com.dangdang.ddframe.rdb.sharding.api.strategy.table.TableShardingStrategy)3 Test (org.junit.Test)3 ShardingRule (com.dangdang.ddframe.rdb.sharding.api.rule.ShardingRule)2 TableRule (com.dangdang.ddframe.rdb.sharding.api.rule.TableRule)2 NoneTableShardingAlgorithm (com.dangdang.ddframe.rdb.sharding.api.strategy.table.NoneTableShardingAlgorithm)2 SingleKeyModuloTableShardingAlgorithm (com.dangdang.ddframe.rdb.integrate.fixture.SingleKeyModuloTableShardingAlgorithm)1 BindingTableRule (com.dangdang.ddframe.rdb.sharding.api.rule.BindingTableRule)1 IncrementIdGenerator (com.dangdang.ddframe.rdb.sharding.id.generator.fixture.IncrementIdGenerator)1 ShardingDataSource (com.dangdang.ddframe.rdb.sharding.jdbc.ShardingDataSource)1 Function (com.google.common.base.Function)1 HashMap (java.util.HashMap)1 DataSource (javax.sql.DataSource)1