AbstractConditionStrategy extends AbstractShardingStrategy { public abstract Set<String> locateTableShards(TableConditionContext ctx);  abstract Set<String> locateDbShardsByValue(ShardingContext ctx, Object shardValue); abstract Set<String> locateDbShards(ConditionContext ctx); abstract Set<String> locateTableShardsByValue(TableShardingContext ctx, Object tableShardValue); abstract Set<String> locateTableShards(TableConditionContext ctx); @Override void initialize(Map<String, String> settings); @Override Set<String> locateDbShards(ShardingContext ctx); @Override Set<String> locateTableShards(TableShardingContext ctx); static final String COLUMNS; static final String TABLE_COLUMNS; }
@Test public void testLocateTableShards() throws SQLException { Set<String> exp; Condition condition; for(Object[] testData: data) { exp = (Set<String>)testData[0]; condition = (Condition)testData[1]; ConditionList conditions = ConditionList.andList(); conditions.add(condition); assertEquals(exp, test.locateTableShards(new TableShardingContext("appId", "logicDbName", null, all(), new Hints(), conditions))); } }