Search in sources :

Example 1 with CounterExample

use of de.prob.model.brules.RuleResult.CounterExample in project prob2 by bendisposto.

the class RulesMachineTest method testCounterExample.

@Test
public void testCounterExample() {
    RulesMachineRun rulesMachineRun = startRulesMachineRunWithOperations("RULE foo BODY RULE_FAIL ERROR_TYPE 1 COUNTEREXAMPLE \"error\"END END");
    assertEquals(null, rulesMachineRun.getFirstError());
    RuleResult ruleResult = rulesMachineRun.getRuleResults().getRuleResult("foo");
    List<CounterExample> counterExamples = ruleResult.getCounterExamples();
    assertEquals(1, counterExamples.size());
    CounterExample counterExample = counterExamples.get(0);
    assertEquals(1, counterExample.getErrorType());
}
Also used : RulesMachineRun(de.prob.model.brules.RulesMachineRun) CounterExample(de.prob.model.brules.RuleResult.CounterExample) RuleResult(de.prob.model.brules.RuleResult) Test(org.junit.Test)

Aggregations

RuleResult (de.prob.model.brules.RuleResult)1 CounterExample (de.prob.model.brules.RuleResult.CounterExample)1 RulesMachineRun (de.prob.model.brules.RulesMachineRun)1 Test (org.junit.Test)1