提交 64be9d7c 编写于 作者: T tianbin

add test case

上级 780e5946
......@@ -27,6 +27,7 @@ import io.shardingjdbc.core.hint.HintManagerHolder;
import io.shardingjdbc.core.parsing.parser.sql.dql.DQLStatement;
import io.shardingjdbc.core.parsing.parser.sql.dql.select.SelectStatement;
import io.shardingjdbc.core.rule.ShardingRule;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
......@@ -39,8 +40,15 @@ import static org.junit.Assert.assertThat;
public final class DatabaseHintSQLRouterTest {
private final HintManager hintManager = HintManager.getInstance();
private DatabaseHintSQLRouter databaseHintSQLRouter;
@After
public void tearDown() {
hintManager.close();
}
@Before
public void setRouterContext() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
......@@ -60,7 +68,6 @@ public final class DatabaseHintSQLRouterTest {
@Test
public void assertRoute() {
HintManager hintManager = HintManager.getInstance();
hintManager.addDatabaseShardingValue(HintManagerHolder.DB_TABLE_NAME, HintManagerHolder.DB_COLUMN_NAME, 1);
assertNotNull(databaseHintSQLRouter.route("select t from table t", Collections.emptyList(), new DQLStatement()));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册