本文整理匯總了Java中com.taobao.tddl.rule.BaseRuleTest.Choicer類的典型用法代碼示例。如果您正苦於以下問題:Java Choicer類的具體用法?Java Choicer怎麽用?Java Choicer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Choicer類屬於com.taobao.tddl.rule.BaseRuleTest包,在下文中一共展示了Choicer類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testRouteMultiVersionAndCompareTSqlTypeStringString
import com.taobao.tddl.rule.BaseRuleTest.Choicer; //導入依賴的package包/類
@Test
public void testRouteMultiVersionAndCompareTSqlTypeStringString() {
Choicer choicer = new Choicer();
choicer.addComparative("MESSAGE_ID", new Comparative(Comparative.Equivalent, 1)); // 一定要大寫
MatcherResult result = null;
try {
result = mvrRule.routeMverAndCompare(false, "nserch", choicer, Lists.newArrayList());
} catch (RouteCompareDiffException e) {
Assert.fail(ExceptionUtils.getFullStackTrace(e));
}
List<TargetDB> dbs = result.getCalculationResult();
Assert.assertEquals(1, dbs.size());
Assert.assertEquals("NSEARCH_GROUP_2", dbs.get(0).getDbIndex());
Assert.assertEquals(1, dbs.get(0).getTableNames().size());
Assert.assertEquals("nserch_1", dbs.get(0).getTableNames().iterator().next());
}