123456789101112131415161718192021222324252627282930 |
- testclass GuardedExit for statechart GuardedExit {
- @Test
- operation ExitTaken(){
- enter
- assert active(GuardedExit.main_region.A)
- assert ! guard
- checkDone(false)
- }
- @Test
- operation ExitNotTaken(){
-
- enter
- assert active(GuardedExit.main_region.A)
- guard = true
- checkDone(true)
- }
-
- operation checkDone(shouldBeDone : boolean){
- raise e
-
- proceed 1 cycle
- assert active(GuardedExit.main_region.B)
- assert shouldBeDone ? done : !done
- }
- }
-
|