use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalSynchronizedTransition_Source.
@Test
public void orthogonalSynchronizedTransition_Source() {
statechart = loadStatechart("NotOrthogonalRegion03.sct");
State stateC = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "C");
Synchronization sync = (Synchronization) stateC.getOutgoingTransitions().get(0).getTarget();
assertFalse(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 2);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_SOURCE_TARGET_STATES_PARENT_REGION);
}
use of org.yakindu.sct.model.sgraph.State 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.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method validTransitionToInnerChoice.
@Test
public void validTransitionToInnerChoice() {
statechart = AbstractTestModelsUtil.loadStatechart(VALIDATION_TESTMODEL_DIR + "ValidTransitionToInnerChoice.sct");
Iterator<EObject> iter = statechart.eAllContents();
while (iter.hasNext()) {
EObject element = iter.next();
if (element instanceof State) {
validator.validate(element, diagnostics, new HashMap<Object, Object>());
}
}
assertIssueCount(diagnostics, 0);
}
use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalSourceStates_StateInTopLevelRegion.
@Test
public void orthogonalSourceStates_StateInTopLevelRegion() {
statechart = loadStatechart("NotOrthogonalRegion02.sct");
State b = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "AA");
Synchronization sync = (Synchronization) b.getOutgoingTransitions().get(0).getTarget();
assertFalse(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 1);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_SOURCE_STATES_NOT_ORTHOGONAL);
}
use of org.yakindu.sct.model.sgraph.State in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalSynchronizedTransition.
@Test
public void orthogonalSynchronizedTransition() {
statechart = loadStatechart("NotOrthogonalRegion03.sct");
State stateB = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "B");
Synchronization sync = (Synchronization) stateB.getOutgoingTransitions().get(0).getTarget();
assertFalse(validator.validate(sync, diagnostics, new HashMap<Object, Object>()));
assertIssueCount(diagnostics, 2);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_SOURCE_TARGET_STATES_PARENT_REGION);
}
Aggregations