Search in sources :

Example 1 with OperationStatus

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

the class RulesCheckerTest method testExecuteAllOperations.

@Test
public void testExecuteAllOperations() throws IOException {
    StateSpace s = api.brules_load(dir + "RulesMachineExample.rmch");
    Trace trace = new Trace(s);
    RulesChecker rulesChecker = new RulesChecker(trace);
    rulesChecker.init();
    rulesChecker.executeAllOperations();
    for (Entry<AbstractOperation, OperationStatus> entry : rulesChecker.getOperationStates().entrySet()) {
        OperationStatus state = entry.getValue();
        if (entry.getKey().getName().equals("RULE_BasedOnRuleWithViolations")) {
            assertEquals(RuleStatus.NOT_CHECKED, state);
        } else {
            assertTrue(state.isExecuted());
        }
    }
}
Also used : Trace(de.prob.statespace.Trace) StateSpace(de.prob.statespace.StateSpace) AbstractOperation(de.be4.classicalb.core.parser.rules.AbstractOperation) OperationStatus(de.prob.model.brules.OperationStatus) RulesChecker(de.prob.model.brules.RulesChecker) Test(org.junit.Test)

Aggregations

AbstractOperation (de.be4.classicalb.core.parser.rules.AbstractOperation)1 OperationStatus (de.prob.model.brules.OperationStatus)1 RulesChecker (de.prob.model.brules.RulesChecker)1 StateSpace (de.prob.statespace.StateSpace)1 Trace (de.prob.statespace.Trace)1 Test (org.junit.Test)1