Search in sources :

Example 71 with ExecutionState

use of org.yakindu.sct.model.sexec.ExecutionState in project statecharts by Yakindu.

the class Assert method assertStateSwitch.

public static void assertStateSwitch(Step step, ExecutionState... states) {
    assertNotNull("Step is null", step);
    assertTrue("Step is no StateSwitch (was " + step.getClass().getName() + ")", step instanceof StateSwitch);
    List<ExecutionState> stateList = Arrays.asList(states);
    List<ExecutionState> stateCases = new ArrayList<ExecutionState>();
    for (StateCase aCase : ((StateSwitch) step).getCases()) {
        stateCases.add(aCase.getState());
    }
    assertEquals("StateSwitch cases do not match!", stateList, stateCases);
}
Also used : ExecutionState(org.yakindu.sct.model.sexec.ExecutionState) StateCase(org.yakindu.sct.model.sexec.StateCase) ArrayList(java.util.ArrayList) StateSwitch(org.yakindu.sct.model.sexec.StateSwitch)

Example 72 with ExecutionState

use of org.yakindu.sct.model.sexec.ExecutionState in project statecharts by Yakindu.

the class ExitStateImpl method setState.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setState(ExecutionState newState) {
    ExecutionState oldState = state;
    state = newState;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, SexecPackage.EXIT_STATE__STATE, oldState, state));
}
Also used : ExecutionState(org.yakindu.sct.model.sexec.ExecutionState) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

ExecutionState (org.yakindu.sct.model.sexec.ExecutionState)72 ExecutionFlow (org.yakindu.sct.model.sexec.ExecutionFlow)64 Test (org.junit.Test)63 Statechart (org.yakindu.sct.model.sgraph.Statechart)54 VariableDefinition (org.yakindu.sct.model.stext.stext.VariableDefinition)51 StextTestFactory._createVariableDefinition (org.yakindu.sct.model.stext.test.util.StextTestFactory._createVariableDefinition)51 SGraphTestFactory._createStatechart (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createStatechart)49 Sequence (org.yakindu.sct.model.sexec.Sequence)45 Region (org.yakindu.sct.model.sgraph.Region)45 SGraphTestFactory._createRegion (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createRegion)45 State (org.yakindu.sct.model.sgraph.State)43 SGraphTestFactory._createState (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createState)43 StextTestFactory._createInterfaceScope (org.yakindu.sct.model.stext.test.util.StextTestFactory._createInterfaceScope)43 InterfaceScope (org.yakindu.sct.model.stext.stext.InterfaceScope)36 SCTTestUtil.findState (org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.findState)28 Reaction (org.yakindu.sct.model.sexec.Reaction)26 Entry (org.yakindu.sct.model.sgraph.Entry)25 SGraphTestFactory._createEntry (org.yakindu.sct.model.sgraph.test.util.SGraphTestFactory._createEntry)25 LocalReaction (org.yakindu.sct.model.stext.stext.LocalReaction)23 StextTestFactory._createLocalReaction (org.yakindu.sct.model.stext.test.util.StextTestFactory._createLocalReaction)23