Taxi_session Unit Test Procedures for WebTaxi

EventHelix.com/EventStudio 2.0
Generated on 05-Jul-03 16:41

Code Reviewed By:

Unit Tested By:

Taxi available within 5 min.

Leg Taken:

Test Procedures:

NumActionResultStatus
1.Create object taxi_session (Created by session_mgr)
  1. Check if object taxi_session has been initialized correctly
  2. taxi_session should change state to "Mapping Coordinates"
  3. 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
  1. map_response message handler should be called
  2. taxi_session should change state to "Computing Bill"
  3. taxi_session should take action "compute bill based on distance reported by mapping service"
  4. taxi_session should send bill_and_map_info to customer

CR:

UT:

3.Send accept to taxi_session (Message from customer)
  1. accept message handler should be called
  2. taxi_session should change state to "Searching for Taxi"
  3. taxi_session should send find_taxi to mobile_msg_service with fields time_to_resp = FIVE_MIN, type = BROADCAST
  4. 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
  1. 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
  1. trip_ack message handler should be called

CR:

UT:

6.Send timeout await_trip_ack to taxi_session
  1. await_trip_ack timeout handler should be called
  2. taxi_session should take action "Choose the taxi that can respond in minimum time"
  3. taxi_session should change state to "Querying Taxi Driver"
  4. taxi_session should send trip_query to taxi_mgr1
  5. taxi_session should start timer await_trip_accept

CR:

UT:

7.Send trip_accepted to taxi_session (Message from taxi_mgr1)
  1. trip_accepted message handler should be called
  2. taxi_session should stop timer await_trip_accept
  3. taxi_session should send taxi_response to customer
  4. taxi_session should change state to "Awaiting Journey Start"

CR:

UT:

8.Send ready to taxi_session (Message from taxi_mgr1)
  1. ready message handler should be called
  2. taxi_session should send taxi_arrived to customer
  3. taxi_session should send ready_ack to taxi_mgr1

CR:

UT:

9.Send start_service to taxi_session (Message from taxi_mgr1)
  1. start_service message handler should be called
  2. taxi_session should change state to "Awaiting Journey End"
  3. taxi_session should send start_service_ack to taxi_mgr1

CR:

UT:

10.Send end_service to taxi_session (Message from taxi_mgr1)
  1. end_service message handler should be called
  2. taxi_session should change state to "Billing Customer"
  3. taxi_session should send end_service_ack to taxi_mgr1
  4. 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
  1. charge_response message handler should be called
  2. taxi_session should change state to "Paying Taxi Driver"
  3. 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
  1. pay_response message handler should be called
  2. taxi_session should send end_service to session_mgr

CR:

UT:

13.Delete object taxi_session (Deleted by session_mgr)
  1. Verify that object taxi_session has released all resources

CR:

UT:

Taxi available within 10 min.

Leg Taken:

Test Procedures:

NumActionResultStatus
1.Create object taxi_session (Created by session_mgr)
  1. Check if object taxi_session has been initialized correctly
  2. taxi_session should change state to "Mapping Coordinates"
  3. 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
  1. map_response message handler should be called
  2. taxi_session should change state to "Computing Bill"
  3. taxi_session should take action "compute bill based on distance reported by mapping service"
  4. taxi_session should send bill_and_map_info to customer

CR:

UT:

3.Send accept to taxi_session (Message from customer)
  1. accept message handler should be called
  2. taxi_session should change state to "Searching for Taxi"
  3. taxi_session should send find_taxi to mobile_msg_service with fields time_to_resp = FIVE_MIN, type = BROADCAST
  4. taxi_session should start timer await_trip_ack

CR:

UT:

4.Send timeout await_trip_ack to taxi_session
  1. await_trip_ack timeout handler should be called
  2. taxi_session should send find_taxi to mobile_msg_service with fields max_time_to_resp = TEN_MIN, type = BROADCAST
  3. 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
  1. 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
  1. trip_ack message handler should be called

CR:

UT:

7.Send timeout await_trip_ack to taxi_session
  1. await_trip_ack timeout handler should be called
  2. taxi_session should take action "Choose the taxi that can respond in minimum time"
  3. taxi_session should change state to "Querying Taxi Driver"
  4. taxi_session should send trip_query to taxi_mgr1
  5. taxi_session should start timer await_trip_accept

CR:

UT:

8.Send trip_rejected to taxi_session (Message from taxi_mgr1)
  1. trip_rejected message handler should be called
  2. taxi_session should take action "Choose another taxi from the responses"
  3. taxi_session should stop timer await_trip_accept
  4. taxi_session should send trip_query to taxi_mgr2
  5. taxi_session should start timer await_trip_accept

CR:

UT:

9.Send trip_accepted to taxi_session (Message from taxi_mgr2)
  1. trip_accepted message handler should be called
  2. taxi_session should stop timer await_trip_accept
  3. taxi_session should send taxi_response to customer
  4. taxi_session should change state to "Awaiting Journey Start"

CR:

UT:

10.Send ready to taxi_session (Message from taxi_mgr2)
  1. ready message handler should be called
  2. taxi_session should send taxi_arrived to customer
  3. taxi_session should send ready_ack to taxi_mgr2

CR:

UT:

11.Send start_service to taxi_session (Message from taxi_mgr2)
  1. start_service message handler should be called
  2. taxi_session should change state to "Awaiting Journey End"
  3. taxi_session should send start_service_ack to taxi_mgr2

CR:

UT:

12.Send end_service to taxi_session (Message from taxi_mgr2)
  1. end_service message handler should be called
  2. taxi_session should change state to "Billing Customer"
  3. taxi_session should send end_service_ack to taxi_mgr2
  4. 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
  1. charge_response message handler should be called
  2. taxi_session should change state to "Paying Taxi Driver"
  3. 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
  1. pay_response message handler should be called
  2. taxi_session should send end_service to session_mgr

CR:

UT:

15.Delete object taxi_session (Deleted by session_mgr)
  1. Verify that object taxi_session has released all resources

CR:

UT: