assertTrue(r.isDefinedAt(fact));
}
public void testRuleExpressionEvaluationWithSimpleTypeRoutingFact()
{
IBatisNamespaceShardingRule r = new IBatisNamespaceShardingRule(DEFAULT_TYPE_PATTEN,
"shard2", "$ROOT.startsWith(\"A\")");
IBatisRoutingFact fact = new IBatisRoutingFact(
"com.alibaba.cobar.client.entity.Tweet.create", "Arron");
assertTrue(r.isDefinedAt(fact));
r = new IBatisNamespaceShardingRule(DEFAULT_TYPE_PATTEN,
"shard2", "startsWith(\"A\")");
assertTrue(r.isDefinedAt(fact));
fact = new IBatisRoutingFact(
"com.alibaba.cobar.client.entity.Tweet.create", "Donald");
assertFalse(r.isDefinedAt(fact));
}