use of org.yakindu.sct.model.sgraph.Synchronization 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.Synchronization 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);
}
use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.
the class SGraphJavaValidationTest method orthogonalTargetStates_StateInParentStateRegion.
@Test
public void orthogonalTargetStates_StateInParentStateRegion() {
statechart = loadStatechart("NotOrthogonalRegion01.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 orthogonalTargetStates.
@Test
public void orthogonalTargetStates() {
statechart = loadStatechart("OrthogonalRegion01.sct");
State b = firstNamed(EcoreUtil2.eAllOfType(statechart, State.class), "B");
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 TransitionsWithNoTriggerTest method missingTriggerOnSyncSingleIncoming.
/**
* If a sync node has multiple incoming transitions then the transitions can omit the trigger.
*/
@Test
public void missingTriggerOnSyncSingleIncoming() {
statechart = loadStatechart("ValidEmptyTransitionFromSync.sct");
Region validRegion = firstNamed(eAllOfType(statechart, Region.class), "warning");
Synchronization sync = eAllOfType(validRegion, Synchronization.class).get(0);
assertEquals(1, sync.getIncomingTransitions().size());
assertTrue(validate(sync.getIncomingTransitions().get(0)));
assertIssueCount(diagnostics, 1);
assertWarning(diagnostics, ISSUE_TRANSITION_WITHOUT_TRIGGER);
}
Aggregations