OutEventLifeCycle.sctunit 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @author axel terfloth
  3. */
  4. testclass OutEventLifeCycle for statechart OutEventLifeCycle {
  5. /* an outgoing event must be accessible after the cycle that raised the event. */
  6. @Test
  7. operation availableAfterCycle(){
  8. enter
  9. raise e
  10. proceed 1 cycle
  11. assert f
  12. }
  13. /* an outgoing event must be accessible within the cycle that raised the event. */
  14. @Test
  15. operation availableWithinCycle(){
  16. init(false)
  17. assert f_available_in_cycle
  18. }
  19. /* an outgoing event that was raised in one cycle is not available within the next cycle */
  20. @Test
  21. operation unvailableWithin2ndCycle(){
  22. init(true)
  23. assert ! f_available_in_next_cycle
  24. }
  25. /* an outgoing event that was raised in one cycle is not available after the following cycle */
  26. @Test
  27. operation unvailableAfter2ndCycle(){
  28. init(true)
  29. assert !f
  30. }
  31. operation init(sndCycle : boolean){
  32. enter
  33. raise e
  34. proceed 1 cycle
  35. if(sndCycle){
  36. proceed 1 cycle
  37. }
  38. }
  39. }