use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalTransition_BetweenStateRegions.
@Test
public void orthogonalTransition_BetweenStateRegions() {
statechart = loadStatechart("OrthogonalTransition.sct");
State state = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "B1");
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.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalTargetStates_StateInTopLevelRegion.
@Test
public void orthogonalTargetStates_StateInTopLevelRegion() {
statechart = loadStatechart("NotOrthogonalRegion02.sct");
State b = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "B");
Synchronization sync = (Synchronization) b.getOutgoingTransitions().get(0).getTarget();
assertFalse(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 1);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_TARGET_STATES_NOT_ORTHOGONAL);
}
use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalSourceStates.
@Test
public void orthogonalSourceStates() {
statechart = loadStatechart("OrthogonalRegion01.sct");
State b = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "AA");
Synchronization sync = (Synchronization) b.getOutgoingTransitions().get(0).getTarget();
assertTrue(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertNoIssues(diagnostics);
}
use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method syncLocation_Issue58.
@Test
public void syncLocation_Issue58() {
statechart = loadStatechart("SyncLocation_Issue58.sct");
State state = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "AA");
Synchronization sync = (Synchronization) state.getOutgoingTransitions().get(0).getTarget();
assertTrue(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertNoIssues(diagnostics);
}
use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method choiceWithoutOutgoingTransition.
/**
* A choice must have at least one outgoing transition
*/
@Test
public void choiceWithoutOutgoingTransition() {
statechart = factory.createStatechart();
Region region = factory.createRegion();
statechart.getRegions().add(region);
Choice choice = factory.createChoice();
region.getVertices().add(choice);
State state = factory.createState();
region.getVertices().add(state);
createTransition(state, choice);
assertFalse(validator.validate(choice, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 1);
assertError(diagnostics, ISSUE_CHOICE_WITHOUT_OUTGOING_TRANSITION);
}
Aggregations