EnterState.sctunit 879 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. testclass EnterState for statechart EnterState {
  2. /* An entry without a specified entry point must enter the region through the default entry.
  3. */
  4. @Test
  5. operation defaultEntry(){
  6. enter
  7. assert active(EnterState.r.A)
  8. raise e
  9. proceed 1 cycle
  10. assert active(EnterState.r.B.r.E)
  11. }
  12. /* An entry with a specified entry point must take the entry node with the specified name.
  13. */
  14. @Test
  15. operation namedEntryThroughNamedTransition(){
  16. enter
  17. assert active(EnterState.r.A)
  18. raise f
  19. proceed 1 cycle
  20. assert active(EnterState.r.B.r.F)
  21. }
  22. /* An entry with a specified entry point that does not match any entry node by name must be taken through the default entry node.
  23. */
  24. @Test
  25. operation namedEntryThroughDefaultTransition(){
  26. enter
  27. assert active(EnterState.r.A)
  28. raise g
  29. proceed 1 cycle
  30. assert active(EnterState.r.B.r.E)
  31. }
  32. }