ChildFirstLocalReactions.sctunit 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. testclass ChildFirstLocalReactions for statechart executionorder.ChildFirstLocalReactions {
  2. var counter : integer = 0
  3. @Test operation expectBottomUpLocalReactionOrder() {
  4. enter
  5. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AA.r.AAA)
  6. proceed 1 cycle
  7. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AA.r.AAA)
  8. assert aaa_local == 1
  9. assert aa_local == 2
  10. assert a_local == 3
  11. assert sm_local == 4
  12. }
  13. @Test operation expectParentLocalReactionOnChildLocalTransition() {
  14. enter
  15. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AA.r.AAA)
  16. raise e
  17. proceed 1 cycle
  18. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AA.r.AAB)
  19. assert aaa_local == 0
  20. assert aa_local == 1
  21. assert a_local == 2
  22. assert sm_local == 3
  23. }
  24. @Test operation expectGrandparentLocalReactionOnParentLocalTransition() {
  25. enter
  26. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AA.r.AAA)
  27. disable_aaa = true
  28. raise e
  29. proceed 1 cycle
  30. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AB)
  31. assert aaa_local == 1
  32. assert aa_local == 0
  33. assert a_local == 2
  34. assert sm_local == 3
  35. }
  36. @Test operation expectNoLocalReactionOnGrandparentTransition() {
  37. enter
  38. assert active(executionorder.ChildFirstLocalReactions.r.A.r.AA.r.AAA)
  39. disable_aaa = true
  40. disable_aa = true
  41. raise e
  42. proceed 1 cycle
  43. assert active(executionorder.ChildFirstLocalReactions.r.B)
  44. assert aaa_local == 1
  45. assert aa_local == 2
  46. assert a_local == 0
  47. assert sm_local == 3
  48. }
  49. }