| Num | Action | Result | Status |
|---|
| 1. | Create object taxi_session (Created by session_mgr) | - Check if object taxi_session has been initialized correctly
- taxi_session should change state to "Mapping Coordinates"
- taxi_session should send map_request to mapping_service with fields start, end
| CR: UT: |
| 2. | Send map_response to taxi_session (Message from mapping_service) with parameters map, distance, time | - map_response message handler should be called
- taxi_session should change state to "Computing Bill"
- taxi_session should take action "compute bill based on distance reported by mapping service"
- taxi_session should send bill_and_map_info to customer
| CR: UT: |
| 3. | Send accept to taxi_session (Message from customer) | - accept message handler should be called
- taxi_session should change state to "Searching for Taxi"
- taxi_session should send find_taxi to mobile_msg_service with fields time_to_resp = FIVE_MIN, type = BROADCAST
- taxi_session should start timer await_trip_ack
| CR: UT: |
| 4. | Send trip_ack to taxi_session (Message from taxi_mgr1) with parameters phone_num, resp_time = TWO_MIN | - trip_ack message handler should be called
| CR: UT: |
| 5. | Send trip_ack to taxi_session (Message from taxi_mgr2) with parameters phone_num, resp_time = FOUR_MIN | - trip_ack message handler should be called
| CR: UT: |
| 6. | Send timeout await_trip_ack to taxi_session | - await_trip_ack timeout handler should be called
- taxi_session should take action "Choose the taxi that can respond in minimum time"
- taxi_session should change state to "Querying Taxi Driver"
- taxi_session should send trip_query to taxi_mgr1
- taxi_session should start timer await_trip_accept
| CR: UT: |
| 7. | Send trip_accepted to taxi_session (Message from taxi_mgr1) | - trip_accepted message handler should be called
- taxi_session should stop timer await_trip_accept
- taxi_session should send taxi_response to customer
- taxi_session should change state to "Awaiting Journey Start"
| CR: UT: |
| 8. | Send ready to taxi_session (Message from taxi_mgr1) | - ready message handler should be called
- taxi_session should send taxi_arrived to customer
- taxi_session should send ready_ack to taxi_mgr1
| CR: UT: |
| 9. | Send start_service to taxi_session (Message from taxi_mgr1) | - start_service message handler should be called
- taxi_session should change state to "Awaiting Journey End"
- taxi_session should send start_service_ack to taxi_mgr1
| CR: UT: |
| 10. | Send end_service to taxi_session (Message from taxi_mgr1) | - end_service message handler should be called
- taxi_session should change state to "Billing Customer"
- taxi_session should send end_service_ack to taxi_mgr1
- taxi_session should send charge_request to billing_service with fields credit_card_no, expiration_date, amount
| CR: UT: |
| 11. | Send charge_response to taxi_session (Message from billing_service) with parameters transaction_status = SUCCESS | - charge_response message handler should be called
- taxi_session should change state to "Paying Taxi Driver"
- taxi_session should send pay_request to bank_ac_service with fields account_number, amount
| CR: UT: |
| 12. | Send pay_response to taxi_session (Message from bank_ac_service) with parameters account_number, transaction_status = SUCCESS | - pay_response message handler should be called
- taxi_session should send end_service to session_mgr
| CR: UT: |
| 13. | Delete object taxi_session (Deleted by session_mgr) | - Verify that object taxi_session has released all resources
| CR: UT: |
| Num | Action | Result | Status |
|---|
| 1. | Create object taxi_session (Created by session_mgr) | - Check if object taxi_session has been initialized correctly
- taxi_session should change state to "Mapping Coordinates"
- taxi_session should send map_request to mapping_service with fields start, end
| CR: UT: |
| 2. | Send map_response to taxi_session (Message from mapping_service) with parameters map, distance, time | - map_response message handler should be called
- taxi_session should change state to "Computing Bill"
- taxi_session should take action "compute bill based on distance reported by mapping service"
- taxi_session should send bill_and_map_info to customer
| CR: UT: |
| 3. | Send accept to taxi_session (Message from customer) | - accept message handler should be called
- taxi_session should change state to "Searching for Taxi"
- taxi_session should send find_taxi to mobile_msg_service with fields time_to_resp = FIVE_MIN, type = BROADCAST
- taxi_session should start timer await_trip_ack
| CR: UT: |
| 4. | Send timeout await_trip_ack to taxi_session | - await_trip_ack timeout handler should be called
- taxi_session should send find_taxi to mobile_msg_service with fields max_time_to_resp = TEN_MIN, type = BROADCAST
- taxi_session should start timer await_trip_ack
| CR: UT: |
| 5. | Send trip_ack to taxi_session (Message from taxi_mgr1) with parameters phone_num, time_to_resp = SIX_MIN | - trip_ack message handler should be called
| CR: UT: |
| 6. | Send trip_ack to taxi_session (Message from taxi_mgr2) with parameters phone_num, time_to_resp = NINE_MIN | - trip_ack message handler should be called
| CR: UT: |
| 7. | Send timeout await_trip_ack to taxi_session | - await_trip_ack timeout handler should be called
- taxi_session should take action "Choose the taxi that can respond in minimum time"
- taxi_session should change state to "Querying Taxi Driver"
- taxi_session should send trip_query to taxi_mgr1
- taxi_session should start timer await_trip_accept
| CR: UT: |
| 8. | Send trip_rejected to taxi_session (Message from taxi_mgr1) | - trip_rejected message handler should be called
- taxi_session should take action "Choose another taxi from the responses"
- taxi_session should stop timer await_trip_accept
- taxi_session should send trip_query to taxi_mgr2
- taxi_session should start timer await_trip_accept
| CR: UT: |
| 9. | Send trip_accepted to taxi_session (Message from taxi_mgr2) | - trip_accepted message handler should be called
- taxi_session should stop timer await_trip_accept
- taxi_session should send taxi_response to customer
- taxi_session should change state to "Awaiting Journey Start"
| CR: UT: |
| 10. | Send ready to taxi_session (Message from taxi_mgr2) | - ready message handler should be called
- taxi_session should send taxi_arrived to customer
- taxi_session should send ready_ack to taxi_mgr2
| CR: UT: |
| 11. | Send start_service to taxi_session (Message from taxi_mgr2) | - start_service message handler should be called
- taxi_session should change state to "Awaiting Journey End"
- taxi_session should send start_service_ack to taxi_mgr2
| CR: UT: |
| 12. | Send end_service to taxi_session (Message from taxi_mgr2) | - end_service message handler should be called
- taxi_session should change state to "Billing Customer"
- taxi_session should send end_service_ack to taxi_mgr2
- taxi_session should send charge_request to billing_service with fields credit_card_no, expiration_date, amount
| CR: UT: |
| 13. | Send charge_response to taxi_session (Message from billing_service) with parameters transaction_status = SUCCESS | - charge_response message handler should be called
- taxi_session should change state to "Paying Taxi Driver"
- taxi_session should send pay_request to bank_ac_service with fields account_number, amount
| CR: UT: |
| 14. | Send pay_response to taxi_session (Message from bank_ac_service) with parameters account_number, transaction_status = SUCCESS | - pay_response message handler should be called
- taxi_session should send end_service to session_mgr
| CR: UT: |
| 15. | Delete object taxi_session (Deleted by session_mgr) | - Verify that object taxi_session has released all resources
| CR: UT: |