Search in sources :

Example 1 with StextFactory

use of org.yakindu.sct.model.stext.stext.StextFactory in project statecharts by Yakindu.

the class TransitionsWithNoTriggerTest method setup.

@Override
@Before
public void setup() {
    super.setup();
    StextFactory stextFactory = StextFactory.eINSTANCE;
    Region region = factory.createRegion();
    entry = factory.createEntry();
    stateA = factory.createState();
    stateA.setName("A");
    stateB = factory.createState();
    stateB.setName("B");
    stateC = factory.createState();
    stateC.setName("C");
    stateD = factory.createState();
    stateD.setName("D");
    choice = factory.createChoice();
    stateE = factory.createState();
    stateE.setName("E");
    entryToStateA = createTransition(entry, stateA);
    stateAToStateB = createTransition(stateA, stateB);
    stateBToStateC = createTransition(stateB, stateC);
    stateCToStateD = createTransition(stateC, stateD);
    stateCToStateD.setSpecification("always");
    ReactionTrigger triggerCToD = stextFactory.createReactionTrigger();
    triggerCToD.getTriggers().add(stextFactory.createAlwaysEvent());
    stateCToStateD.setTrigger(triggerCToD);
    choiceToStateE = createTransition(choice, stateE);
    stateBB = factory.createState();
    stateBB.setName("BB");
    entryB = factory.createEntry();
    exitB = factory.createExit();
    regionB = factory.createRegion();
    regionB.getVertices().add(entryB);
    regionB.getVertices().add(stateBB);
    regionB.getVertices().add(exitB);
    stateB.getRegions().add(regionB);
    entryBToStateBB = createTransition(entryB, stateBB);
    stateBBToExitB = createTransition(stateBB, exitB);
    region.getVertices().add(entry);
    region.getVertices().add(stateA);
    region.getVertices().add(stateB);
    region.getVertices().add(stateC);
    region.getVertices().add(stateD);
    statechart.getRegions().add(region);
}
Also used : ReactionTrigger(org.yakindu.sct.model.stext.stext.ReactionTrigger) StextFactory(org.yakindu.sct.model.stext.stext.StextFactory) Region(org.yakindu.sct.model.sgraph.Region) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 Region (org.yakindu.sct.model.sgraph.Region)1 ReactionTrigger (org.yakindu.sct.model.stext.stext.ReactionTrigger)1 StextFactory (org.yakindu.sct.model.stext.stext.StextFactory)1