Search in sources :

Example 16 with Synchronization

use of org.yakindu.sct.model.sgraph.Synchronization in project statecharts by Yakindu.

the class SGraphJavaValidationTest method orthogonalSourceStates_StateInParentStateRegion.

@Test
public void orthogonalSourceStates_StateInParentStateRegion() {
    statechart = loadStatechart("NotOrthogonalRegion01.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);
}
Also used : HashMap(java.util.HashMap) FinalState(org.yakindu.sct.model.sgraph.FinalState) State(org.yakindu.sct.model.sgraph.State) Synchronization(org.yakindu.sct.model.sgraph.Synchronization) Test(org.junit.Test)

Aggregations

Synchronization (org.yakindu.sct.model.sgraph.Synchronization)16 Test (org.junit.Test)14 HashMap (java.util.HashMap)11 FinalState (org.yakindu.sct.model.sgraph.FinalState)10 State (org.yakindu.sct.model.sgraph.State)10 Region (org.yakindu.sct.model.sgraph.Region)4 EObject (org.eclipse.emf.ecore.EObject)2 Transition (org.yakindu.sct.model.sgraph.Transition)2 LinkedList (java.util.LinkedList)1 QualifiedName (org.eclipse.xtext.naming.QualifiedName)1 Check (org.eclipse.xtext.validation.Check)1 CompositeElement (org.yakindu.sct.model.sgraph.CompositeElement)1 Vertex (org.yakindu.sct.model.sgraph.Vertex)1