use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class TransitionsWithNoTriggerTest method noTriggerOnSyncIncoming.
/**
* If a sync node has multiple incoming transitions then the transitions can omit the trigger.
*/
@Test
public void noTriggerOnSyncIncoming() {
statechart = loadStatechart("ValidEmptyTransitionFromSync.sct");
Region validRegion = firstNamed(eAllOfType(statechart, Region.class), "valid");
Synchronization sync = eAllOfType(validRegion, Synchronization.class).get(0);
for (Transition t : sync.getIncomingTransitions()) {
assertTrue(validate(t));
assertIssueCount(diagnostics, 0);
}
}
use of org.yakindu.sct.model.sgraph.Synchronization 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.Synchronization in project statecharts by Yakindu.
the class SGraphJavaValidationTest method synchronizationTransitionCount.
@Test
public void synchronizationTransitionCount() {
statechart = AbstractTestModelsUtil.loadStatechart(VALIDATION_TESTMODEL_DIR + "SynchronizationTransitionCount.sct");
Iterator<EObject> iter = statechart.eAllContents();
while (iter.hasNext()) {
EObject element = iter.next();
if (element instanceof Synchronization) {
assertFalse(validator.validate(element, diagnostics, new HashMap<Object, Object>()));
}
}
assertIssueCount(diagnostics, 2);
assertError(diagnostics, ISSUE_SYNCHRONIZATION_TRANSITION_COUNT);
}
use of org.yakindu.sct.model.sgraph.Synchronization 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.Synchronization 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);
}
Aggregations