Search in sources :

Example 1 with InitializingWithoutDefaultTSC

use of org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingWithoutDefaultTSC in project statecharts by Yakindu.

the class ModelSequencerSCTest method testSCInitSequence_VariablesWithoutDefaults.

/**
 * The init sequence must contain variable initialization for variables without default value.
 */
@Test
public void testSCInitSequence_VariablesWithoutDefaults() {
    InitializingWithoutDefaultTSC tsc = new InitializingWithoutDefaultTSC();
    ExecutionFlow flow = sequencer.transform(tsc.sc);
    assertNotNull(flow.getInitSequence());
    assertEquals(4, flow.getInitSequence().getSteps().size());
    assertAssignment(flow.getInitSequence(), 0, "b", AssignmentOperator.ASSIGN, "false");
    assertAssignment(flow.getInitSequence(), 1, "i", AssignmentOperator.ASSIGN, "0");
    assertAssignment(flow.getInitSequence(), 2, "r", AssignmentOperator.ASSIGN, "0.0");
    assertAssignment(flow.getInitSequence(), 3, "s", AssignmentOperator.ASSIGN, "");
}
Also used : InitializingWithoutDefaultTSC(org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingWithoutDefaultTSC) ExecutionFlow(org.yakindu.sct.model.sexec.ExecutionFlow) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ExecutionFlow (org.yakindu.sct.model.sexec.ExecutionFlow)1 InitializingWithoutDefaultTSC (org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingWithoutDefaultTSC)1