Search in sources :

Example 1 with RuleRepository

use of org.jaffa.rules.rulemeta.RuleRepository in project jaffa-framework by jaffa-projects.

the class RuleRepositoryTest method testAddRule.

/**
 * Registering a Rule should behave as though it were loaded from an XML element.
 */
@Test
public void testAddRule() {
    RuleRepository target = RuleRepository.instance();
    Rule rule = new Rule();
    rule.setName("x");
    target.addRule(rule);
    Rule actual = target.getRuleByName("x");
    assertSame(rule, actual);
}
Also used : RuleRepository(org.jaffa.rules.rulemeta.RuleRepository) Rule(org.jaffa.rules.rulemeta.Rule) Test(org.junit.Test)

Aggregations

Rule (org.jaffa.rules.rulemeta.Rule)1 RuleRepository (org.jaffa.rules.rulemeta.RuleRepository)1 Test (org.junit.Test)1