use of org.yakindu.sct.model.sgraph.Transition in project statecharts by Yakindu.
the class SGraphJavaValidationTest method vertexNotReachable_AcceptThroughSubchoice.
/**
* A transition to a sub choice is considered implies reachability.
*/
@Test
public void vertexNotReachable_AcceptThroughSubchoice() {
prepareStateTest();
State stateA = factory.createState();
Region subRegion = factory.createRegion();
state.getRegions().add(subRegion);
State stateC = factory.createState();
subRegion.getVertices().add(stateC);
Choice choice = factory.createChoice();
subRegion.getVertices().add(choice);
Transition t1 = factory.createTransition();
t1.setSource(stateA);
t1.setTarget(choice);
Transition t2 = factory.createTransition();
t2.setSource(choice);
t2.setTarget(stateC);
validate(state);
assertNoIssues(diagnostics);
}
use of org.yakindu.sct.model.sgraph.Transition in project statecharts by Yakindu.
the class SGraphJavaValidationTest method cleanExit.
/**
* Tests a scenario where no issues for an exit nodes exists.
*/
@Test
public void cleanExit() {
prepareStateTest();
Region subRegion = factory.createRegion();
state.getRegions().add(subRegion);
Exit exit = factory.createExit();
subRegion.getVertices().add(exit);
State s = factory.createState();
subRegion.getVertices().add(s);
Transition t = factory.createTransition();
t.setTarget(exit);
t.setSource(s);
assertTrue(validate(exit));
assertNoIssues(diagnostics);
}
use of org.yakindu.sct.model.sgraph.Transition in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalTransition.
@Test
public void orthogonalTransition() {
statechart = loadStatechart("OrthogonalTransition.sct");
State state = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "B2");
Transition trans = state.getOutgoingTransitions().get(0);
assertTrue(validator.validate(trans, diagnostics, new HashMap<Object, Object>()));
assertNoIssues(diagnostics);
}
use of org.yakindu.sct.model.sgraph.Transition in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalTransition_BetweenTopLevelRegions.
@Test
public void orthogonalTransition_BetweenTopLevelRegions() {
statechart = loadStatechart("OrthogonalTransition.sct");
State state = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "A");
Transition trans = state.getOutgoingTransitions().get(0);
assertFalse(validator.validate(trans, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 1);
assertError(diagnostics, ISSUE_TRANSITION_ORTHOGONAL);
}
use of org.yakindu.sct.model.sgraph.Transition in project statecharts by Yakindu.
the class SGraphJavaValidationTest method createTransition.
protected Transition createTransition(Vertex source, Vertex target) {
Transition trans = factory.createTransition();
trans.setSource(source);
trans.setTarget(target);
source.getOutgoingTransitions().add(trans);
target.getIncomingTransitions().add(trans);
return trans;
}
Aggregations