ShallowHistoryWithDeepEntry.sctunit 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package tests
  2. /**
  3. * A shallow history must also for child states that are only indirectly entered through one of the childs.
  4. */
  5. testclass ShallowHistoryWithDeepEntry for statechart ShallowHistoryWithDeepEntry{
  6. operation noDeepEntryWithinHistory(){
  7. enter
  8. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  9. raise toZ
  10. cycle
  11. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.A)
  12. raise toY
  13. cycle
  14. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  15. raise toZ
  16. cycle
  17. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.A)
  18. }
  19. operation deepEntryWithinHistory(){
  20. enter
  21. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  22. raise toZ
  23. cycle
  24. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.A)
  25. raise toC
  26. cycle
  27. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  28. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  29. raise toY
  30. cycle
  31. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  32. raise toZ
  33. cycle
  34. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  35. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  36. }
  37. operation directDeepEntryIntoHistory(){
  38. enter
  39. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  40. raise toC
  41. cycle
  42. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  43. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  44. raise toY
  45. cycle
  46. assert active(ShallowHistoryWithDeepEntry.main_region.Y)
  47. raise toZ
  48. cycle
  49. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B._region0.C)
  50. assert active(ShallowHistoryWithDeepEntry.main_region.Z._region0.B)
  51. }
  52. }