123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /**
- * @author axel terfloth
- */
- testclass InternalEventLifeCycle for statechart InternalEventLifeCycle {
- @Test
- operation InternalEventLifeCycleTest(){
-
- enter
-
- assert active(InternalEventLifeCycle.r1.A)
- assert active(InternalEventLifeCycle.r2.C)
-
- // the internal event i1 must be raised and consumed in the low priority
- // region within the same cycle
- raise e
- proceed 1 cycle
- assert active(InternalEventLifeCycle.r1.A)
- assert active(InternalEventLifeCycle.r2.D)
- // the internal event must not be visible after the cycle
- // but we can't access internal elements yet : assert ! i1
-
- // make sure nothing happens during an empty cycle
- proceed 1 cycle
- assert active(InternalEventLifeCycle.r1.A)
- assert active(InternalEventLifeCycle.r2.D)
-
- // the internal event i2 should have no impact since it is raised
- // in a low priority region and will be cleared after the cycle
- raise f
- proceed 1 cycle
- assert active(InternalEventLifeCycle.r1.A)
- assert active(InternalEventLifeCycle.r2.C)
-
- // make sure nothing happens during an empty cycle
- proceed 1 cycle
- assert active(InternalEventLifeCycle.r1.A)
- assert active(InternalEventLifeCycle.r2.C)
- }
- }
|