ExitState.sctunit 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package tests
  2. testclass ExitState for statechart ExitState {
  3. /* An exit through an unnamed exit point must be taken by the transition without exit point spec (it must also be unguarded). */
  4. operation defaultExit(){
  5. enter
  6. assert active(ExitState.r.A)
  7. raise e
  8. cycle
  9. assert active(ExitState.r.E)
  10. }
  11. /* An exit through an named exit point must be taken by the transition with the matching exit point spec if it exists. */
  12. operation namedExitThroughNamedTransition(){
  13. enter
  14. assert active(ExitState.r.A)
  15. raise f
  16. cycle
  17. assert active(ExitState.r.F)
  18. }
  19. /* An exit through an named exit point must be taken by the default transition if no transition for this exit point exists. */
  20. operation namedExitThroughDefaultTransition(){
  21. enter
  22. assert active(ExitState.r.A)
  23. raise g
  24. cycle
  25. assert active(ExitState.r.E)
  26. }
  27. /* If no event is raised then the statechart must remain in state A. */
  28. operation remainInA(){
  29. enter
  30. assert active(ExitState.r.A)
  31. cycle
  32. assert active(ExitState.r.A)
  33. }
  34. }