123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- testclass SyncJoin for statechart SyncJoin {
- // test syncJoin_C2_Waits 'test intention' {
- @Test
- operation syncJoin_C2_Waits(){
-
- enter
-
- assert active (SyncJoin.main_region.B)
- assert active (SyncJoin.main_region.B.r1.C1)
- assert active (SyncJoin.main_region.B.r2.D1)
- // state configuration assertion: assert active (SyncJoin.main_region.B, SyncJoin.main_region.B.r1.C1, SyncJoin.main_region.B.r2.D1)
-
-
- raise e
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D1)
-
- // require configuration C2Waits
- raise jc
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D1)
-
- raise jd
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D1)
-
- // 'If all required triggers exist' 'but the lower priority state is not active no join transition must be taken.'
- raise jc
- raise jd
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D1)
-
- raise f
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- raise jc
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- raise jd
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- raise jc
- raise jd
- proceed 1 cycle
- assert active (SyncJoin.main_region.A)
- }
- @Test
- operation syncJoin_D2_Waits(){
-
- enter
-
- assert active (SyncJoin.main_region.B)
- assert active (SyncJoin.main_region.B.r1.C1)
- assert active (SyncJoin.main_region.B.r2.D1)
-
- raise f
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C1)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- raise jc
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C1)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- raise jd
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C1)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- // 'If all required triggers exist' 'but the lower priority state is not active no join transition must be taken.'
- raise jc
- raise jd
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C1)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- raise e
- proceed 1 cycle
- assert active (SyncJoin.main_region.B.r1.C2)
- assert active (SyncJoin.main_region.B.r2.D2)
-
- }
-
- /* Entry actions of a join target should only be called once.
- *
- * There was a bug that lead to a multiple entry action call depending on the number of joined transitions.
- */
- @Test
- operation doubleEntryActionBug(){
- enter
-
- raise e
- raise f
- proceed 1 cycle
-
- raise jc
- raise jd
- proceed 1 cycle
-
- assert active (SyncJoin.main_region.A)
- assert x == 1
- }
-
- }
|