Search in sources :

Example 6 with StateSpace

use of de.prob.statespace.StateSpace in project prob2 by bendisposto.

the class RulesCheckerTest method testExecuteOperation.

@Test
public void testExecuteOperation() throws IOException {
    StateSpace s = api.brules_load(dir + "RulesMachineExample.rmch");
    RulesChecker checker = new RulesChecker(new Trace(s));
    boolean possible = checker.executeOperationAndDependencies("RULE_BasedOnValue1");
    assertEquals(true, possible);
    assertEquals(RuleStatus.FAIL, checker.getOperationState("RULE_BasedOnValue1"));
    assertEquals(RuleStatus.NOT_CHECKED, checker.getOperationState("RULE_WithViolations"));
    checker.executeOperationAndDependencies("RULE_WithViolations");
    assertEquals(RuleStatus.FAIL, checker.getOperationState("RULE_WithViolations"));
    boolean possible2 = checker.executeOperationAndDependencies("RULE_BasedOnRuleWithViolations");
    assertEquals(false, possible2);
    assertEquals(RuleStatus.NOT_CHECKED, checker.getOperationState("RULE_BasedOnRuleWithViolations"));
}
Also used : Trace(de.prob.statespace.Trace) StateSpace(de.prob.statespace.StateSpace) RulesChecker(de.prob.model.brules.RulesChecker) Test(org.junit.Test)

Example 7 with StateSpace

use of de.prob.statespace.StateSpace in project prob2 by bendisposto.

the class SimpleLoadTest method testLoadTLAFile2.

@Test
public void testLoadTLAFile2() throws IOException, ModelTranslationError {
    StateSpace s = api.tla_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "tla" + File.separator + "Definitions.tla");
    assertNotNull(s);
    Trace t = new Trace(s);
    assertEquals(1, t.getNextTransitions(FormulaExpand.EXPAND).size());
    s.kill();
}
Also used : Trace(de.prob.statespace.Trace) StateSpace(de.prob.statespace.StateSpace) Test(org.junit.Test)

Example 8 with StateSpace

use of de.prob.statespace.StateSpace in project prob2 by bendisposto.

the class SimpleLoadTest method testLoadBRulesFile.

@Test
public void testLoadBRulesFile() throws IOException, ModelTranslationError {
    StateSpace s = api.brules_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "brules" + File.separator + "SimpleRulesMachine.rmch");
    assertNotNull(s);
    s.kill();
}
Also used : StateSpace(de.prob.statespace.StateSpace) Test(org.junit.Test)

Example 9 with StateSpace

use of de.prob.statespace.StateSpace in project prob2 by bendisposto.

the class SimpleLoadTest method testLoadTLAFile.

@Test
public void testLoadTLAFile() throws IOException, ModelTranslationError {
    StateSpace s = api.tla_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "tla" + File.separator + "Foo.tla");
    assertNotNull(s);
    s.kill();
}
Also used : StateSpace(de.prob.statespace.StateSpace) Test(org.junit.Test)

Example 10 with StateSpace

use of de.prob.statespace.StateSpace in project prob2 by bendisposto.

the class SimpleLoadTest method testClub.

@Test
public void testClub() throws IOException, ModelTranslationError {
    StateSpace s = api.tla_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "tla" + File.separator + "ForDistribution" + File.separator + "Club.tla");
    assertNotNull(s);
    Trace t = new Trace(s);
    assertEquals(1, t.getNextTransitions(FormulaExpand.EXPAND).size());
    s.kill();
}
Also used : Trace(de.prob.statespace.Trace) StateSpace(de.prob.statespace.StateSpace) Test(org.junit.Test)

Aggregations

StateSpace (de.prob.statespace.StateSpace)10 Test (org.junit.Test)8 Trace (de.prob.statespace.Trace)4 RulesChecker (de.prob.model.brules.RulesChecker)2 AbstractOperation (de.be4.classicalb.core.parser.rules.AbstractOperation)1 AbstractCommand (de.prob.animator.command.AbstractCommand)1 ActivateUnitPluginCommand (de.prob.animator.command.ActivateUnitPluginCommand)1 ComposedCommand (de.prob.animator.command.ComposedCommand)1 GetPluginResultCommand (de.prob.animator.command.GetPluginResultCommand)1 SetPreferenceCommand (de.prob.animator.command.SetPreferenceCommand)1 StartAnimationCommand (de.prob.animator.command.StartAnimationCommand)1 OperationStatus (de.prob.model.brules.OperationStatus)1 ArrayList (java.util.ArrayList)1