InternalEventLifeCycle.sctunit 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * @author axel terfloth
  3. */
  4. testgroup InternalEventLifeCycle for statechart InternalEventLifeCycle {
  5. test InternalEventLifeCycleTest {
  6. enter
  7. assert active(InternalEventLifeCycle.r1.A)
  8. assert active(InternalEventLifeCycle.r2.C)
  9. // the internal event i1 must be raised and consumed in the low priority
  10. // region within the same cycle
  11. raise e
  12. cycle
  13. assert active(InternalEventLifeCycle.r1.A)
  14. assert active(InternalEventLifeCycle.r2.D)
  15. // the internal event must not be visible after the cycle
  16. // but we can't access internal elements yet : assert ! i1
  17. // make sure nothing happens during an empty cycle
  18. cycle
  19. assert active(InternalEventLifeCycle.r1.A)
  20. assert active(InternalEventLifeCycle.r2.D)
  21. // the internal event i2 should have no impact since it is raised
  22. // in a low priority region and will be cleared after the cycle
  23. raise f
  24. cycle
  25. assert active(InternalEventLifeCycle.r1.A)
  26. assert active(InternalEventLifeCycle.r2.C)
  27. // make sure nothing happens during an empty cycle
  28. cycle
  29. assert active(InternalEventLifeCycle.r1.A)
  30. assert active(InternalEventLifeCycle.r2.C)
  31. }
  32. }