ExitState.sctunit 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. testclass ExitState for statechart ExitState {
  2. /* An exit through an unnamed exit point must be taken by the transition without exit point spec (it must also be unguarded). */
  3. @Test
  4. operation defaultExit(){
  5. enter
  6. assert active(ExitState.r.A)
  7. raise e
  8. proceed 1 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. @Test
  13. operation namedExitThroughNamedTransition(){
  14. enter
  15. assert active(ExitState.r.A)
  16. raise f
  17. proceed 1 cycle
  18. assert active(ExitState.r.F)
  19. }
  20. /* An exit through an named exit point must be taken by the default transition if no transition for this exit point exists. */
  21. @Test
  22. operation namedExitThroughDefaultTransition(){
  23. enter
  24. assert active(ExitState.r.A)
  25. raise g
  26. proceed 1 cycle
  27. assert active(ExitState.r.E)
  28. }
  29. /* If no event is raised then the statechart must remain in state A. */
  30. @Test
  31. operation remainInA(){
  32. enter
  33. assert active(ExitState.r.A)
  34. proceed 1 cycle
  35. assert active(ExitState.r.A)
  36. }
  37. }