Search in sources :

Example 1 with InitializingTSC

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

the class ModelSequencerSCTest method testSCInitSequence_Variables.

/**
 * The init sequence must contain variable initialization.
 */
@Test
public void testSCInitSequence_Variables() {
    InitializingTSC tsc = new InitializingTSC();
    ExecutionFlow flow = sequencer.transform(tsc.sc);
    assertNotNull(flow.getInitSequence());
    assertEquals(1, flow.getInitSequence().getSteps().size());
    assertAssignment(flow.getInitSequence(), 0, "e1", AssignmentOperator.ASSIGN, "true");
}
Also used : ExecutionFlow(org.yakindu.sct.model.sexec.ExecutionFlow) InitializingTSC(org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingTSC) Test(org.junit.Test)

Example 2 with InitializingTSC

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

the class ModelSequencerSCTest method testSCEnterSequence_Variables.

/**
 * The enter step must not contain variable initialization.
 */
@Test
public void testSCEnterSequence_Variables() {
    InitializingTSC tsc = new InitializingTSC();
    ExecutionFlow flow = sequencer.transform(tsc.sc);
    assertNotNull(flow.getEnterSequences().get(0));
    assertEquals(1, flow.getEnterSequences().get(0).getSteps().size());
    assertCall(flow.getEnterSequences().get(0), 0, flow.getEntryAction());
}
Also used : ExecutionFlow(org.yakindu.sct.model.sexec.ExecutionFlow) InitializingTSC(org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingTSC) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ExecutionFlow (org.yakindu.sct.model.sexec.ExecutionFlow)2 InitializingTSC (org.yakindu.sct.model.sexec.transformation.test.SCTTestUtil.InitializingTSC)2