summaryrefslogtreecommitdiff
path: root/src/components/application_manager/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/test')
-rw-r--r--src/components/application_manager/test/CMakeLists.txt186
-rw-r--r--src/components/application_manager/test/application_impl_test.cc732
-rw-r--r--src/components/application_manager/test/application_state_test.cc268
-rw-r--r--src/components/application_manager/test/command_impl_test.cc76
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc124
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc99
-rw-r--r--src/components/application_manager/test/event_engine_test.cc183
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json466
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc527
-rw-r--r--src/components/application_manager/test/include/application_manager/application_manager_mock.h (renamed from src/components/application_manager/test/state_controller/include/application_manager_mock.h)52
-rw-r--r--src/components/application_manager/test/include/application_manager/application_mock.h (renamed from src/components/application_manager/test/state_controller/include/application_mock.h)268
-rw-r--r--src/components/application_manager/test/include/application_manager/event_observer_mock.h (renamed from src/components/application_manager/test/state_controller/include/state_controller_mock.h)40
-rw-r--r--src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h62
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h (renamed from src/components/application_manager/test/resumption/include/application_mock.h)75
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application_manager.h248
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h68
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h174
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h95
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_statistics_manager.h65
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h (renamed from src/components/application_manager/test/mock/src/application_manager_impl.cc)24
-rw-r--r--src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h203
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_mock.h (renamed from src/components/application_manager/test/resumption/include/resumption_data_mock.h)24
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h (renamed from src/components/application_manager/test/resumption/include/resumption_data_test.h)47
-rw-r--r--src/components/application_manager/test/include/application_manager/statistics_manager_mock.h (renamed from src/components/application_manager/test/state_controller/include/statistics_manager_mock.h)19
-rw-r--r--src/components/application_manager/test/include/application_manager/test_resumption_data_db.h62
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt61
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt.user189
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc906
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc311
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc126
l---------src/components/application_manager/test/mock/include/application_manager/application.h1
l---------src/components/application_manager/test/mock/include/application_manager/application_data_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/application_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/application_manager.h1
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h373
l---------src/components/application_manager/test/mock/include/application_manager/commands/command.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/pending.h1
l---------src/components/application_manager/test/mock/include/application_manager/event_engine/event.h1
l---------src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h1
l---------src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h1
l---------src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h1
l---------src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h1
l---------src/components/application_manager/test/mock/include/application_manager/hmi_state.h1
l---------src/components/application_manager/test/mock/include/application_manager/message.h1
l---------src/components/application_manager/test/mock/include/application_manager/message_helper.h1
l---------src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h1
l---------src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h1
l---------src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h1
l---------src/components/application_manager/test/mock/include/application_manager/request_controller.h1
l---------src/components/application_manager/test/mock/include/application_manager/request_info.h1
l---------src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h1
l---------src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h1
l---------src/components/application_manager/test/mock/include/application_manager/state_context.h1
l---------src/components/application_manager/test/mock/include/application_manager/state_controller.h1
l---------src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h1
l---------src/components/application_manager/test/mock/include/application_manager/usage_statistics.h1
l---------src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h1
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc309
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc140
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc1478
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc186
-rw-r--r--src/components/application_manager/test/request_info_test.cc537
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc676
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc134
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc135
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc67
-rw-r--r--src/components/application_manager/test/resumption_sql_queries_test.cc3090
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json1944
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json1722
-rw-r--r--src/components/application_manager/test/smartDeviceLink_test.ini39
-rw-r--r--src/components/application_manager/test/smartDeviceLink_test2.ini28
-rw-r--r--src/components/application_manager/test/state_controller/CMakeLists.txt6
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc2026
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc174
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc169
413 files changed, 17048 insertions, 2329 deletions
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 473ae6765e..118cda4fcb 100644
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2015, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -31,66 +31,61 @@
# TODO{ALeshin}: APPLINK-10792. Do not write tests which use
# application manager(AM) singleton while refactoring of AM is finished.
-# Replace include for mocking singltone
-get_property(the_include_dirs DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES)
-set(class_to_mock ${CMAKE_SOURCE_DIR}/src/components/application_manager/include)
-list(FIND the_include_dirs ${class_to_mock} find_idx)
-if(find_idx GREATER -1)
- LIST_REPLACE(the_include_dirs ${find_idx} ${AM_MOCK_DIR}/include)
-endif()
-set_property(DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES ${the_include_dirs})
-
-include_directories(
- ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
- ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
- ${COMPONENTS_DIR}/application_manager/include/application_manager/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/policies
-)
-
-set(testSources
- #${AM_TEST_DIR}/command_impl_test.cc
- ${COMPONENTS_DIR}/application_manager/test/mobile_message_handler_test.cc
- #${AM_TEST_DIR}/request_info_test.cc
-)
-
-set(mockedSources
- ${AM_MOCK_DIR}/src/application_manager_impl.cc
-)
-
-set(AM_SOURCES
- ${AM_SOURCE_DIR}/src/policies/policy_handler.cc
- ${AM_SOURCE_DIR}/src/policies/policy_event_observer.cc
-
- ${AM_SOURCE_DIR}/src/commands/command_impl.cc
- ${AM_SOURCE_DIR}/src/commands/command_request_impl.cc
- ${AM_SOURCE_DIR}/src/commands/command_response_impl.cc
- ${AM_SOURCE_DIR}/src/commands/command_notification_impl.cc
- ${AM_SOURCE_DIR}/src/commands/command_notification_from_mobile_impl.cc
- ${AM_SOURCE_DIR}/src/commands/pending.cc
-
- ${AM_SOURCE_DIR}/src/usage_statistics.cc
- ${AM_SOURCE_DIR}/src/request_info.cc
- ${AM_SOURCE_DIR}/src/message.cc
- ${AM_SOURCE_DIR}/src/application_impl.cc
- ${AM_SOURCE_DIR}/src/state_controller.cc
- ${AM_SOURCE_DIR}/src/mobile_command_factory.cc
- ${AM_SOURCE_DIR}/src/message_helper.cc
- ${AM_SOURCE_DIR}/src/hmi_command_factory.cc
- ${AM_SOURCE_DIR}/src/hmi_capabilities.cc
- ${AM_SOURCE_DIR}/src/application_data_impl.cc
- ${AM_SOURCE_DIR}/src/request_controller.cc
- ${AM_SOURCE_DIR}/src/resume_ctrl.cpp
- ${AM_SOURCE_DIR}/src/mobile_message_handler.cc
-)
+if (BUILD_TESTS)
+
include_directories(
- ${AM_SOURCE_DIR}/policy/src/policy/policy_table/table_struct
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/resumption/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/policy/include/
+ ${COMPONENTS_DIR}/media_manager/include/
+ ${COMPONENTS_DIR}/security_manager/include/
+ ${COMPONENTS_DIR}/policy/test/include/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ )
+
+ set(testSources
+ ${AM_TEST_DIR}/mobile_message_handler_test.cc
+ ${AM_TEST_DIR}/mobile_message_handler_v1_test.cc
+ ${AM_TEST_DIR}/request_info_test.cc
+ ${AM_TEST_DIR}/resumption_sql_queries_test.cc
+ ${AM_TEST_DIR}/event_engine_test.cc
+ ${AM_TEST_DIR}/policy_event_observer_test.cc
+ ${AM_TEST_DIR}/application_impl_test.cc
+ ${AM_TEST_DIR}/hmi_capabilities_test.cc
+ ${AM_TEST_DIR}/application_state_test.cc
+ ${AM_TEST_DIR}/usage_statistics_test.cc
+ ${AM_TEST_DIR}/policy_handler_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+ )
+ set (request_controller_SOURCES
+ ${AM_TEST_DIR}/request_controller/request_controller_test.cc
)
+
set(testLibraries
- gmock
+ ApplicationManager
+ Utils
+ dbms
+ jsoncpp
+ Policy
+ connectionHandler
+ HMI_API
+ MOBILE_API
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ formatters
gmock_main
UsageStatistics
dl
ProtocolLibrary
+ ConfigProfile
+ MediaManager
+ Resumption
+ ProtocolHandler
+ SecurityManager
)
set(test_exec_libraries
@@ -113,32 +108,65 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(REMOVE_ITEM test_exec_libraries dl)
endif()
-if(ENABLE_LOG)
- list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
- list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
- list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
- list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
-endif()
+ set(testLibraries
+ Utils
+ ApplicationManager
+ jsoncpp
+ Policy
+ connectionHandler
+ HMI_API
+ MOBILE_API
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ formatters
+ gmock_main
+ UsageStatistics
+ dl
+ ProtocolLibrary
+ ConfigProfile
+ MediaManager
+ Resumption
+ ProtocolHandler
+ SecurityManager
+ )
-add_library("ApplicationManagerTest" ${mockedSources} ${testSources})
+ if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
+ list(REMOVE_ITEM test_exec_libraries dl)
+ endif()
-target_link_libraries("ApplicationManagerTest" ${testLibraries} AMHMICommandsLibrary
- AMMobileCommandsLibrary
- AMEventEngine
- AMPolicyLibrary)
+ if (ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
+ endif()
-create_test("application_manager_test" "${testSources}" "${ApplicationManagerTest}")
-target_link_libraries("application_manager_test"
- ApplicationManagerTest ${test_exec_libraries}
- ApplicationManager
- ProtocolLibrary
- connectionHandler
- ConfigProfile
- jsoncpp
- MediaManager
- ProtocolHandler
- Resumption
-)
+ file(COPY smartDeviceLink_test2.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+ file(COPY sdl_preloaded_pt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+ file(COPY sdl_pt_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-#add_executable(application_manager_test ${testSources})
-#target_link_libraries(application_manager_test ApplicationManagerTest ${test_exec_libraries})
+add_custom_command(
+OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libPolicy.so
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${COMPONENTS_DIR}/policy/libPolicy.so ${CMAKE_CURRENT_BINARY_DIR})
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}")
+ create_test("application_manager_test" "${testSources}" "${testLibraries}" )
+# TODO [AKozoriz] : Fix not buildable tests
+ set(ResumptionData_SOURCES
+ ${AM_TEST_DIR}/resumption/resumption_data_test.cc
+ ${AM_TEST_DIR}/resumption/resumption_data_db_test.cc
+ ${AM_TEST_DIR}/resumption/resumption_data_json_test.cc
+ ${AM_TEST_DIR}/resumption/resume_ctrl_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+ )
+
+ file(COPY hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+ file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption)
+ file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/resumption)
+ create_test("resumption/data_resumption_test" "${ResumptionData_SOURCES}" "${testLibraries}")
+
+ add_subdirectory(state_controller)
+endif()
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
new file mode 100644
index 0000000000..7989f11fce
--- /dev/null
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -0,0 +1,732 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_impl.h"
+#include <iostream>
+#include "gtest/gtest.h"
+#include "application_manager/hmi_state.h"
+#include "utils/file_system.h"
+
+#include "utils/make_shared.h"
+#include "application_manager/mock_message_helper.h"
+#include "utils/custom_string.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/state_controller.h"
+#include "resumption/last_state.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "policy/mock_statistics_manager.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using namespace application_manager;
+
+using namespace mobile_apis;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace custom_str = utils::custom_string;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+using usage_statistics_test::MockStatisticsManager;
+
+typedef void (ApplicationImpl::*AddSet)(HmiStatePtr args);
+
+class ApplicationImplTest : public ::testing::Test {
+ protected:
+ virtual void SetUp() OVERRIDE {
+ app_id = 10;
+ policy_app_id = "policy_app_id";
+ app_name = "app_name";
+ mac_address = "mac_address";
+ test_lvl = HMILevel::INVALID_ENUM;
+ state_id = HmiState::STATE_ID_REGULAR;
+ audiostate = AudioStreamingState::NOT_AUDIBLE;
+ syst_context = SystemContext::SYSCTXT_MAIN;
+
+ testHmiState = CreateTestHmiState();
+ EXPECT_CALL(mock_application_manager_, CreateRegularState(app_id, _, _, _))
+ .WillOnce(Return(testHmiState));
+ EXPECT_CALL(mock_application_manager_, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings_));
+ EXPECT_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillRepeatedly(ReturnRef(directory_name));
+ EXPECT_CALL(mock_application_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(directory_name));
+ EXPECT_CALL(mock_application_manager_settings_,
+ audio_data_stopped_timeout()).WillOnce(Return(0));
+ EXPECT_CALL(mock_application_manager_settings_,
+ video_data_stopped_timeout()).WillOnce(Return(0));
+ app_impl = new ApplicationImpl(app_id,
+ policy_app_id,
+ mac_address,
+ app_name,
+ utils::MakeShared<MockStatisticsManager>(),
+ mock_application_manager_);
+ }
+ void TearDown() OVERRIDE {
+ delete app_impl;
+ }
+ HmiStatePtr CreateTestHmiState();
+
+ HmiStatePtr TestAddHmiState(HMILevel::eType hmi_lvl,
+ HmiState::StateID id_state,
+ AddSet hmi_action);
+
+ void CheckCurrentHMIState();
+ MockApplicationManagerSettings mock_application_manager_settings_;
+ MockApplicationManager mock_application_manager_;
+ ApplicationImpl* app_impl;
+ uint32_t app_id;
+ std::string policy_app_id;
+ std::string mac_address;
+ custom_str::CustomString app_name;
+ const std::string directory_name = "./test_storage";
+ HmiState::StateID state_id;
+ HmiStatePtr testHmiState;
+ HMILevel::eType test_lvl;
+ AudioStreamingState::eType audiostate;
+ SystemContext::eType syst_context;
+};
+
+HmiStatePtr ApplicationImplTest::CreateTestHmiState() {
+ HmiStatePtr testState =
+ utils::MakeShared<HmiState>(app_id, mock_application_manager_, state_id);
+ testState->set_hmi_level(test_lvl);
+ testState->set_audio_streaming_state(audiostate);
+ testState->set_system_context(syst_context);
+ return testState;
+}
+
+HmiStatePtr ApplicationImplTest::TestAddHmiState(HMILevel::eType hmi_lvl,
+ HmiState::StateID id_state,
+ AddSet hmi_action) {
+ test_lvl = hmi_lvl;
+ state_id = id_state;
+ HmiStatePtr state = CreateTestHmiState();
+ (app_impl->*hmi_action)(state);
+ return state;
+}
+
+void ApplicationImplTest::CheckCurrentHMIState() {
+ HmiStatePtr current_state = app_impl->CurrentHmiState();
+ EXPECT_EQ(test_lvl, current_state->hmi_level());
+ EXPECT_EQ(state_id, current_state->state_id());
+}
+
+TEST_F(ApplicationImplTest, AddHmiState_GetCurrentState) {
+ TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_PHONE_CALL,
+ &ApplicationImpl::AddHMIState);
+
+ CheckCurrentHMIState();
+ EXPECT_EQ(app_id, app_impl->app_id());
+}
+
+TEST_F(ApplicationImplTest, AddRegularHmiState_GetCurrentState) {
+ TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_REGULAR,
+ &ApplicationImpl::SetRegularState);
+
+ CheckCurrentHMIState();
+ EXPECT_EQ(app_id, app_impl->app_id());
+}
+
+TEST_F(ApplicationImplTest, AddStateAddRegularState_GetCurrentState) {
+ TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_REGULAR,
+ &ApplicationImpl::SetRegularState);
+ TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+
+ CheckCurrentHMIState();
+ EXPECT_EQ(app_id, app_impl->app_id());
+}
+
+TEST_F(ApplicationImplTest, AddStateAddRegularState_GetRegularState) {
+ TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_REGULAR,
+ &ApplicationImpl::SetRegularState);
+ TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+
+ HmiStatePtr current_state = app_impl->RegularHmiState();
+ EXPECT_EQ(HMILevel::HMI_FULL, current_state->hmi_level());
+ EXPECT_EQ(HmiState::STATE_ID_REGULAR, current_state->state_id());
+ EXPECT_EQ(app_id, app_impl->app_id());
+}
+
+TEST_F(ApplicationImplTest, AddStates_RemoveLastState) {
+ // First state
+ TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_PHONE_CALL,
+ &ApplicationImpl::AddHMIState);
+ HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_NONE,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+ HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_TTS_SESSION,
+ &ApplicationImpl::AddHMIState);
+
+ CheckCurrentHMIState();
+
+ // Remove last state
+ app_impl->RemoveHMIState(state3->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState();
+ EXPECT_EQ(state2, current_state);
+ EXPECT_EQ(HMILevel::HMI_NONE, current_state->hmi_level());
+ EXPECT_EQ(HmiState::STATE_ID_NAVI_STREAMING, current_state->state_id());
+}
+
+TEST_F(ApplicationImplTest, AddStates_RemoveNotLastNotFirstState) {
+ HmiStatePtr state1 = TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_PHONE_CALL,
+ &ApplicationImpl::AddHMIState);
+ HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_NONE,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+ HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_TTS_SESSION,
+ &ApplicationImpl::AddHMIState);
+
+ CheckCurrentHMIState();
+
+ // Remove not last state
+ app_impl->RemoveHMIState(state2->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState();
+ EXPECT_EQ(state3, current_state);
+ // HMI level is equal to parent hmi_level
+ EXPECT_EQ(HMILevel::HMI_FULL, current_state->hmi_level());
+ EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id());
+ EXPECT_EQ(state1, current_state->parent());
+}
+
+TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
+ HmiStatePtr state1 = TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_PHONE_CALL,
+ &ApplicationImpl::AddHMIState);
+ // Second state
+ TestAddHmiState(HMILevel::HMI_NONE,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+ HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_TTS_SESSION,
+ &ApplicationImpl::AddHMIState);
+ CheckCurrentHMIState();
+
+ // Remove first added state
+ app_impl->RemoveHMIState(state1->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState();
+ EXPECT_EQ(state3, current_state);
+ // Last state does not have a parent
+ EXPECT_EQ(HMILevel::HMI_LIMITED, current_state->hmi_level());
+ EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id());
+ EXPECT_EQ(NULL, current_state->parent());
+}
+
+TEST_F(ApplicationImplTest, SetRegularState_RemoveFirstState) {
+ HmiStatePtr state1 = TestAddHmiState(HMILevel::HMI_NONE,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+ // Set regular state
+ HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_REGULAR,
+ &ApplicationImpl::SetRegularState);
+ HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_TTS_SESSION,
+ &ApplicationImpl::AddHMIState);
+ CheckCurrentHMIState();
+
+ // Remove first state
+ app_impl->RemoveHMIState(state1->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState();
+ EXPECT_EQ(state3, current_state);
+ // Last state has a parent
+ EXPECT_EQ(HMILevel::HMI_FULL, current_state->hmi_level());
+ EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id());
+ EXPECT_EQ(state2, current_state->parent());
+}
+
+TEST_F(ApplicationImplTest, SetPostponedState_RemovePostponedState) {
+ // Set postponed hmi state
+ HmiStatePtr state1 = TestAddHmiState(HMILevel::HMI_NONE,
+ HmiState::STATE_ID_POSTPONED,
+ &ApplicationImpl::SetPostponedState);
+
+ // Check that state was setted correctly
+ HmiStatePtr state2 = app_impl->PostponedHmiState();
+ EXPECT_EQ(state1, state2);
+
+ // Check that state was correctly removed
+ app_impl->RemovePostponedState();
+ state2 = app_impl->PostponedHmiState();
+ EXPECT_EQ(NULL, state2);
+}
+
+TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
+ audiostate = AudioStreamingState::ATTENUATED;
+ syst_context = SystemContext::SYSCTXT_ALERT;
+ TestAddHmiState(HMILevel::HMI_FULL,
+ HmiState::STATE_ID_REGULAR,
+ &ApplicationImpl::SetRegularState);
+
+ EXPECT_EQ(test_lvl, app_impl->hmi_level());
+ EXPECT_EQ(audiostate, app_impl->audio_streaming_state());
+ EXPECT_EQ(syst_context, app_impl->system_context());
+
+ audiostate = AudioStreamingState::AUDIBLE;
+ syst_context = SystemContext::SYSCTXT_MENU;
+ TestAddHmiState(HMILevel::HMI_LIMITED,
+ HmiState::STATE_ID_NAVI_STREAMING,
+ &ApplicationImpl::AddHMIState);
+
+ EXPECT_EQ(test_lvl, app_impl->hmi_level());
+ EXPECT_EQ(audiostate, app_impl->audio_streaming_state());
+ EXPECT_EQ(syst_context, app_impl->system_context());
+}
+
+TEST_F(ApplicationImplTest, IsAudioApplication) {
+ EXPECT_FALSE(app_impl->IsAudioApplication());
+ app_impl->set_is_navi(true);
+ app_impl->set_is_media_application(false);
+ app_impl->set_voice_communication_supported(false);
+ EXPECT_TRUE(app_impl->IsAudioApplication());
+ app_impl->set_is_navi(false);
+ app_impl->set_is_media_application(true);
+ app_impl->set_voice_communication_supported(false);
+ EXPECT_TRUE(app_impl->IsAudioApplication());
+ app_impl->set_is_navi(false);
+ app_impl->set_is_media_application(false);
+ app_impl->set_voice_communication_supported(true);
+ EXPECT_TRUE(app_impl->IsAudioApplication());
+ app_impl->set_is_media_application(false);
+ app_impl->set_voice_communication_supported(false);
+ app_impl->set_is_navi(false);
+ EXPECT_FALSE(app_impl->IsAudioApplication());
+}
+
+TEST_F(ApplicationImplTest, AddFile) {
+ AppFile test_file;
+
+ test_file.is_persistent = true;
+ test_file.is_download_complete = false;
+ test_file.file_type = FileType::AUDIO_AAC;
+ test_file.file_name = "test_file 1";
+
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+ test_file.is_download_complete = true;
+ EXPECT_FALSE(app_impl->AddFile(test_file));
+ test_file.file_name = "test_file 2";
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+}
+
+TEST_F(ApplicationImplTest, UpdateFile) {
+ AppFile test_file;
+
+ test_file.is_persistent = true;
+ test_file.is_download_complete = false;
+ test_file.file_type = FileType::AUDIO_AAC;
+ test_file.file_name = "test_file 1";
+
+ EXPECT_FALSE(app_impl->UpdateFile(test_file));
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+ test_file.is_download_complete = true;
+ EXPECT_FALSE(app_impl->AddFile(test_file));
+ EXPECT_TRUE(app_impl->UpdateFile(test_file));
+}
+
+TEST_F(ApplicationImplTest, DeleteFile) {
+ AppFile test_file;
+ test_file.is_persistent = true;
+ test_file.is_download_complete = false;
+ test_file.file_type = FileType::AUDIO_AAC;
+ test_file.file_name = "test_file 1";
+
+ EXPECT_FALSE(app_impl->DeleteFile(test_file.file_name));
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+ EXPECT_TRUE(app_impl->DeleteFile(test_file.file_name));
+ EXPECT_FALSE(app_impl->DeleteFile(test_file.file_name));
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+}
+
+TEST_F(ApplicationImplTest, GetFile) {
+ AppFile test_file;
+ test_file.is_persistent = true;
+ test_file.is_download_complete = true;
+ test_file.file_type = FileType::GRAPHIC_JPEG;
+ test_file.file_name = "test_file 1";
+
+ EXPECT_EQ(NULL, app_impl->GetFile(test_file.file_name));
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+ const AppFile* app_file = app_impl->GetFile(test_file.file_name);
+ EXPECT_EQ(test_file.is_persistent, app_file->is_persistent);
+ EXPECT_EQ(test_file.is_download_complete, app_file->is_download_complete);
+ EXPECT_EQ(test_file.file_type, app_file->file_type);
+}
+
+TEST_F(ApplicationImplTest, SetIconPath) {
+ AppFile test_file;
+ test_file.is_persistent = true;
+ test_file.is_download_complete = false;
+ test_file.file_type = FileType::GRAPHIC_BMP;
+ test_file.file_name = "test_file 1";
+
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+ test_file.file_name = "test_file 2";
+ test_file.file_type = FileType::GRAPHIC_PNG;
+ EXPECT_TRUE(app_impl->AddFile(test_file));
+
+ EXPECT_TRUE(app_impl->set_app_icon_path(test_file.file_name));
+ EXPECT_EQ(test_file.file_name, app_impl->app_icon_path());
+}
+
+TEST_F(ApplicationImplTest, LoadPersistentFiles) {
+ // Precondition
+ // Create test folder with diff files
+
+ app_impl->MarkRegistered();
+ std::string folder_name = "";
+ app_impl->set_folder_name(folder_name);
+
+ file_system::CreateDirectory(directory_name);
+
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file1.json"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file2.bmp"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file3.jpeg"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file4.png"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file5"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file6.wave"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file7.mp4"));
+ EXPECT_TRUE(file_system::CreateFile(directory_name + "/test_file8.mp3"));
+
+ app_impl->LoadPersistentFiles();
+
+ AppFilesMap files_map = app_impl->getAppFiles();
+
+ EXPECT_EQ(8u, files_map.size());
+ const AppFile* test_file1 =
+ app_impl->GetFile(directory_name + "//test_file1.json");
+ ASSERT_TRUE(test_file1);
+ EXPECT_EQ(FileType::JSON, test_file1->file_type);
+ const AppFile* test_file2 =
+ app_impl->GetFile(directory_name + "//test_file2.bmp");
+ ASSERT_TRUE(test_file2);
+ EXPECT_EQ(FileType::GRAPHIC_BMP, test_file2->file_type);
+ const AppFile* test_file3 =
+ app_impl->GetFile(directory_name + "//test_file3.jpeg");
+ ASSERT_TRUE(test_file3);
+ EXPECT_EQ(FileType::GRAPHIC_JPEG, test_file3->file_type);
+ const AppFile* test_file4 =
+ app_impl->GetFile(directory_name + "//test_file4.png");
+ ASSERT_TRUE(test_file4);
+ EXPECT_EQ(FileType::GRAPHIC_PNG, test_file4->file_type);
+ const AppFile* test_file5 =
+ app_impl->GetFile(directory_name + "//test_file5");
+ ASSERT_TRUE(test_file5);
+ EXPECT_EQ(FileType::BINARY, test_file5->file_type);
+ const AppFile* test_file6 =
+ app_impl->GetFile(directory_name + "//test_file6.wave");
+ ASSERT_TRUE(test_file6);
+ EXPECT_EQ(FileType::AUDIO_WAVE, test_file6->file_type);
+ const AppFile* test_file7 =
+ app_impl->GetFile(directory_name + "//test_file7.mp4");
+ ASSERT_TRUE(test_file7);
+ EXPECT_EQ(FileType::AUDIO_AAC, test_file7->file_type);
+ const AppFile* test_file8 =
+ app_impl->GetFile(directory_name + "//test_file8.mp3");
+ ASSERT_TRUE(test_file8);
+ EXPECT_EQ(FileType::AUDIO_MP3, test_file8->file_type);
+}
+
+TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_SetLimitFromConfig) {
+ std::pair<uint32_t, int32_t> get_frequency;
+ get_frequency.first = 5;
+ get_frequency.second = 1;
+ EXPECT_CALL(mock_application_manager_settings_, read_did_frequency())
+ .WillRepeatedly(ReturnRef(get_frequency));
+ EXPECT_CALL(mock_application_manager_settings_, get_vehicle_data_frequency())
+ .WillRepeatedly(ReturnRef(get_frequency));
+ for (uint32_t i = 0; i < get_frequency.first; i++) {
+ EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::CONFIG_FILE));
+ }
+ EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::CONFIG_FILE));
+
+ for (uint32_t i = 0; i < get_frequency.first; i++) {
+ EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::CONFIG_FILE));
+ }
+ EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::CONFIG_FILE));
+}
+
+TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_LimitFromPT) {
+ policy_test::MockPolicyHandlerInterface policy_interface;
+ EXPECT_CALL(mock_application_manager_, GetPolicyHandler())
+ .WillRepeatedly(ReturnRef(policy_interface));
+ EXPECT_CALL(policy_interface, GetPriority(policy_app_id, _))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(policy_interface, GetNotificationsNumber(_))
+ .WillOnce(Return(100u));
+ EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::POLICY_TABLE));
+
+ EXPECT_CALL(policy_interface, GetNotificationsNumber(_))
+ .WillOnce(Return(100u));
+ EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::POLICY_TABLE));
+ EXPECT_CALL(policy_interface, GetNotificationsNumber(_))
+ .WillRepeatedly(Return(0));
+ EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::POLICY_TABLE));
+ EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::POLICY_TABLE));
+}
+
+TEST_F(ApplicationImplTest, SubscribeToButton_UnsubscribeFromButton) {
+ EXPECT_TRUE(app_impl->SubscribeToButton(ButtonName::PRESET_0));
+ // It is impossible to subsribe to the same button twice
+ EXPECT_FALSE(app_impl->SubscribeToButton(ButtonName::PRESET_0));
+ EXPECT_TRUE(app_impl->IsSubscribedToButton(ButtonName::PRESET_0));
+ EXPECT_TRUE(app_impl->UnsubscribeFromButton(ButtonName::PRESET_0));
+ EXPECT_FALSE(app_impl->IsSubscribedToButton(ButtonName::PRESET_0));
+}
+
+TEST_F(ApplicationImplTest, SubscribeToDefaultButton_UnsubscribeFromButton) {
+ EXPECT_TRUE(app_impl->IsSubscribedToButton(ButtonName::CUSTOM_BUTTON));
+ EXPECT_FALSE(app_impl->SubscribeToButton(ButtonName::CUSTOM_BUTTON));
+}
+
+TEST_F(ApplicationImplTest, SubscribeToSoftButton_UnsubscribeFromSoftButton) {
+ const uint btn_count = 10;
+ for (uint i = 0; i < btn_count; i++) {
+ EXPECT_FALSE(app_impl->IsSubscribedToSoftButton(i));
+ }
+
+ SoftButtonID test_button;
+ for (uint i = 0; i < btn_count; i++) {
+ test_button.insert(i);
+ }
+ app_impl->SubscribeToSoftButtons(FunctionID::ScrollableMessageID,
+ test_button);
+
+ for (uint i = 0; i < btn_count; i++) {
+ EXPECT_TRUE(app_impl->IsSubscribedToSoftButton(i));
+ }
+ app_impl->UnsubscribeFromSoftButtons(FunctionID::ScrollableMessageID);
+
+ for (uint i = 0; i < btn_count; i++) {
+ EXPECT_FALSE(app_impl->IsSubscribedToSoftButton(i));
+ }
+}
+
+TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeNotNaviNotVoice) {
+ smart_objects::SmartObject type_media;
+ type_media[0] = AppHMIType::MEDIA;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+
+ app_impl->set_app_types(type_media);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+}
+
+TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) {
+ smart_objects::SmartObject type_comm;
+ type_comm[0] = AppHMIType::COMMUNICATION;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+
+ app_impl->set_app_types(type_comm);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_TRUE(app_impl->is_voice_communication_supported());
+}
+
+TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) {
+ smart_objects::SmartObject type_navi;
+ type_navi[0] = AppHMIType::NAVIGATION;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+
+ app_impl->set_app_types(type_navi);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_TRUE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+}
+
+TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
+ smart_objects::SmartObject app_types;
+ app_types[0] = AppHMIType::NAVIGATION;
+ app_types[1] = AppHMIType::COMMUNICATION;
+ app_types[2] = AppHMIType::MEDIA;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+
+ app_impl->set_app_types(app_types);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_TRUE(app_impl->is_navi());
+ EXPECT_TRUE(app_impl->is_voice_communication_supported());
+}
+
+TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendHashUpdateNotification(app_id, _)).Times(1);
+ app_impl->UpdateHash();
+
+ EXPECT_TRUE(app_impl->is_application_data_changed());
+}
+
+TEST_F(ApplicationImplTest, StartStreaming_MobileNavi_StreamingNotApproved) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviStartStream(app_id, _));
+ app_impl->StartStreaming(protocol_handler::ServiceType::kMobileNav);
+
+ EXPECT_EQ(0u, app_impl->video_stream_retry_number());
+}
+
+TEST_F(ApplicationImplTest, StartStreaming_Audio_StreamingNotApproved) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendAudioStartStream(app_id, _));
+ app_impl->StartStreaming(protocol_handler::ServiceType::kAudio);
+
+ EXPECT_EQ(0u, app_impl->video_stream_retry_number());
+}
+
+TEST_F(ApplicationImplTest, StartStreaming_StreamingApproved) {
+ app_impl->set_video_streaming_approved(true);
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviStartStream(app_id, _)).Times(0);
+ app_impl->StartStreaming(protocol_handler::ServiceType::kMobileNav);
+
+ app_impl->set_audio_streaming_approved(true);
+
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendAudioStartStream(app_id, _)).Times(0);
+ app_impl->StartStreaming(protocol_handler::ServiceType::kAudio);
+}
+
+TEST_F(ApplicationImplTest, SuspendNaviStreaming) {
+ protocol_handler::ServiceType type =
+ protocol_handler::ServiceType::kMobileNav;
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, false, _));
+ app_impl->SuspendStreaming(type);
+}
+
+TEST_F(ApplicationImplTest, SuspendAudioStreaming) {
+ protocol_handler::ServiceType type = protocol_handler::ServiceType::kAudio;
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, false, _));
+ app_impl->SuspendStreaming(type);
+}
+
+// TODO {AKozoriz} : Fix tests with streaming (APPLINK-19289)
+TEST_F(ApplicationImplTest, DISABLED_Suspend_WakeUpAudioStreaming) {
+ protocol_handler::ServiceType type = protocol_handler::ServiceType::kAudio;
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, false, _));
+ app_impl->SuspendStreaming(type);
+
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, true));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, true, _));
+ app_impl->WakeUpStreaming(type);
+}
+
+TEST_F(ApplicationImplTest, DISABLED_Suspend_WakeUpNaviStreaming) {
+ protocol_handler::ServiceType type =
+ protocol_handler::ServiceType::kMobileNav;
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, false, _));
+ app_impl->SuspendStreaming(type);
+
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, true));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, true, _));
+ app_impl->WakeUpStreaming(type);
+}
+
+TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) {
+ // Stop navigation streaming
+ protocol_handler::ServiceType type =
+ protocol_handler::ServiceType::kMobileNav;
+ app_impl->set_video_streaming_approved(true);
+
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, false, _));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviStopStream(app_id, _));
+
+ app_impl->StopStreaming(type);
+ EXPECT_FALSE(app_impl->video_streaming_approved());
+
+ // Stop audio streaming
+ app_impl->set_audio_streaming_approved(true);
+ type = protocol_handler::ServiceType::kAudio;
+ EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnDataStreaming(type, false, _));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendAudioStopStream(app_id, _));
+
+ app_impl->StopStreaming(type);
+ EXPECT_FALSE(app_impl->audio_streaming_approved());
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
new file mode 100644
index 0000000000..7bc34966b4
--- /dev/null
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_state.h"
+#include "gtest/gtest.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "resumption/last_state.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+#include "utils/make_shared.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using namespace application_manager;
+using namespace mobile_apis;
+typedef HmiState::StateID StateID;
+
+namespace {
+std::vector<StateID> GenerateCurrentStates() {
+ std::vector<StateID> states;
+ states.push_back(StateID::STATE_ID_PHONE_CALL);
+ states.push_back(StateID::STATE_ID_SAFETY_MODE);
+ states.push_back(StateID::STATE_ID_VR_SESSION);
+ states.push_back(StateID::STATE_ID_TTS_SESSION);
+ states.push_back(StateID::STATE_ID_NAVI_STREAMING);
+ states.push_back(StateID::STATE_ID_DEACTIVATE_HMI);
+ return states;
+}
+}
+
+class ApplicationStateTest : public ::testing::Test {
+ protected:
+ static std::vector<StateID> added_states_;
+ ApplicationState app_state;
+ const StateID current_id = StateID::STATE_ID_CURRENT;
+ const StateID postponed_id = StateID::STATE_ID_POSTPONED;
+ const uint32_t app_id = 10;
+ MockApplicationManager app_mngr_;
+};
+
+std::vector<StateID> ApplicationStateTest::added_states_ =
+ GenerateCurrentStates();
+
+TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
+ std::vector<StateID>::iterator new_state = added_states_.begin();
+ for (; new_state != added_states_.end(); ++new_state) {
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ app_state.AddState(state);
+ EXPECT_EQ(state, app_state.GetState(current_id));
+ }
+}
+
+TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) {
+ std::vector<StateID>::iterator new_state = added_states_.begin();
+ for (; new_state != added_states_.end(); ++new_state) {
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ app_state.AddState(state);
+
+ HmiStatePtr curr_state = app_state.GetState(current_id);
+ ASSERT_EQ(*new_state, curr_state->state_id());
+ }
+
+ new_state = added_states_.end() - 1;
+ while (new_state != added_states_.begin()) {
+ app_state.RemoveState(*new_state);
+ HmiStatePtr curr_state = app_state.GetState(current_id);
+ --new_state;
+ EXPECT_EQ(*new_state, curr_state->state_id());
+ }
+}
+
+TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
+ // Added some states
+ std::vector<StateID>::iterator new_state = added_states_.begin();
+ for (; new_state != added_states_.end(); ++new_state) {
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ app_state.AddState(state);
+ }
+ // Postponed state wasn't added
+ HmiStatePtr get_postponed_id = app_state.GetState(postponed_id);
+ EXPECT_EQ(NULL, get_postponed_id);
+ // Add posponed state
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ app_state.AddState(state);
+ // Postponed state exists
+ get_postponed_id = app_state.GetState(postponed_id);
+ EXPECT_EQ(state, get_postponed_id);
+}
+
+TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
+ // Add state
+ std::vector<StateID>::iterator new_state = added_states_.begin();
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ state->set_hmi_level(HMILevel::HMI_FULL);
+ app_state.AddState(state);
+ ++new_state;
+ // Add some other
+ for (; new_state != added_states_.end(); ++new_state) {
+ state = utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ app_state.AddState(state);
+ state->set_hmi_level(HMILevel::HMI_LIMITED);
+ }
+
+ // Regular state will be the first added state
+ new_state = added_states_.begin();
+ HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ EXPECT_EQ(*new_state, reg_state->state_id());
+ EXPECT_EQ(HMILevel::HMI_FULL, reg_state->hmi_level());
+}
+
+TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
+ std::vector<StateID>::iterator new_state = added_states_.begin();
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ app_state.AddState(state);
+ ++new_state;
+
+ // Add postponed state
+ state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ app_state.AddState(state);
+
+ // Make sure that the state was added
+ HmiStatePtr post_state = app_state.GetState(postponed_id);
+ ASSERT_EQ(state, post_state);
+
+ for (; new_state != added_states_.end(); ++new_state) {
+ state = utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ app_state.AddState(state);
+ }
+
+ // Regular state will be the first added state
+ new_state = added_states_.begin();
+ HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ ASSERT_EQ(*new_state, reg_state->state_id());
+
+ app_state.RemoveState(*new_state);
+
+ ++new_state;
+ // Now regular state is the next state except postponed
+ reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ EXPECT_EQ(*new_state, reg_state->state_id());
+}
+
+TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
+ // Add some state
+ StateID first_state = StateID::STATE_ID_PHONE_CALL;
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, first_state);
+ app_state.AddState(state);
+
+ // Add postponed state
+ state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ app_state.AddState(state);
+
+ // Add new postponed state
+ const uint32_t app_id2 = 10;
+ state = utils::MakeShared<HmiState>(app_id2, app_mngr_, postponed_id);
+ app_state.AddState(state);
+
+ // Add regular state
+ state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, StateID::STATE_ID_REGULAR);
+ app_state.AddState(state);
+
+ // Postponed state is the first
+ HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_POSTPONED);
+ ASSERT_EQ(postponed_id, reg_state->state_id());
+
+ // Regular state is the second one
+ reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ EXPECT_EQ(StateID::STATE_ID_REGULAR, reg_state->state_id());
+}
+
+TEST_F(ApplicationStateTest, InitState_GetRegularState) {
+ StateID init_state = StateID::STATE_ID_REGULAR;
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, init_state);
+
+ app_state.InitState(state);
+
+ HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ EXPECT_EQ(state, reg_state);
+
+ HmiStatePtr curr_state = app_state.GetState(StateID::STATE_ID_CURRENT);
+ EXPECT_EQ(state, curr_state);
+}
+
+TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
+ // Precondition
+ StateID init_state = StateID::STATE_ID_REGULAR;
+ HmiStatePtr state =
+ utils::MakeShared<HmiState>(app_id, app_mngr_, init_state);
+ state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+
+ app_state.InitState(state);
+
+ // Add postponed state
+ state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ app_state.AddState(state);
+
+ // Make sure that state was added
+ HmiStatePtr get_postponed_state = app_state.GetState(postponed_id);
+ ASSERT_EQ(state, get_postponed_state);
+
+ // Remove postponed state
+ app_state.RemoveState(postponed_id);
+
+ get_postponed_state = app_state.GetState(postponed_id);
+ EXPECT_EQ(NULL, get_postponed_state);
+}
+
+TEST_F(ApplicationStateTest,
+ AddRegularState_RemoveRegularState_RegularStateNotDeleted) {
+ StateID reg_state = StateID::STATE_ID_REGULAR;
+ HmiStatePtr state = utils::MakeShared<HmiState>(app_id, app_mngr_, reg_state);
+ app_state.InitState(state);
+
+ // Try deleting regular state
+ app_state.RemoveState(reg_state);
+
+ // Get regular state
+ HmiStatePtr get_reg_state = app_state.GetState(reg_state);
+ EXPECT_EQ(state, get_reg_state);
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/command_impl_test.cc b/src/components/application_manager/test/command_impl_test.cc
deleted file mode 100644
index 677515784f..0000000000
--- a/src/components/application_manager/test/command_impl_test.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/smart_object_keys.h"
-#include "interfaces/MOBILE_API.h"
-
-using ::testing::Return;
-using ::testing::Truly;
-
-
-bool MessageResultCodeIsGENERIC_ERROR(const utils::SharedPtr<smart_objects::SmartObject>& message) {
- if (!message) {
- return false;
- }
- const smart_objects::SmartObject& so = *(message.get());
- int32_t result_code = so[application_manager::strings::msg_params]
- [application_manager::strings::result_code].asInt();
- if (mobile_apis::Result::GENERIC_ERROR
- == static_cast<mobile_apis::Result::eType>(result_code)) {
- return true;
- } else {
- return false;
- }
-}
-
-TEST(ApplicationManager, SingletonInstance_CallTwice_ReferencesAreSame) {
- application_manager::ApplicationManagerImpl* am = application_manager::ApplicationManagerImpl::instance();
- application_manager::ApplicationManagerImpl* am2 = application_manager::ApplicationManagerImpl::instance();
- ASSERT_EQ(am, am2);
- //EXPECT_CALL((*am), GetNextHMICorrelationID()).WillRepeatedly(Return(1));
- //smart_objects::SmartObjectSPtr so = application_manager::MessageHelper::CreateModuleInfoSO(0);
- application_manager::ApplicationManagerImpl::destroy();
-}
-
-TEST(MobileCommandsTest, CommandImplTimeOut) {
- application_manager::ApplicationManagerImpl* am = application_manager::ApplicationManagerImpl::instance();
- smart_objects::SmartObjectSPtr so = application_manager::MessageHelper::CreateModuleInfoSO(0);
- application_manager::commands::CommandRequestImpl request(so);
- EXPECT_CALL((*am), ManageMobileCommand(Truly(MessageResultCodeIsGENERIC_ERROR)));
- request.onTimeOut();
- application_manager::ApplicationManagerImpl::destroy();
-}
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
new file mode 100644
index 0000000000..35755a08bb
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+using am::commands::SubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+typedef SharedPtr<SubscribeWayPointsRequest> CommandPtr;
+
+class SubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksIsNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(_))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(true));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ MessageSharedPtr mobile_result_msg(
+ CatchMobileCommandResult(CallRun(*command)));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+ Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ command->on_event(event);
+}
+
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
new file mode 100644
index 0000000000..0a5ff9745b
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+using am::commands::UnSubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+typedef SharedPtr<UnSubscribeWayPointsRequest> CommandPtr;
+
+class UnsubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksIsNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+TEST_F(UnsubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
+ CommandPtr command(CreateCommand<UnSubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+ Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_, UnsubscribeAppFromWayPoints(_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ command->on_event(event);
+}
+
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
new file mode 100644
index 0000000000..e88dd2ba4e
--- /dev/null
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_dispatcher_impl.h"
+#include "application_manager/event_observer_mock.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "smart_objects/smart_object.h"
+#include "utils/make_shared.h"
+#include "interfaces/HMI_API.h"
+
+namespace test {
+namespace components {
+namespace event_engine_test {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+using application_manager::event_engine::EventDispatcherImpl;
+using application_manager::event_engine::Event;
+using application_manager::event_engine::EventObserver;
+using testing::_;
+
+class EventEngineTest : public testing::Test {
+ public:
+ EventEngineTest()
+ : event_id(Event::EventID::BasicCommunication_ActivateApp)
+ , event_id2(Event::EventID::BasicCommunication_OnAppActivated)
+ , event_id3(Event::EventID::VR_IsReady)
+ , event_observer_mock_(mock_event_dispatcher_) {}
+
+ protected:
+ EventDispatcherImpl* event_dispatcher_instance_;
+ Event* event_;
+ const application_manager::event_engine::Event::EventID event_id;
+ const application_manager::event_engine::Event::EventID event_id2;
+ const application_manager::event_engine::Event::EventID event_id3;
+ MockEventDispatcher mock_event_dispatcher_;
+ MockEventObserver event_observer_mock_;
+ const int32_t correlation_id = 1121;
+ smart_objects::SmartObject smart_object_with_type_notification;
+ smart_objects::SmartObject smart_object_with_type_response;
+ smart_objects::SmartObject smart_object_with_type_error_response;
+ smart_objects::SmartObject smart_object_with_type_request;
+ smart_objects::SmartObject smart_object_with_invalid_type;
+
+ virtual void SetUp() OVERRIDE {
+ event_dispatcher_instance_ = new EventDispatcherImpl();
+ event_ = new Event(hmi_apis::FunctionID::eType::VR_IsReady);
+ smart_object_with_type_notification["params"]["message_type"] =
+ hmi_apis::messageType::notification;
+ smart_object_with_type_notification["params"]["correlation_id"] =
+ correlation_id;
+ smart_object_with_type_notification["params"]["function_id"] =
+ hmi_apis::FunctionID::eType::VR_IsReady;
+
+ smart_object_with_type_response["params"]["message_type"] =
+ hmi_apis::messageType::response;
+ smart_object_with_type_response["params"]["correlation_id"] =
+ correlation_id;
+ smart_object_with_type_response["params"]["function_id"] =
+ hmi_apis::FunctionID::eType::VR_IsReady;
+
+ smart_object_with_type_error_response["params"]["message_type"] =
+ hmi_apis::messageType::error_response;
+ smart_object_with_type_error_response["params"]["correlation_id"] =
+ correlation_id;
+ smart_object_with_type_error_response["params"]["function_id"] =
+ hmi_apis::FunctionID::eType::VR_IsReady;
+
+ smart_object_with_type_request["params"]["message_type"] =
+ hmi_apis::messageType::request;
+ smart_object_with_type_request["params"]["correlation_id"] = correlation_id;
+ smart_object_with_type_request["params"]["function_id"] =
+ hmi_apis::FunctionID::eType::VR_IsReady;
+
+ smart_object_with_invalid_type["params"]["message_type"] =
+ hmi_apis::messageType::INVALID_ENUM;
+ smart_object_with_invalid_type["params"]["correlation_id"] = correlation_id;
+ smart_object_with_invalid_type["params"]["function_id"] =
+ hmi_apis::FunctionID::eType::VR_IsReady;
+ }
+
+ void TearDown() OVERRIDE {
+ delete event_dispatcher_instance_;
+ delete event_;
+ }
+
+ void CheckRaiseEvent(const Event::EventID& event_id,
+ const uint32_t calls_number,
+ const smart_objects::SmartObject& so) {
+ // Arrange
+ event_dispatcher_instance_->add_observer(
+ event_id, correlation_id, event_observer_mock_);
+ event_->set_smart_object(so);
+ EXPECT_CALL(event_observer_mock_, on_event(_)).Times(calls_number);
+ event_dispatcher_instance_->raise_event(*event_);
+ }
+};
+
+TEST_F(EventEngineTest, EventObserverTest_ExpectObserversEmpty) {
+ // Arrange
+ EventObserver* event_observer_ptr =
+ static_cast<EventObserver*>(&event_observer_mock_);
+ // Check
+ EXPECT_EQ(reinterpret_cast<unsigned long>(event_observer_ptr),
+ event_observer_mock_.id());
+}
+
+TEST_F(EventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeResponse_ExpectEventRaised) {
+ CheckRaiseEvent(event_id3, 1u, smart_object_with_type_response);
+}
+
+TEST_F(
+ EventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeErrorResponse_ExpectEventRaised) {
+ CheckRaiseEvent(event_id3, 1u, smart_object_with_type_error_response);
+}
+
+TEST_F(EventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeInvalid_ExpectEventNotRaised) {
+ CheckRaiseEvent(event_id3, 0u, smart_object_with_invalid_type);
+}
+
+TEST_F(EventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeRequest_ExpectEventNotRaised) {
+ CheckRaiseEvent(event_id3, 0u, smart_object_with_type_request);
+}
+
+TEST_F(
+ EventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeNotification_ExpectEventNotRaised) {
+ CheckRaiseEvent(event_id3, 0u, smart_object_with_type_notification);
+}
+
+TEST_F(EventEngineTest, Event_set_smart_object_ExpectObjectSet) {
+ // Act
+ event_->set_smart_object(smart_object_with_type_notification);
+ const int32_t obj_type =
+ static_cast<int32_t>(hmi_apis::messageType::notification);
+ const int32_t function_id =
+ static_cast<int32_t>(hmi_apis::FunctionID::eType::VR_IsReady);
+ // Checks
+ EXPECT_EQ(obj_type, event_->smart_object_type());
+ EXPECT_EQ(function_id, event_->smart_object_function_id());
+ EXPECT_EQ(correlation_id, event_->smart_object_correlation_id());
+ EXPECT_EQ(smart_object_with_type_notification, event_->smart_object());
+}
+
+} // namespace event_engine
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
new file mode 100644
index 0000000000..c174dfcba4
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -0,0 +1,466 @@
+{
+ "UI":
+ {
+ "language":"EN_US",
+ "languages":[
+ "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
+"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO"
+ ],
+ "displayCapabilities":
+ {
+ "displayType":"GEN2_8_DMA",
+ "textFields": [{
+ "name": "mainField1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField4",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "statusBar",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaClock",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaTrack",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "scrollableMessageBody",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "initialInteractionText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "ETA",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "totalDistance",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderHeader",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderFooter",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "notificationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "secondaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "tertiaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "timeToDestination",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "turnText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuTitle",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ }
+ ],
+ "imageFields":
+ [
+ {
+ "name":"softButtonImage",
+ "imageTypeSupported":
+ [
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"choiceImage",
+ "imageTypeSupported":
+ [
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"choiceSecondaryImage",
+ "imageTypeSupported":
+ [
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"menuIcon",
+ "imageTypeSupported":
+ [
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"cmdIcon",
+ "imageTypeSupported":
+ [
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"appIcon",
+ "imageTypeSupported":
+ [
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"graphic",
+ "imageTypeSupported":
+ [
+
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ },
+ {
+ "name":"locationImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth":35,
+ "resolutionHeight":35
+ }
+ }
+
+ ],
+ "mediaClockFormats":
+ [
+ "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4"
+ ],
+ "graphicSupported":true,
+ "templatesAvailable":
+ [
+
+ "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD",
+ "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY",
+ "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
+ "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS",
+ "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS",
+ "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY"
+ ],
+ "screenParams":
+ {
+ "resolution":
+ {
+ "resolutionWidth":800,
+ "resolutionHeight":350
+ },
+ "touchEventAvailable":
+ {
+ "pressAvailable":true,
+ "multiTouchAvailable":false,
+ "doublePressAvailable":false
+ }
+ },
+ "numCustomPresetsAvailable":8,
+ "imageCapabilities":
+ [
+ "DYNAMIC",
+ "STATIC"
+ ]
+ },
+ "audioPassThruCapabilities":
+ {
+ "samplingRate" : "44KHZ",
+ "bitsPerSample" : "RATE_8_BIT",
+ "audioType" : "PCM"
+ },
+ "pcmStreamCapabilities":
+ {
+ "samplingRate" : "16KHZ",
+ "bitsPerSample" : "RATE_16_BIT",
+ "audioType" : "PCM"
+ },
+ "hmiZoneCapabilities":"FRONT",
+ "softButtonCapabilities":
+ [
+ {
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true,
+ "imageSupported" :true
+ }
+ ]
+ },
+ "VR":
+ {
+ "capabilities":["TEXT"],
+ "language":"ES_MX",
+ "languages":
+ [
+ "AR_SA", "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
+"JA_JP","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO"
+ ]
+},
+ "TTS":
+ {
+ "capabilities":"TEXT",
+ "language":"DE_DE",
+ "languages":
+ [
+ "DA_DK","CS_CZ","KO_KR","EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
+"JA_JP","AR_SA","PT_BR","NO_NO"
+ ]
+ },
+ "Buttons":
+ {
+ "capabilities":
+ [
+ {
+ "name":"PRESET_0",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_1",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_2",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_3",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_4",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_5",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_6",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_7",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_8",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"PRESET_9",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"OK",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"SEEKLEFT",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"SEEKRIGHT",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"TUNEUP",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
+ "name":"TUNEDOWN",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ }
+ ],
+ "presetBankCapabilities":
+ {
+ "onScreenPresetsAvailable":true
+ }
+ },
+ "VehicleInfo":
+ {
+ "make" :"Ford",
+ "model" :"Fiesta",
+ "modelYear" :"2013",
+ "trim" :"SE"
+ },
+ "SyncMessageVersion":
+ {
+ "majorVersion": 3,
+ "minorVersion": 0
+ }
+}
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
new file mode 100644
index 0000000000..1ed2123eba
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -0,0 +1,527 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/hmi_capabilities.h"
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/mock_message_helper.h"
+#include "smart_objects/enum_schema_item.h"
+#include "interfaces/HMI_API.h"
+#include "utils/make_shared.h"
+#include "application_manager/hmi_capabilities_for_testing.h"
+#include "utils/file_system.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/state_controller.h"
+#include "resumption/last_state.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+using ::testing::Invoke;
+using ::testing::InSequence;
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+using namespace application_manager;
+
+class HMICapabilitiesTest : public ::testing::Test {
+ protected:
+ HMICapabilitiesTest() : last_state_("app_storage_folder", "app_info_data") {}
+ virtual void SetUp() OVERRIDE {
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ hmi_capabilities_file_name()).WillOnce(ReturnRef(kFileName));
+ EXPECT_CALL(mock_event_dispatcher, add_observer(_, _, _)).Times(1);
+ EXPECT_CALL(mock_event_dispatcher, remove_observer(_)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings_, launch_hmi())
+ .WillOnce(Return(false));
+ hmi_capabilities_test =
+ utils::MakeShared<HMICapabilitiesForTesting>(app_mngr_);
+ hmi_capabilities_test->Init(&last_state_);
+ }
+
+ void TearDown() OVERRIDE {
+ hmi_capabilities_test.reset();
+ }
+ static void TearDownTestCase() {
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+ }
+
+ void SetCooperating();
+ MockApplicationManager app_mngr_;
+ event_engine_test::MockEventDispatcher mock_event_dispatcher;
+ resumption::LastState last_state_;
+ MockApplicationManagerSettings mock_application_manager_settings_;
+ utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities_test;
+ const std::string kFileName = "hmi_capabilities.json";
+};
+
+const char* const cstring_values_[] = {
+ "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR",
+ "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "EN_AU", "ZH_CN",
+ "ZH_TW", "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO",
+ "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK"};
+
+const hmi_apis::Common_Language::eType enum_values_[] = {
+ hmi_apis::Common_Language::EN_US, hmi_apis::Common_Language::ES_MX,
+ hmi_apis::Common_Language::FR_CA, hmi_apis::Common_Language::DE_DE,
+ hmi_apis::Common_Language::ES_ES, hmi_apis::Common_Language::EN_GB,
+ hmi_apis::Common_Language::RU_RU, hmi_apis::Common_Language::TR_TR,
+ hmi_apis::Common_Language::PL_PL, hmi_apis::Common_Language::FR_FR,
+ hmi_apis::Common_Language::IT_IT, hmi_apis::Common_Language::SV_SE,
+ hmi_apis::Common_Language::PT_PT, hmi_apis::Common_Language::NL_NL,
+ hmi_apis::Common_Language::EN_AU, hmi_apis::Common_Language::ZH_CN,
+ hmi_apis::Common_Language::ZH_TW, hmi_apis::Common_Language::JA_JP,
+ hmi_apis::Common_Language::AR_SA, hmi_apis::Common_Language::KO_KR,
+ hmi_apis::Common_Language::PT_BR, hmi_apis::Common_Language::CS_CZ,
+ hmi_apis::Common_Language::DA_DK, hmi_apis::Common_Language::NO_NO,
+ hmi_apis::Common_Language::NL_BE, hmi_apis::Common_Language::EL_GR,
+ hmi_apis::Common_Language::HU_HU, hmi_apis::Common_Language::FI_FI,
+ hmi_apis::Common_Language::SK_SK};
+
+struct CStringComparator {
+ bool operator()(const char* a, const char* b) {
+ return strcmp(a, b) < 0;
+ }
+};
+
+typedef std::map<const char*,
+ hmi_apis::Common_Language::eType,
+ CStringComparator> CStringToEnumMap;
+
+CStringToEnumMap InitCStringToEnumMap() {
+ size_t value = sizeof(cstring_values_) / sizeof(cstring_values_[0]);
+ CStringToEnumMap result;
+ for (size_t i = 0; i < value; ++i) {
+ result[cstring_values_[i]] = enum_values_[i];
+ }
+ return result;
+}
+
+bool StringToEnum(const char* str, hmi_apis::Common_Language::eType& value) {
+ size_t count_value = sizeof(cstring_values_) / sizeof(cstring_values_[0]);
+ CStringToEnumMap result;
+ for (size_t i = 0; i < count_value; ++i) {
+ result[cstring_values_[i]] = enum_values_[i];
+ }
+
+ CStringToEnumMap::const_iterator it = result.find(str);
+ if (it == result.end()) {
+ return false;
+ }
+ value = it->second;
+ return true;
+}
+
+hmi_apis::Common_Language::eType TestCommonLanguageFromString(
+ const std::string& language) {
+ hmi_apis::Common_Language::eType value;
+ if (StringToEnum(language.c_str(), value)) {
+ return value;
+ }
+ return hmi_apis::Common_Language::INVALID_ENUM;
+}
+
+TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
+ const std::string hmi_capabilities_file = "hmi_capabilities.json";
+ EXPECT_CALL(mock_application_manager_settings_, hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(hmi_capabilities_file));
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CommonLanguageFromString(_))
+ .WillRepeatedly(Invoke(TestCommonLanguageFromString));
+
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+ EXPECT_TRUE(hmi_capabilities_test->LoadCapabilitiesFromFile());
+
+ // Check active languages
+ EXPECT_EQ(hmi_apis::Common_Language::EN_US,
+ hmi_capabilities_test->active_ui_language());
+ EXPECT_EQ(hmi_apis::Common_Language::ES_MX,
+ hmi_capabilities_test->active_vr_language());
+ EXPECT_EQ(hmi_apis::Common_Language::DE_DE,
+ hmi_capabilities_test->active_tts_language());
+
+ // Check UI languages
+ const smart_objects::SmartObject ui_supported_languages =
+ *(hmi_capabilities_test->ui_supported_languages());
+
+ EXPECT_EQ(hmi_apis::Common_Language::EN_US,
+ static_cast<hmi_apis::Common_Language::eType>(
+ ui_supported_languages[0].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::ES_MX,
+ static_cast<hmi_apis::Common_Language::eType>(
+ ui_supported_languages[1].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::FR_CA,
+ static_cast<hmi_apis::Common_Language::eType>(
+ ui_supported_languages[2].asInt()));
+
+ // Check VR languages
+ const smart_objects::SmartObject vr_supported_languages =
+ *(hmi_capabilities_test->vr_supported_languages());
+
+ EXPECT_EQ(hmi_apis::Common_Language::AR_SA,
+ static_cast<hmi_apis::Common_Language::eType>(
+ vr_supported_languages[0].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::EN_US,
+ static_cast<hmi_apis::Common_Language::eType>(
+ vr_supported_languages[1].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::ES_MX,
+ static_cast<hmi_apis::Common_Language::eType>(
+ vr_supported_languages[2].asInt()));
+
+ // Check TTS languages
+ const smart_objects::SmartObject tts_supported_languages =
+ *(hmi_capabilities_test->tts_supported_languages());
+
+ EXPECT_EQ(hmi_apis::Common_Language::DA_DK,
+ static_cast<hmi_apis::Common_Language::eType>(
+ tts_supported_languages[0].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::CS_CZ,
+ static_cast<hmi_apis::Common_Language::eType>(
+ tts_supported_languages[1].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::KO_KR,
+ static_cast<hmi_apis::Common_Language::eType>(
+ tts_supported_languages[2].asInt()));
+
+ // Check button capabilities
+ const smart_objects::SmartObject buttons_capabilities_so =
+ *(hmi_capabilities_test->button_capabilities());
+
+ // Count of buttons in json file
+ const uint32_t btn_length = buttons_capabilities_so.length();
+ EXPECT_EQ(15u, btn_length);
+ for (uint32_t i = 0; i < btn_length; ++i) {
+ EXPECT_TRUE((buttons_capabilities_so[i]).keyExists(strings::name));
+ EXPECT_TRUE((buttons_capabilities_so[i]).keyExists("shortPressAvailable"));
+ EXPECT_TRUE((buttons_capabilities_so[i]).keyExists("longPressAvailable"));
+ EXPECT_TRUE((buttons_capabilities_so[i]).keyExists("upDownAvailable"));
+ EXPECT_TRUE(buttons_capabilities_so[i]["shortPressAvailable"].asBool());
+ EXPECT_TRUE(buttons_capabilities_so[i]["longPressAvailable"].asBool());
+ EXPECT_TRUE(buttons_capabilities_so[i]["upDownAvailable"].asBool());
+ }
+ const smart_objects::SmartObject display_capabilities_so =
+ *(hmi_capabilities_test->display_capabilities());
+
+ // Check display type
+ EXPECT_EQ(hmi_apis::Common_DisplayType::GEN2_8_DMA,
+ static_cast<hmi_apis::Common_DisplayType::eType>(
+ display_capabilities_so[hmi_response::display_type].asInt()));
+
+ EXPECT_TRUE(display_capabilities_so["graphicSupported"].asBool());
+
+ // Check text fields
+ const uint32_t text_len =
+ display_capabilities_so[hmi_response::text_fields].length();
+ EXPECT_NE(0u, text_len);
+ for (uint32_t i = 0; i < text_len; ++i) {
+ EXPECT_TRUE((display_capabilities_so[hmi_response::text_fields][i])
+ .keyExists(strings::name));
+ EXPECT_TRUE((display_capabilities_so[hmi_response::text_fields][i])
+ .keyExists(strings::character_set));
+ }
+
+ // Check image fields
+ EXPECT_TRUE((display_capabilities_so).keyExists(hmi_response::image_fields));
+ const uint32_t img_len =
+ display_capabilities_so[hmi_response::image_fields].length();
+ EXPECT_NE(0u, img_len);
+ for (uint32_t i = 0; i < img_len; ++i) {
+ EXPECT_TRUE((display_capabilities_so[hmi_response::image_fields][i])
+ .keyExists(strings::name));
+ EXPECT_TRUE((display_capabilities_so[hmi_response::image_fields][i])
+ .keyExists(strings::image_type_supported));
+ if (display_capabilities_so[hmi_response::image_fields][i][strings::name] ==
+ hmi_apis::Common_ImageFieldName::locationImage) {
+ EXPECT_EQ(hmi_apis::Common_FileType::GRAPHIC_PNG,
+ static_cast<hmi_apis::Common_FileType::eType>(
+ display_capabilities_so[hmi_response::image_fields][i]
+ [strings::image_type_supported][0]
+ .asInt()));
+ }
+ }
+
+ // Check media clock formats
+ EXPECT_TRUE(
+ (display_capabilities_so).keyExists(hmi_response::media_clock_formats));
+ const uint32_t media_length =
+ display_capabilities_so[hmi_response::media_clock_formats].length();
+ EXPECT_NE(0u, media_length);
+ for (uint32_t i = 0; i < media_length; ++i) {
+ EXPECT_EQ(
+ i,
+ display_capabilities_so[hmi_response::media_clock_formats][i].asUInt());
+ }
+
+ EXPECT_TRUE(
+ (display_capabilities_so).keyExists(hmi_response::image_capabilities));
+ EXPECT_EQ(hmi_apis::Common_ImageType::DYNAMIC,
+ static_cast<hmi_apis::Common_ImageType::eType>(
+ display_capabilities_so[hmi_response::image_capabilities][0]
+ .asInt()));
+ EXPECT_EQ(hmi_apis::Common_ImageType::STATIC,
+ static_cast<hmi_apis::Common_ImageType::eType>(
+ display_capabilities_so[hmi_response::image_capabilities][1]
+ .asInt()));
+
+ // Check audio pass thru
+ const smart_objects::SmartObject audio_pass_thru_capabilities_so =
+ *(hmi_capabilities_test->audio_pass_thru_capabilities());
+ EXPECT_EQ(hmi_apis::Common_SamplingRate::RATE_44KHZ,
+ static_cast<hmi_apis::Common_SamplingRate::eType>(
+ audio_pass_thru_capabilities_so["samplingRate"].asInt()));
+ EXPECT_EQ(hmi_apis::Common_BitsPerSample::RATE_8_BIT,
+ static_cast<hmi_apis::Common_BitsPerSample::eType>(
+ audio_pass_thru_capabilities_so["bitsPerSample"].asInt()));
+ EXPECT_EQ(hmi_apis::Common_AudioType::PCM,
+ static_cast<hmi_apis::Common_AudioType::eType>(
+ audio_pass_thru_capabilities_so["audioType"].asInt()));
+
+ // Check hmi zone capabilities
+ const smart_objects::SmartObject hmi_zone_capabilities_so =
+ *(hmi_capabilities_test->hmi_zone_capabilities());
+ EXPECT_EQ(hmi_apis::Common_HmiZoneCapabilities::FRONT,
+ static_cast<hmi_apis::Common_HmiZoneCapabilities::eType>(
+ hmi_zone_capabilities_so.asInt()));
+
+ const smart_objects::SmartObject soft_button_capabilities_so =
+ *(hmi_capabilities_test->soft_button_capabilities());
+
+ EXPECT_TRUE(soft_button_capabilities_so[0]["shortPressAvailable"].asBool());
+ EXPECT_TRUE(soft_button_capabilities_so[0]["longPressAvailable"].asBool());
+ EXPECT_TRUE(soft_button_capabilities_so[0]["upDownAvailable"].asBool());
+ EXPECT_TRUE(soft_button_capabilities_so[0]["imageSupported"].asBool());
+
+ const smart_objects::SmartObject preset_bank_so =
+ *(hmi_capabilities_test->preset_bank_capabilities());
+ EXPECT_TRUE(preset_bank_so["onScreenPresetsAvailable"].asBool());
+
+ // Check vehicle type
+ const smart_objects::SmartObject vehicle_type_so =
+ *(hmi_capabilities_test->vehicle_type());
+ EXPECT_TRUE(preset_bank_so["onScreenPresetsAvailable"].asBool());
+
+ EXPECT_EQ("Ford", vehicle_type_so["make"].asString());
+ EXPECT_EQ("Fiesta", vehicle_type_so["model"].asString());
+ EXPECT_EQ("2013", vehicle_type_so["modelYear"].asString());
+ EXPECT_EQ("SE", vehicle_type_so["trim"].asString());
+}
+
+TEST_F(HMICapabilitiesTest, ConvertJsonLanguagesToObj) {
+ Json::Value json_languages(Json::arrayValue);
+ json_languages[0] = "EN_US";
+ json_languages[1] = "ES_MX";
+ smart_objects::SmartObject sm_obj =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CommonLanguageFromString(json_languages[0].asString()))
+ .WillOnce(Return(hmi_apis::Common_Language::EN_US));
+
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CommonLanguageFromString(json_languages[1].asString()))
+ .WillOnce(Return(hmi_apis::Common_Language::ES_MX));
+
+ hmi_capabilities_test->ConvertJsonLanguagesToObj(json_languages, sm_obj);
+
+ EXPECT_EQ(hmi_apis::Common_Language::EN_US,
+ static_cast<hmi_apis::Common_Language::eType>(sm_obj[0].asInt()));
+ EXPECT_EQ(hmi_apis::Common_Language::ES_MX,
+ static_cast<hmi_apis::Common_Language::eType>(sm_obj[1].asInt()));
+}
+
+TEST_F(HMICapabilitiesTest,
+ HmiCapabilitiesInitialized_UiVrTtsIviNotCooperating) {
+ // Precondition
+ hmi_capabilities_test->set_is_vr_cooperating(false);
+ hmi_capabilities_test->set_is_tts_cooperating(false);
+
+ hmi_capabilities_test->set_is_ui_cooperating(false);
+ hmi_capabilities_test->set_is_navi_cooperating(false);
+ hmi_capabilities_test->set_is_ivi_cooperating(false);
+ EXPECT_TRUE(hmi_capabilities_test->is_hmi_capabilities_initialized());
+}
+
+TEST_F(HMICapabilitiesTest, HmiCapabilitiesInitialized) {
+ // Precondition
+ SetCooperating();
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(_, _)).WillRepeatedly(Return(language));
+
+ hmi_capabilities_test->set_is_vr_cooperating(true);
+ smart_objects::SmartObject supported_languages;
+ supported_languages[0] = "EN_US";
+ hmi_capabilities_test->set_vr_supported_languages(supported_languages);
+ hmi_capabilities_test->set_tts_supported_languages(supported_languages);
+ hmi_capabilities_test->set_ui_supported_languages(supported_languages);
+ hmi_capabilities_test->set_vehicle_type(supported_languages);
+
+ hmi_capabilities_test->set_is_tts_cooperating(true);
+ hmi_capabilities_test->set_is_ui_cooperating(true);
+ hmi_capabilities_test->set_is_navi_cooperating(true);
+ hmi_capabilities_test->set_is_ivi_cooperating(true);
+
+ hmi_capabilities_test->set_active_vr_language(
+ hmi_apis::Common_Language::EN_US);
+ SetCooperating();
+ hmi_capabilities_test->set_active_tts_language(
+ hmi_apis::Common_Language::EN_US);
+ SetCooperating();
+ hmi_capabilities_test->set_active_ui_language(
+ hmi_apis::Common_Language::EN_US);
+
+ EXPECT_TRUE(hmi_capabilities_test->is_hmi_capabilities_initialized());
+}
+
+TEST_F(HMICapabilitiesTest, VerifyImageType) {
+ const int32_t image_type = 1;
+ smart_objects::SmartObject sm_obj;
+ sm_obj[hmi_response::image_capabilities][0] = image_type;
+ hmi_capabilities_test->set_display_capabilities(sm_obj);
+
+ EXPECT_TRUE(hmi_capabilities_test->VerifyImageType(image_type));
+
+ const int32_t new_image_type = 2;
+ EXPECT_FALSE(hmi_capabilities_test->VerifyImageType(new_image_type));
+}
+
+void HMICapabilitiesTest::SetCooperating() {
+ smart_objects::SmartObjectSPtr test_so;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(_, _)).WillRepeatedly(Return(test_so));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true));
+}
+
+TEST_F(HMICapabilitiesTest, SetVRCooperating) {
+ // Without sequence it is impossible to check correct call of ManageHMICommand
+ InSequence dummy;
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
+ .WillOnce(Return(language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(language));
+
+ smart_objects::SmartObjectSPtr support_language;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages,
+ _)).WillOnce(Return(support_language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
+
+ smart_objects::SmartObjectSPtr capabilities;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
+
+ hmi_capabilities_test->set_is_vr_cooperating(true);
+}
+
+TEST_F(HMICapabilitiesTest, SetTTSCooperating) {
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ InSequence dummy;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage, _))
+ .WillOnce(Return(language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(language));
+
+ smart_objects::SmartObjectSPtr support_language;
+ EXPECT_CALL(
+ *(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetSupportedLanguages, _))
+ .WillOnce(Return(support_language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
+
+ smart_objects::SmartObjectSPtr capabilities;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
+
+ hmi_capabilities_test->set_is_tts_cooperating(true);
+}
+
+TEST_F(HMICapabilitiesTest, SetUICooperating) {
+ InSequence dummy;
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _))
+ .WillOnce(Return(language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(language));
+
+ smart_objects::SmartObjectSPtr support_language;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages,
+ _)).WillOnce(Return(support_language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
+
+ smart_objects::SmartObjectSPtr capabilities;
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
+
+ hmi_capabilities_test->set_is_ui_cooperating(true);
+}
+
+TEST_F(HMICapabilitiesTest, SetIviCooperating) {
+ smart_objects::SmartObjectSPtr ivi_type;
+ EXPECT_CALL(
+ *(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
+ .WillOnce(Return(ivi_type));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(ivi_type));
+
+ hmi_capabilities_test->set_is_ivi_cooperating(true);
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/state_controller/include/application_manager_mock.h b/src/components/application_manager/test/include/application_manager/application_manager_mock.h
index 22ff93687a..35f5f4dbdb 100644
--- a/src/components/application_manager/test/state_controller/include/application_manager_mock.h
+++ b/src/components/application_manager/test/include/application_manager/application_manager_mock.h
@@ -37,13 +37,18 @@
#include "gmock/gmock.h"
#include "application_manager/application_manager.h"
#include "application_manager/usage_statistics.h"
-
+#include "application_manager/commands/command.h"
+#include "media_manager/media_manager.h"
+#include "resumption/last_state.h"
+#include "application_manager/policies/policy_handler.h"
+namespace test {
+namespace components {
namespace state_controller_test {
namespace am = application_manager;
class ApplicationManagerMock : public application_manager::ApplicationManager {
public:
- MOCK_METHOD0(Init, bool());
+ MOCK_METHOD1(Init, bool(resumption::LastState& last_state));
MOCK_METHOD0(Stop, bool());
MOCK_METHOD1(set_hmi_message_handler,
@@ -52,10 +57,9 @@ class ApplicationManagerMock : public application_manager::ApplicationManager {
MOCK_METHOD1(set_connection_handler,
void(connection_handler::ConnectionHandler*));
MOCK_CONST_METHOD0(applications, DataAccessor<am::ApplicationSet>());
+ MOCK_CONST_METHOD1(application, am::ApplicationSharedPtr(uint32_t app_id));
MOCK_CONST_METHOD1(application_by_hmi_app,
am::ApplicationSharedPtr(uint32_t));
- MOCK_CONST_METHOD1(application, am::ApplicationSharedPtr(uint32_t));
-
MOCK_CONST_METHOD0(active_application, am::ApplicationSharedPtr());
MOCK_CONST_METHOD1(application_by_policy_id,
am::ApplicationSharedPtr(const std::string&));
@@ -65,16 +69,44 @@ class ApplicationManagerMock : public application_manager::ApplicationManager {
MOCK_CONST_METHOD0(get_limited_media_application, am::ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_navi_application, am::ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_voice_application, am::ApplicationSharedPtr());
+ MOCK_METHOD1(application_id, const uint32_t(const int32_t));
MOCK_METHOD2(set_application_id, void(const int32_t, const uint32_t));
- MOCK_METHOD1(application_id, uint32_t(const int32_t));
- MOCK_METHOD3(OnHMILevelChanged, void(uint32_t, mobile_apis::HMILevel::eType,
- mobile_apis::HMILevel::eType));
+ MOCK_METHOD3(OnHMILevelChanged,
+ void(uint32_t,
+ mobile_apis::HMILevel::eType,
+ mobile_apis::HMILevel::eType));
MOCK_METHOD1(SendHMIStatusNotification, void(const am::ApplicationSharedPtr));
- MOCK_CONST_METHOD1(GetDefaultHmiLevel, mobile_apis::HMILevel::eType(
- am::ApplicationConstSharedPtr));
+ MOCK_CONST_METHOD1(
+ GetDefaultHmiLevel,
+ mobile_apis::HMILevel::eType(am::ApplicationConstSharedPtr));
MOCK_METHOD0(hmi_capabilities, am::HMICapabilities&());
MOCK_METHOD0(is_attenuated_supported, bool());
- MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited, bool(am::ApplicationConstSharedPtr));
+ MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
+ bool(am::ApplicationConstSharedPtr));
+ MOCK_METHOD1(OnApplicationRegistered, void(am::ApplicationSharedPtr));
+ MOCK_METHOD2(SendMessageToMobile,
+ void(const smart_objects::SmartObjectSPtr message,
+ bool final_message));
+ MOCK_METHOD1(SendMessageToMobile,
+ void(const smart_objects::SmartObjectSPtr message));
+ MOCK_METHOD1(SendMessageToHMI,
+ void(const smart_objects::SmartObjectSPtr message));
+ MOCK_METHOD2(ManageMobileCommand,
+ bool(const smart_objects::SmartObjectSPtr message,
+ am::commands::Command::CommandOrigin origin));
+ MOCK_METHOD1(ManageHMICommand,
+ bool(const smart_objects::SmartObjectSPtr message));
+ MOCK_CONST_METHOD2(CanAppStream,
+ bool(uint32_t app_id,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
+ MOCK_METHOD2(SendAudioPassThroughNotification,
+ void(uint32_t session_key, std::vector<uint8_t>& binary_data));
+ MOCK_CONST_METHOD0(connection_handler,
+ connection_handler::ConnectionHandler&());
};
} // namespace state_controller_test
+} // namespace components
+} // namespace test
+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MANAGER_MOCK_H_
diff --git a/src/components/application_manager/test/state_controller/include/application_mock.h b/src/components/application_manager/test/include/application_manager/application_mock.h
index 01dafd10f4..9896ecfdd4 100644
--- a/src/components/application_manager/test/state_controller/include/application_mock.h
+++ b/src/components/application_manager/test/include/application_manager/application_mock.h
@@ -37,120 +37,22 @@
#include "gmock/gmock.h"
#include "application_manager/application.h"
+
+namespace test {
+namespace components {
namespace state_controller_test {
-namespace am = application_manager;
-class ApplicationMock : public am::Application {
- public:
- MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(curHash, const std::string&());
- MOCK_METHOD0(UpdateHash, void());
- MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
- MOCK_METHOD1(set_flag_sending_hash_change_after_awake, void(bool flag));
- MOCK_CONST_METHOD0(is_application_data_changed, bool());
- MOCK_METHOD1(set_is_application_data_changed,
- void(bool state_application_data));
- MOCK_METHOD0(CloseActiveMessage, void());
- MOCK_CONST_METHOD0(IsFullscreen, bool());
- MOCK_METHOD0(ChangeSupportingAppHMIType, void());
- MOCK_CONST_METHOD0(is_navi, bool());
- MOCK_METHOD1(set_is_navi, void(bool allow));
- MOCK_CONST_METHOD0(video_streaming_approved, bool());
- MOCK_METHOD1(set_video_streaming_approved, void(bool state));
- MOCK_CONST_METHOD0(audio_streaming_approved, bool());
- MOCK_METHOD1(set_audio_streaming_approved, void(bool state));
- MOCK_CONST_METHOD0(video_streaming_allowed, bool());
- MOCK_METHOD1(set_video_streaming_allowed, void(bool state));
- MOCK_CONST_METHOD0(audio_streaming_allowed, bool());
- MOCK_METHOD1(set_audio_streaming_allowed, void(bool state));
- MOCK_METHOD1(StartStreaming,
- void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(SuspendStreaming,
- void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(WakeUpStreaming,
- void(protocol_handler::ServiceType service_type));
- MOCK_CONST_METHOD0(is_voice_communication_supported, bool());
- MOCK_METHOD1(set_voice_communication_supported,
- void(bool is_voice_communication_supported));
- MOCK_CONST_METHOD0(app_allowed, bool());
- MOCK_CONST_METHOD0(has_been_activated, bool());
- MOCK_METHOD1(set_activated, bool(bool is_active));
- MOCK_CONST_METHOD0(version, const am::Version&());
- MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
+namespace am = application_manager;
- MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
- MOCK_CONST_METHOD0(name, const std::string&());
- MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
- MOCK_CONST_METHOD0(folder_name, const std::string());
- MOCK_CONST_METHOD0(is_media_application, bool());
- MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType());
- MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
- MOCK_CONST_METHOD0(audio_streaming_state,
- const mobile_apis::AudioStreamingState::eType());
- MOCK_CONST_METHOD0(app_icon_path, const std::string&());
- MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
- MOCK_METHOD0(tts_speak_state, bool());
- MOCK_CONST_METHOD0(CurrentHmiState, am::HmiStatePtr());
- MOCK_CONST_METHOD0(RegularHmiState, am::HmiStatePtr());
- MOCK_CONST_METHOD0(PostponedHmiState, am::HmiStatePtr());
- MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
- MOCK_METHOD0(tts_properties_in_none, bool());
- MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
- MOCK_METHOD0(tts_properties_in_full, bool());
- MOCK_METHOD1(set_version, void(const am::Version& version));
- MOCK_METHOD1(set_name, void(const std::string& name));
- MOCK_METHOD1(set_is_media_application, void(bool is_media));
- MOCK_METHOD0(increment_put_file_in_none_count, void());
- MOCK_METHOD0(increment_delete_file_in_none_count, void());
- MOCK_METHOD0(increment_list_files_in_none_count, void());
- MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
- MOCK_METHOD1(set_app_allowed, void(const bool& allowed));
- MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
- MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
- MOCK_METHOD1(set_grammar_id, void(uint32_t value));
- MOCK_METHOD1(set_protocol_version,
- void(const am::ProtocolVersion& protocol_version));
- MOCK_CONST_METHOD0(protocol_version, am::ProtocolVersion());
- MOCK_METHOD1(set_is_resuming, void(bool));
- MOCK_CONST_METHOD0(is_resuming, bool());
- MOCK_METHOD1(AddFile, bool(const am::AppFile& file));
- MOCK_CONST_METHOD0(getAppFiles, const am::AppFilesMap&());
- MOCK_METHOD1(UpdateFile, bool(const am::AppFile& file));
- MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
- MOCK_METHOD1(GetFile, const am::AppFile*(const std::string& file_name));
- MOCK_METHOD1(SubscribeToButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(IsSubscribedToButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(UnsubscribeFromButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type));
- MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type));
- MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type));
- MOCK_METHOD0(ResetDataInNone, void());
- MOCK_METHOD2(IsCommandLimitsExceeded,
- bool(mobile_apis::FunctionID::eType cmd_id,
- am::TLimitSource source));
- MOCK_METHOD0(usage_report, am::UsageStatistics&());
- MOCK_METHOD1(SetRegularState, void(am::HmiStatePtr state));
- MOCK_METHOD1(SetPostponedState, void(am::HmiStatePtr state));
- MOCK_METHOD1(AddHMIState, void(am::HmiStatePtr state));
- MOCK_METHOD1(RemoveHMIState, void(am::HmiState::StateID state_id));
- MOCK_METHOD2(SubscribeToSoftButtons,
- void(int32_t cmd_id, const am::SoftButtonID& softbuttons_id));
- MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
- MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
- MOCK_CONST_METHOD0(IsAudioApplication, bool());
- MOCK_METHOD0(LoadPersistentFiles, void());
+namespace custom_str = utils::custom_string;
- // InitialApplicationData methods
+class MockApplication : public application_manager::Application {
+ public:
+ // InitialApplicationData
MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(policy_app_id, std::string());
+ MOCK_CONST_METHOD0(mac_address, const std::string&());
+ MOCK_CONST_METHOD0(mobile_app_id, std::string());
MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(ngn_media_screen_name,
const smart_objects::SmartObject*());
@@ -160,7 +62,7 @@ class ApplicationMock : public am::Application {
void(const smart_objects::SmartObject& app_types));
MOCK_METHOD1(set_vr_synonyms,
void(const smart_objects::SmartObject& vr_synonyms));
- MOCK_METHOD1(set_policy_app_id, void(const std::string& policy_app_id));
+ MOCK_METHOD1(set_mobile_app_id, void(const std::string& mobile_app_id));
MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name));
MOCK_METHOD1(set_ngn_media_screen_name,
void(const smart_objects::SmartObject& ngn_name));
@@ -169,7 +71,7 @@ class ApplicationMock : public am::Application {
MOCK_METHOD1(set_ui_language,
void(const mobile_apis::Language::eType& ui_language));
- // DynamicApplicationData methods
+ // DynamicApplicationData
MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*());
@@ -178,9 +80,10 @@ class ApplicationMock : public am::Application {
MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(SubscribedButtons,
- DataAccessor<am::ButtonSubscriptions>());
- MOCK_CONST_METHOD0(SubscribedIVI,
- DataAccessor<am::VehicleInfoSubscriptions>());
+ DataAccessor<application_manager::ButtonSubscriptions>());
+ MOCK_CONST_METHOD0(
+ SubscribedIVI,
+ DataAccessor<application_manager::VehicleInfoSubscriptions>());
MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
@@ -213,8 +116,9 @@ class ApplicationMock : public am::Application {
MOCK_CONST_METHOD0(video_stream_retry_number, uint32_t());
MOCK_METHOD1(set_video_stream_retry_number,
void(const uint32_t& video_stream_retry_number));
- MOCK_METHOD2(AddCommand, void(uint32_t cmd_id,
- const smart_objects::SmartObject& command));
+ MOCK_METHOD2(AddCommand,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command));
MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id));
MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id));
MOCK_METHOD2(AddSubMenu,
@@ -230,23 +134,147 @@ class ApplicationMock : public am::Application {
MOCK_METHOD1(FindChoiceSet,
smart_objects::SmartObject*(uint32_t choice_set_id));
MOCK_METHOD3(AddPerformInteractionChoiceSet,
- void(uint32_t correlation_id, uint32_t choice_set_id,
+ void(uint32_t correlation_id,
+ uint32_t choice_set_id,
const smart_objects::SmartObject& choice_set));
MOCK_METHOD1(DeletePerformInteractionChoiceSet,
void(uint32_t correlation_id));
MOCK_CONST_METHOD0(performinteraction_choice_set_map,
- DataAccessor<am::PerformChoiceSetMap>());
- MOCK_CONST_METHOD0(commands_map, DataAccessor<am::CommandsMap>());
- MOCK_CONST_METHOD0(sub_menu_map, DataAccessor<am::SubMenuMap>());
- MOCK_CONST_METHOD0(choice_set_map, DataAccessor<am::ChoiceSetMap>());
+ DataAccessor<application_manager::PerformChoiceSetMap>());
+ MOCK_CONST_METHOD0(commands_map,
+ DataAccessor<application_manager::CommandsMap>());
+ MOCK_CONST_METHOD0(sub_menu_map,
+ DataAccessor<application_manager::SubMenuMap>());
+ MOCK_CONST_METHOD0(choice_set_map,
+ DataAccessor<application_manager::ChoiceSetMap>());
MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active));
MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t());
+ MOCK_METHOD1(set_perform_interaction_layout,
+ void(mobile_apis::LayoutMode::eType layout));
+ MOCK_CONST_METHOD0(perform_interaction_layout,
+ mobile_apis::LayoutMode::eType());
MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode));
MOCK_CONST_METHOD0(perform_interaction_mode, int32_t());
MOCK_METHOD1(set_reset_global_properties_active, void(bool active));
MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
+ // Application
+
+ MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(curHash, const std::string&());
+ MOCK_METHOD0(UpdateHash, void());
+ MOCK_CONST_METHOD0(is_application_data_changed, bool());
+ MOCK_METHOD1(set_is_application_data_changed,
+ void(bool state_application_data));
+ MOCK_METHOD0(CloseActiveMessage, void());
+ MOCK_CONST_METHOD0(IsFullscreen, bool());
+ MOCK_METHOD0(ChangeSupportingAppHMIType, void());
+ MOCK_CONST_METHOD0(is_navi, bool());
+ MOCK_METHOD1(set_is_navi, void(bool allow));
+ MOCK_CONST_METHOD0(video_streaming_approved, bool());
+ MOCK_METHOD1(set_video_streaming_approved, void(bool state));
+ MOCK_CONST_METHOD0(audio_streaming_approved, bool());
+ MOCK_METHOD1(set_audio_streaming_approved, void(bool state));
+ MOCK_CONST_METHOD0(video_streaming_allowed, bool());
+ MOCK_METHOD1(set_video_streaming_allowed, void(bool state));
+ MOCK_CONST_METHOD0(audio_streaming_allowed, bool());
+ MOCK_METHOD1(set_audio_streaming_allowed, void(bool state));
+ MOCK_METHOD1(StartStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreamingForce,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(SuspendStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(WakeUpStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_CONST_METHOD0(is_voice_communication_supported, bool());
+ MOCK_METHOD1(set_voice_communication_supported,
+ void(bool is_voice_communication_supported));
+ MOCK_CONST_METHOD0(app_allowed, bool());
+ MOCK_CONST_METHOD0(has_been_activated, bool());
+ MOCK_METHOD1(set_activated, bool(bool is_active));
+ MOCK_CONST_METHOD0(version, const application_manager::Version&());
+ MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
+ MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
MOCK_CONST_METHOD0(app_id, uint32_t());
+ MOCK_CONST_METHOD0(name, const custom_str::CustomString&());
+ MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
+ MOCK_CONST_METHOD0(folder_name, const std::string());
+ MOCK_CONST_METHOD0(is_media_application, bool());
+ MOCK_CONST_METHOD0(is_foreground, bool());
+ MOCK_METHOD1(set_foreground, void(bool is_foreground));
+ MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType());
+ MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
+ MOCK_CONST_METHOD0(audio_streaming_state,
+ const mobile_apis::AudioStreamingState::eType());
+ MOCK_CONST_METHOD0(app_icon_path, const std::string&());
+ MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
+ MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
+ MOCK_METHOD0(tts_properties_in_none, bool());
+ MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
+ MOCK_METHOD0(tts_properties_in_full, bool());
+ MOCK_METHOD1(set_version, void(const application_manager::Version& version));
+ MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
+ MOCK_METHOD1(set_is_media_application, void(bool is_media));
+ MOCK_METHOD0(increment_put_file_in_none_count, void());
+ MOCK_METHOD0(increment_delete_file_in_none_count, void());
+ MOCK_METHOD0(increment_list_files_in_none_count, void());
+ MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
+ MOCK_METHOD1(set_app_allowed, void(const bool allowed));
+ MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
+ MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
+ MOCK_METHOD1(set_grammar_id, void(uint32_t value));
+ MOCK_METHOD1(
+ set_protocol_version,
+ void(const application_manager::ProtocolVersion& protocol_version));
+ MOCK_CONST_METHOD0(protocol_version, application_manager::ProtocolVersion());
+ MOCK_METHOD1(set_is_resuming, void(bool is_resuming));
+ MOCK_CONST_METHOD0(is_resuming, bool());
+ MOCK_METHOD1(AddFile, bool(const application_manager::AppFile& file));
+ MOCK_CONST_METHOD0(getAppFiles, const application_manager::AppFilesMap&());
+ MOCK_METHOD1(UpdateFile, bool(const application_manager::AppFile& file));
+ MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
+ MOCK_METHOD1(
+ GetFile,
+ const application_manager::AppFile*(const std::string& file_name));
+ MOCK_METHOD1(SubscribeToButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(IsSubscribedToButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(UnsubscribeFromButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type));
+ MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type));
+ MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type));
+ MOCK_METHOD0(ResetDataInNone, void());
+ MOCK_METHOD2(IsCommandLimitsExceeded,
+ bool(mobile_apis::FunctionID::eType cmd_id,
+ application_manager::TLimitSource source));
+ MOCK_METHOD0(usage_report, application_manager::UsageStatistics&());
+ MOCK_METHOD1(SetRegularState, void(application_manager::HmiStatePtr state));
+ MOCK_METHOD1(SetPostponedState, void(application_manager::HmiStatePtr state));
+ MOCK_METHOD0(RemovePostponedState, void());
+ MOCK_METHOD1(AddHMIState, void(application_manager::HmiStatePtr state));
+ MOCK_METHOD1(RemoveHMIState,
+ void(application_manager::HmiState::StateID state_id));
+ MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(PostponedHmiState,
+ const application_manager::HmiStatePtr());
+ MOCK_METHOD2(SubscribeToSoftButtons,
+ void(int32_t cmd_id,
+ const application_manager::SoftButtonID& softbuttons_id));
+ MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
+ MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
+ MOCK_CONST_METHOD0(IsAudioApplication, bool());
+ MOCK_METHOD0(LoadPersistentFiles, void());
};
} // namespace state_controller_test
+} // namespace components
+} // namespace test
+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MOCK_H_
diff --git a/src/components/application_manager/test/state_controller/include/state_controller_mock.h b/src/components/application_manager/test/include/application_manager/event_observer_mock.h
index b9f7dd30dd..3d3d72c5ab 100644
--- a/src/components/application_manager/test/state_controller/include/state_controller_mock.h
+++ b/src/components/application_manager/test/include/application_manager/event_observer_mock.h
@@ -30,31 +30,29 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATE_CONTROLLER_MOCK
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATE_CONTROLLER_MOCK
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/event_engine/event.h"
#include "gmock/gmock.h"
-#include "application_manager/application.h"
-#include "application_manager/hmi_state.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/MOBILE_API.h"
-namespace state_controller_test {
-namespace am = application_manager;
+namespace test {
+namespace components {
+namespace event_engine_test {
-class StateControllerMock :public am::StateController {
+class MockEventObserver
+ : public application_manager::event_engine::EventObserver {
public:
- MOCK_METHOD2(SetRegularState, void (
- am::ApplicationSharedPtr, const mobile_apis::AudioStreamingState::eType));
- MOCK_METHOD2(SetRegularState, void (
- am::ApplicationSharedPtr, const mobile_apis::SystemContext::eType));
- MOCK_METHOD3(OnStateChanged, void (
- am::ApplicationSharedPtr, am::HmiStatePtr, am::HmiStatePtr));
- MOCK_METHOD1(ApplyStatesForApp, void (am::ApplicationSharedPtr));
- MOCK_METHOD0(OnNaviStreamingStarted, void ());
- MOCK_METHOD0(OnNaviStreamingStopped, void ());
+ MockEventObserver(
+ ::application_manager::event_engine::EventDispatcher& event_dispatcher)
+ : application_manager::event_engine::EventObserver(event_dispatcher) {}
+ MOCK_METHOD1(on_event,
+ void(const application_manager::event_engine::Event& event));
};
-}
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATE_CONTROLLER_MOCK
+} // namespace event_engine_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_
diff --git a/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h b/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h
new file mode 100644
index 0000000000..ec8e92e859
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_FOR_TESTING_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_FOR_TESTING_H_
+
+#include "application_manager/hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class HMICapabilitiesForTesting
+ : public ::application_manager::HMICapabilities {
+ public:
+ HMICapabilitiesForTesting(::application_manager::ApplicationManager& app_mngr)
+ : HMICapabilities(app_mngr) {}
+ bool LoadCapabilitiesFromFile() {
+ return load_capabilities_from_file();
+ }
+
+ void ConvertJsonLanguagesToObj(
+ Json::Value& json_languages,
+ ::NsSmartDeviceLink::NsSmartObjects::SmartObject& languages) {
+ convert_json_languages_to_obj(json_languages, languages);
+ }
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_FOR_TESTING_H_
diff --git a/src/components/application_manager/test/resumption/include/application_mock.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 39c4b33539..066ad9baae 100644
--- a/src/components/application_manager/test/resumption/include/application_mock.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2015, Ford Motor Company
+* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,18 +29,23 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_APPLICATION_MOCK_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_APPLICATION_MOCK_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_
#include <string>
#include "gmock/gmock.h"
#include "application_manager/application.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
namespace test {
namespace components {
-namespace resumption_test {
+namespace application_manager_test {
-class ApplicationMock : public ::application_manager::Application {
+namespace custom_str = utils::custom_string;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+class MockApplication : public ::application_manager::Application {
public:
+ MockApplication() {}
MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(curHash, const std::string&());
MOCK_METHOD0(UpdateHash, void());
@@ -65,6 +70,8 @@ class ApplicationMock : public ::application_manager::Application {
MOCK_METHOD1(StartStreaming,
void(protocol_handler::ServiceType service_type));
MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreamingForce,
+ void(protocol_handler::ServiceType service_type));
MOCK_METHOD1(SuspendStreaming,
void(protocol_handler::ServiceType service_type));
MOCK_METHOD1(WakeUpStreaming,
@@ -78,7 +85,7 @@ class ApplicationMock : public ::application_manager::Application {
MOCK_CONST_METHOD0(version, const ::application_manager::Version&());
MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
- MOCK_CONST_METHOD0(name, const std::string&());
+ MOCK_CONST_METHOD0(name, const custom_str::CustomString&());
MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
MOCK_CONST_METHOD0(folder_name, const std::string());
MOCK_CONST_METHOD0(is_media_application, bool());
@@ -91,26 +98,23 @@ class ApplicationMock : public ::application_manager::Application {
const mobile_apis::AudioStreamingState::eType());
MOCK_CONST_METHOD0(app_icon_path, const std::string&());
MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
- MOCK_METHOD0(tts_speak_state, bool());
- MOCK_CONST_METHOD0(CurrentHmiState,
- ::application_manager::HmiStatePtr());
- MOCK_CONST_METHOD0(RegularHmiState,
- ::application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
MOCK_CONST_METHOD0(PostponedHmiState,
- ::application_manager::HmiStatePtr());
+ const application_manager::HmiStatePtr());
MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
MOCK_METHOD0(tts_properties_in_none, bool());
MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
MOCK_METHOD0(tts_properties_in_full, bool());
MOCK_METHOD1(set_version,
void(const ::application_manager::Version& version));
- MOCK_METHOD1(set_name, void(const std::string& name));
+ MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
MOCK_METHOD1(set_is_media_application, void(bool is_media));
MOCK_METHOD0(increment_put_file_in_none_count, void());
MOCK_METHOD0(increment_delete_file_in_none_count, void());
MOCK_METHOD0(increment_list_files_in_none_count, void());
MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
- MOCK_METHOD1(set_app_allowed, void(const bool& allowed));
+ MOCK_METHOD1(set_app_allowed, void(const bool allowed));
MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
MOCK_METHOD1(set_grammar_id, void(uint32_t value));
@@ -125,8 +129,9 @@ class ApplicationMock : public ::application_manager::Application {
MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&());
MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file));
MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
- MOCK_METHOD1(GetFile, const ::application_manager::AppFile*(
- const std::string& file_name));
+ MOCK_METHOD1(
+ GetFile,
+ const ::application_manager::AppFile*(const std::string& file_name));
MOCK_METHOD1(SubscribeToButton,
bool(mobile_apis::ButtonName::eType btn_name));
MOCK_METHOD1(IsSubscribedToButton,
@@ -142,7 +147,9 @@ class ApplicationMock : public ::application_manager::Application {
::application_manager::TLimitSource source));
MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(SetPostponedState, void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD1(SetPostponedState,
+ void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD0(RemovePostponedState, void());
MOCK_METHOD1(AddHMIState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(RemoveHMIState,
void(::application_manager::HmiState::StateID state_id));
@@ -184,10 +191,10 @@ class ApplicationMock : public ::application_manager::Application {
MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(
SubscribedButtons,
- DataAccessor< ::application_manager::ButtonSubscriptions >());
+ DataAccessor< ::application_manager::ButtonSubscriptions>());
MOCK_CONST_METHOD0(
SubscribedIVI,
- DataAccessor< ::application_manager::VehicleInfoSubscriptions >());
+ DataAccessor< ::application_manager::VehicleInfoSubscriptions>());
MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
@@ -220,8 +227,9 @@ class ApplicationMock : public ::application_manager::Application {
MOCK_CONST_METHOD0(video_stream_retry_number, uint32_t());
MOCK_METHOD1(set_video_stream_retry_number,
void(const uint32_t& video_stream_retry_number));
- MOCK_METHOD2(AddCommand, void(uint32_t cmd_id,
- const smart_objects::SmartObject& command));
+ MOCK_METHOD2(AddCommand,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command));
MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id));
MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id));
MOCK_METHOD2(AddSubMenu,
@@ -237,30 +245,41 @@ class ApplicationMock : public ::application_manager::Application {
MOCK_METHOD1(FindChoiceSet,
smart_objects::SmartObject*(uint32_t choice_set_id));
MOCK_METHOD3(AddPerformInteractionChoiceSet,
- void(uint32_t correlation_id, uint32_t choice_set_id,
+ void(uint32_t correlation_id,
+ uint32_t choice_set_id,
const smart_objects::SmartObject& choice_set));
MOCK_METHOD1(DeletePerformInteractionChoiceSet,
void(uint32_t correlation_id));
MOCK_CONST_METHOD0(
performinteraction_choice_set_map,
- DataAccessor< ::application_manager::PerformChoiceSetMap >());
+ DataAccessor< ::application_manager::PerformChoiceSetMap>());
MOCK_CONST_METHOD0(commands_map,
- DataAccessor< ::application_manager::CommandsMap >());
+ DataAccessor< ::application_manager::CommandsMap>());
MOCK_CONST_METHOD0(sub_menu_map,
- DataAccessor< ::application_manager::SubMenuMap >());
+ DataAccessor< ::application_manager::SubMenuMap>());
MOCK_CONST_METHOD0(choice_set_map,
- DataAccessor< ::application_manager::ChoiceSetMap >());
+ DataAccessor< ::application_manager::ChoiceSetMap>());
MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active));
MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t());
MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode));
MOCK_CONST_METHOD0(perform_interaction_mode, int32_t());
+ MOCK_METHOD1(set_perform_interaction_layout,
+ void(mobile_apis::LayoutMode::eType mode));
+ MOCK_CONST_METHOD0(perform_interaction_layout,
+ mobile_apis::LayoutMode::eType());
MOCK_METHOD1(set_reset_global_properties_active, void(bool active));
MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
MOCK_CONST_METHOD0(app_id, uint32_t());
+ MOCK_CONST_METHOD0(mac_address, const std::string&());
+ MOCK_METHOD0(GetAvailableDiskSpace, uint32_t());
+ MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id));
+ MOCK_CONST_METHOD0(is_foreground, bool());
+ MOCK_METHOD1(set_foreground, void(bool is_foreground));
+ MOCK_CONST_METHOD0(IsRegistered, bool());
};
-} // namespace resumption_test
+} // namespace application_manager_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_APPLICATION_MOCK_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_application_manager.h b/src/components/application_manager/test/include/application_manager/mock_application_manager.h
new file mode 100644
index 0000000000..6ad8aeb250
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_application_manager.h
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/vehicle_info_data.h"
+#include "application_manager/state_controller.h"
+#include "resumption/last_state.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class MockApplicationManager : public application_manager::ApplicationManager {
+ public:
+ MOCK_METHOD2(Init,
+ bool(resumption::LastState& last_state,
+ media_manager::MediaManager* media_manager));
+ MOCK_METHOD0(Stop, bool());
+ MOCK_METHOD1(set_hmi_message_handler,
+ void(hmi_message_handler::HMIMessageHandler* handler));
+ MOCK_METHOD1(set_protocol_handler,
+ void(protocol_handler::ProtocolHandler* handler));
+ MOCK_METHOD1(set_connection_handler,
+ void(connection_handler::ConnectionHandler* handler));
+ MOCK_CONST_METHOD0(applications,
+ DataAccessor<application_manager::ApplicationSet>());
+ MOCK_CONST_METHOD1(
+ application, application_manager::ApplicationSharedPtr(uint32_t app_id));
+ MOCK_CONST_METHOD0(active_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD1(
+ application_by_hmi_app,
+ application_manager::ApplicationSharedPtr(uint32_t hmi_app_id));
+ MOCK_CONST_METHOD1(application_by_policy_id,
+ application_manager::ApplicationSharedPtr(
+ const std::string& policy_app_id));
+ MOCK_METHOD1(
+ applications_by_button,
+ std::vector<application_manager::ApplicationSharedPtr>(uint32_t button));
+ MOCK_METHOD0(applications_with_navi,
+ std::vector<application_manager::ApplicationSharedPtr>());
+ MOCK_CONST_METHOD0(get_limited_media_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_navi_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_voice_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id));
+ MOCK_METHOD2(set_application_id,
+ void(const int32_t correlation_id, const uint32_t app_id));
+ MOCK_METHOD3(OnHMILevelChanged,
+ void(uint32_t app_id,
+ mobile_apis::HMILevel::eType from,
+ mobile_apis::HMILevel::eType to));
+ MOCK_METHOD1(
+ SendHMIStatusNotification,
+ void(const utils::SharedPtr<application_manager::Application> app));
+ MOCK_METHOD2(SendMessageToMobile,
+ void(application_manager::commands::MessageSharedPtr, bool));
+ MOCK_METHOD1(
+ SendMessageToHMI,
+ void(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD1(
+ ManageHMICommand,
+ bool(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD2(
+ ManageMobileCommand,
+ bool(const application_manager::commands::MessageSharedPtr message,
+ application_manager::commands::Command::CommandOrigin origin));
+ MOCK_CONST_METHOD1(
+ GetDefaultHmiLevel,
+ mobile_apis::HMILevel::eType(
+ application_manager::ApplicationConstSharedPtr application));
+ MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&());
+ MOCK_CONST_METHOD0(hmi_capabilities,
+ const application_manager::HMICapabilities&());
+ MOCK_METHOD2(ProcessQueryApp,
+ void(const smart_objects::SmartObject& sm_object,
+ const uint32_t connection_key));
+ MOCK_CONST_METHOD0(is_attenuated_supported, bool());
+ MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
+ bool(application_manager::ApplicationConstSharedPtr app));
+ MOCK_METHOD1(OnApplicationRegistered,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_CONST_METHOD0(connection_handler,
+ connection_handler::ConnectionHandler&());
+ MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&());
+ MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&());
+ MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
+ MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
+ MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
+ MOCK_METHOD0(BeginAudioPassThrough, bool());
+ MOCK_METHOD0(EndAudioPassThrough, bool());
+ MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
+ MOCK_METHOD0(OnHMIStartedCooperation, void());
+ MOCK_CONST_METHOD0(IsHMICooperating, bool());
+ MOCK_METHOD2(IviInfoUpdated,
+ std::vector<application_manager::ApplicationSharedPtr>(
+ application_manager::VehicleDataType vehicle_info,
+ int value));
+ MOCK_METHOD1(RegisterApplication,
+ application_manager::ApplicationSharedPtr(const utils::SharedPtr<
+ smart_objects::SmartObject>& request_for_registration));
+ MOCK_METHOD0(SendUpdateAppList, void());
+ MOCK_METHOD2(MarkAppsGreyOut,
+ void(const connection_handler::DeviceHandle handle,
+ bool is_greyed_out));
+ MOCK_CONST_METHOD1(IsAppsQueriedFrom,
+ bool(const connection_handler::DeviceHandle handle));
+ MOCK_CONST_METHOD0(IsStopping, bool());
+ MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList,
+ void(const uint32_t app_id));
+ MOCK_METHOD4(
+ SaveBinary,
+ mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data,
+ const std::string& file_path,
+ const std::string& file_name,
+ const int64_t offset));
+ MOCK_METHOD1(SetAllAppsAllowed, void(const bool allowed));
+ MOCK_METHOD1(set_driver_distraction, void(bool is_distracting));
+ MOCK_METHOD6(StartAudioPassThruThread,
+ void(int32_t session_key,
+ int32_t correlation_id,
+ int32_t max_duration,
+ int32_t sampling_rate,
+ int32_t bits_per_sample,
+ int32_t audio_type));
+ MOCK_METHOD0(StartDevicesDiscovery, void());
+ MOCK_METHOD1(StopAudioPassThru, void(int32_t application_key));
+ MOCK_METHOD2(TerminateRequest,
+ void(uint32_t connection_key, uint32_t corr_id));
+ MOCK_METHOD4(UnregisterApplication,
+ void(const uint32_t&, mobile_apis::Result::eType, bool, bool));
+ MOCK_METHOD3(updateRequestTimeout,
+ void(uint32_t connection_key,
+ uint32_t mobile_correlation_id,
+ uint32_t new_timeout_value));
+ MOCK_METHOD0(state_controller, application_manager::StateController&());
+ MOCK_METHOD1(SetUnregisterAllApplicationsReason,
+ void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
+ MOCK_METHOD1(HeadUnitReset,
+ void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
+ MOCK_CONST_METHOD2(HMILevelAllowsStreaming,
+ bool(uint32_t app_id,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD5(CheckPolicyPermissions,
+ mobile_apis::Result::eType(
+ const std::string&,
+ mobile_apis::HMILevel::eType,
+ mobile_apis::FunctionID::eType,
+ const application_manager::RPCParams&,
+ application_manager::CommandParametersPermissions*));
+ MOCK_CONST_METHOD2(IsApplicationForbidden,
+ bool(uint32_t connection_key,
+ const std::string& policy_app_id));
+ MOCK_METHOD0(resume_controller, resumption::ResumeCtrl&());
+ MOCK_METHOD1(
+ GetDeviceTransportType,
+ hmi_apis::Common_TransportType::eType(const std::string& transport_type));
+ MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t app_id));
+ MOCK_METHOD0(GenerateGrammarID, uint32_t());
+ MOCK_CONST_METHOD1(GetUserConsentForDevice,
+ policy::DeviceConsent(const std::string& device_id));
+ MOCK_METHOD1(OnAppUnauthorized, void(const uint32_t& app_id));
+ MOCK_METHOD1(ActivateApplication,
+ bool(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD3(OnAppStreaming,
+ void(uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool state));
+ MOCK_CONST_METHOD4(CreateRegularState,
+ application_manager::HmiStatePtr(
+ uint32_t app_id,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context));
+ MOCK_METHOD2(SendAudioPassThroughNotification,
+ void(uint32_t session_key, std::vector<uint8_t>& binary_data));
+ MOCK_CONST_METHOD2(CanAppStream,
+ bool(uint32_t app_id,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
+ MOCK_CONST_METHOD0(get_settings,
+ const application_manager::ApplicationManagerSettings&());
+ MOCK_METHOD0(event_dispatcher,
+ application_manager::event_engine::EventDispatcher&());
+
+ MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints, bool(const uint32_t));
+ MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t));
+ MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t));
+ MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool());
+ MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<int32_t>());
+ MOCK_CONST_METHOD1(
+ WaitingApplicationByID,
+ application_manager::ApplicationConstSharedPtr(const uint32_t));
+ MOCK_CONST_METHOD0(
+ AppsWaitingForRegistration,
+ DataAccessor<application_manager::AppsWaitRegistrationSet>());
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
new file mode 100644
index 0000000000..916f4a69f0
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_DISPATCHER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_DISPATCHER_H_
+
+#include <list>
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/event_engine/event_observer.h"
+
+namespace test {
+namespace components {
+namespace event_engine_test {
+
+class MockEventDispatcher
+ : public ::application_manager::event_engine::EventDispatcher {
+ public:
+ MOCK_METHOD1(raise_event,
+ void(const ::application_manager::event_engine::Event& event));
+ MOCK_METHOD3(
+ add_observer,
+ void(const ::application_manager::event_engine::Event::EventID& event_id,
+ int32_t hmi_correlation_id,
+ ::application_manager::event_engine::EventObserver& observer));
+ MOCK_METHOD2(
+ remove_observer,
+ void(const ::application_manager::event_engine::Event::EventID& event_id,
+ ::application_manager::event_engine::EventObserver& observer));
+ MOCK_METHOD1(
+ remove_observer,
+ void(::application_manager::event_engine::EventObserver& observer));
+};
+
+} // namespace event_engine_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_DISPATCHER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
new file mode 100644
index 0000000000..289b20a105
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_MESSAGE_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_MESSAGE_HELPER_H_
+#include "gmock/gmock.h"
+#include "application_manager/application.h"
+#include "interfaces/HMI_API.h"
+#include "policy/policy_types.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/application_manager.h"
+
+namespace application_manager {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+class MockMessageHelper {
+ public:
+ MOCK_METHOD1(GetHashUpdateNotification,
+ smart_objects::SmartObjectSPtr(const uint32_t app_id));
+ MOCK_METHOD2(SendHashUpdateNotification,
+ void(const uint32_t app_id, ApplicationManager& app_mngr));
+ MOCK_METHOD1(HMIResultToString,
+ std::string(hmi_apis::Common_Result::eType hmi_result));
+ MOCK_METHOD1(HMIResultFromString,
+ hmi_apis::Common_Result::eType(const std::string& hmi_result));
+ MOCK_METHOD1(MobileResultToString,
+ std::string(mobile_apis::Result::eType mobile_result));
+ MOCK_METHOD1(MobileResultFromString,
+ mobile_api::Result::eType(const std::string& mobile_result));
+ MOCK_METHOD1(HMIToMobileResult,
+ mobile_api::Result::eType(
+ const hmi_apis::Common_Result::eType hmi_result));
+ MOCK_METHOD1(MobileToHMIResult,
+ hmi_apis::Common_Result::eType(
+ const mobile_api::Result::eType mobile_result));
+ MOCK_METHOD1(StringToHMILevel,
+ mobile_api::HMILevel::eType(const std::string& hmi_level));
+ MOCK_METHOD1(CreateDeviceListSO,
+ smart_objects::SmartObjectSPtr(
+ const connection_handler::DeviceMap& devices));
+ MOCK_METHOD2(SendNaviStartStream,
+ void(int32_t connection_key, ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendNaviStopStream,
+ void(int32_t connection_key, ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendOnAppPermissionsChangedNotification,
+ void(uint32_t connection_key,
+ const policy::AppPermissions& permissions,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendAudioStartStream,
+ void(int32_t connection_key, ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendAudioStopStream,
+ void(int32_t connection_key, ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendOnDataStreaming,
+ void(protocol_handler::ServiceType service,
+ bool available,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(CreateGetVehicleDataRequest,
+ void(uint32_t correlation_id,
+ const std::vector<std::string>& params,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendUpdateSDLResponse,
+ void(const std::string& result,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendGetUserFriendlyMessageResponse,
+ void(const std::vector<policy::UserFriendlyMessage>& msg,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendGetStatusUpdateResponse,
+ void(const std::string& status,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendOnStatusUpdate,
+ void(const std::string& status, ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendSDLActivateAppResponse,
+ void(policy::AppPermissions& permissions,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager& app_mngr));
+
+ MOCK_METHOD4(SendPolicyUpdate,
+ void(const std::string& file_path,
+ int timeout,
+ const std::vector<int>& retries,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(
+ SendGetListOfPermissionsResponse,
+ void(const std::vector<policy::FunctionalGroupPermission>& permissions,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendOnPermissionsChangeNotification,
+ void(uint32_t connection_key,
+ const policy::Permissions& permissions,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD4(SendPolicySnapshotNotification,
+ void(uint32_t connection_key,
+ const std::vector<uint8_t>& policy_data,
+ const std::string& url,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD1(CommonLanguageFromString,
+ hmi_apis::Common_Language::eType(const std::string& language));
+ MOCK_METHOD1(CommonLanguageToString,
+ std::string(hmi_apis::Common_Language::eType));
+ MOCK_METHOD2(CreateModuleInfoSO,
+ smart_objects::SmartObjectSPtr(uint32_t function_id,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendAllOnButtonSubscriptionNotificationsForApp,
+ void(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendOnResumeAudioSourceToHMI,
+ void(uint32_t app_id, ApplicationManager& app_mngr));
+ MOCK_METHOD2(CreateAddSubMenuRequestToHMI,
+ smart_objects::SmartObjectList(ApplicationConstSharedPtr app,
+ const uint32_t correlation_id));
+ MOCK_METHOD2(CreateAddCommandRequestToHMI,
+ smart_objects::SmartObjectList(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD1(CreateAddVRCommandRequestFromChoiceToHMI,
+ smart_objects::SmartObjectList(ApplicationConstSharedPtr app));
+ MOCK_METHOD1(SendGlobalPropertiesToHMI, void(ApplicationConstSharedPtr app));
+ MOCK_METHOD1(GetIVISubscriptionRequests,
+ smart_objects::SmartObjectList(ApplicationSharedPtr app));
+ MOCK_METHOD3(VerifyImageFiles,
+ mobile_apis::Result::eType(smart_objects::SmartObject& message,
+
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD6(GetBCActivateAppRequestToHMI,
+ smart_objects::SmartObjectSPtr(
+ ApplicationConstSharedPtr app,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
+ NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr(
+ int32_t connection_key,
+ mobile_apis::AppInterfaceUnregisteredReason::eType reason));
+
+ static MockMessageHelper* message_helper_mock();
+};
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_MESSAGE_HELPER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
new file mode 100644
index 0000000000..09fe8d38b3
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2016, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_
+#include <string>
+#include "gmock/gmock.h"
+#include "application_manager/resumption/resumption_data.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+namespace app_mngr = application_manager;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class MockResumptionData : public ::resumption::ResumptionData {
+ public:
+ MockResumptionData(
+ const application_manager_test::MockApplicationManager& settings)
+ : ResumptionData(settings) {}
+ MOCK_METHOD1(SaveApplication,
+ void(app_mngr::ApplicationSharedPtr application));
+ MOCK_CONST_METHOD2(GetStoredHMILevel,
+ int32_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD1(IsHMIApplicationIdExist, bool(uint32_t hmi_app_id));
+ MOCK_CONST_METHOD2(GetHMIApplicationID,
+ uint32_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD0(OnSuspend, void());
+ MOCK_CONST_METHOD3(GetHashId,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id,
+ std::string& hash_id));
+ MOCK_METHOD0(OnAwake, void());
+ MOCK_CONST_METHOD3(GetSavedApplication,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id,
+ smart_objects::SmartObject& saved_app));
+ MOCK_METHOD2(RemoveApplicationFromSaved,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD0(GetIgnOffTime, uint32_t());
+ MOCK_CONST_METHOD2(IsApplicationSaved,
+ ssize_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD1(GetDataForLoadResumeData,
+ void(smart_objects::SmartObject& saved_data));
+ MOCK_METHOD3(UpdateHmiLevel,
+ void(const std::string& policy_app_id,
+ const std::string& device_id,
+ mobile_apis::HMILevel::eType hmi_level));
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD2(DropAppDataResumption,
+ bool(const std::string& device_id, const std::string& app_id));
+ MOCK_METHOD0(Persist, void());
+};
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_statistics_manager.h b/src/components/application_manager/test/include/application_manager/mock_statistics_manager.h
new file mode 100644
index 0000000000..668959fe2e
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_statistics_manager.h
@@ -0,0 +1,65 @@
+/* Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_MOCK_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_MOCK_STATISTICS_MANAGER_H_
+
+#include <string>
+
+#include "gmock/gmock.h"
+
+#include "policy/usage_statistics/statistics_manager.h"
+#include "application_manager/usage_statistics.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using namespace ::usage_statistics;
+class MockStatisticsManager : public StatisticsManager {
+ public:
+ MOCK_METHOD1(Increment, void(GlobalCounterId type));
+ MOCK_METHOD2(Increment, void(const std::string& app_id, AppCounterId type));
+ MOCK_METHOD3(Set,
+ void(const std::string& app_id,
+ AppInfoId type,
+ const std::string& value));
+ MOCK_METHOD3(Add,
+ void(const std::string& app_id,
+ AppStopwatchId type,
+ int32_t timespan_seconds));
+ virtual ~MockStatisticsManager() {}
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_MOCK_STATISTICS_MANAGER_H_
diff --git a/src/components/application_manager/test/mock/src/application_manager_impl.cc b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
index b5d80e740a..bc5d444eed 100644
--- a/src/components/application_manager/test/mock/src/application_manager_impl.cc
+++ b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -30,4 +30,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager_impl.h"
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/telemetry_observer.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockAMTelemetryObserver
+ : public application_manager::AMTelemetryObserver {
+ public:
+ MOCK_METHOD1(OnMessage, void(MessageMetricSharedPtr));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
diff --git a/src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h b/src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h
new file mode 100644
index 0000000000..51a0678b24
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_POLICY_HANDLER_INTERFACE_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_POLICY_HANDLER_INTERFACE_MOCK_H_
+
+#include "application_manager/policies/policy_handler_interface.h"
+#include "gmock/gmock.h"
+#include "policy/policy_types.h"
+
+namespace policy {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
+ public:
+ MOCK_METHOD0(LoadPolicyLibrary, bool());
+ MOCK_CONST_METHOD0(PolicyEnabled, bool());
+ MOCK_METHOD0(InitPolicyTable, bool());
+ MOCK_METHOD0(ResetPolicyTable, bool());
+ MOCK_METHOD0(ClearUserConsent, bool());
+ MOCK_METHOD2(SendMessageToSDK,
+ bool(const policy::BinaryMessage& pt_string,
+ const std::string& url));
+ MOCK_METHOD2(ReceiveMessageFromSDK,
+ bool(const std::string& file,
+ const policy::BinaryMessage& pt_string));
+ MOCK_METHOD0(UnloadPolicyLibrary, bool());
+ MOCK_METHOD3(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions,
+ const policy::HMILevel& default_hmi));
+ MOCK_METHOD2(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions));
+ MOCK_METHOD3(OnSnapshotCreated,
+ void(const policy::BinaryMessage& pt_string,
+ const std::vector<int>& retry_delay_seconds,
+ int timeout_exchange));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string* priority));
+ MOCK_METHOD5(CheckPermissions,
+ void(const policy::PTString& app_id,
+ const policy::PTString& hmi_level,
+ const policy::PTString& rpc,
+ const policy::RPCParams& rpc_params,
+ policy::CheckPermissionResult& result));
+ MOCK_CONST_METHOD1(GetNotificationsNumber,
+ uint32_t(const std::string& priority));
+ MOCK_CONST_METHOD1(GetUserConsentForDevice,
+ policy::DeviceConsent(const std::string& device_id));
+ MOCK_CONST_METHOD2(GetDefaultHmi,
+ bool(const std::string& policy_app_id,
+ std::string* default_hmi));
+
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string& application_id,
+ policy::StringArray* nicknames,
+ policy::StringArray* app_hmi_types));
+ MOCK_METHOD2(GetInitialAppData,
+ bool(const std::string& application_id,
+ policy::StringArray* nicknames));
+ MOCK_METHOD1(GetInitialAppData, bool(const std::string& application_id));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(int service_type, policy::EndpointUrls& end_points));
+ MOCK_METHOD0(ResetRetrySequence, void());
+ MOCK_METHOD0(NextRetryTimeout, uint32_t());
+ MOCK_METHOD0(TimeoutExchange, int());
+ MOCK_METHOD0(OnExceededTimeout, void());
+ MOCK_METHOD0(OnSystemReady, void());
+ MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
+ MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener));
+ MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener));
+ MOCK_CONST_METHOD0(GetStatisticManager,
+ utils::SharedPtr<usage_statistics::StatisticsManager>());
+ MOCK_CONST_METHOD2(CheckSystemAction,
+ bool(mobile_apis::SystemAction::eType system_action,
+ const std::string& policy_app_id));
+ MOCK_METHOD1(KmsChanged, void(int kms));
+ MOCK_METHOD2(OnActivateApp,
+ void(uint32_t connection_key, uint32_t correlation_id));
+ MOCK_METHOD2(OnAllowSDLFunctionalityNotification,
+ void(bool is_allowed, const std::string& device_id));
+ MOCK_METHOD0(OnIgnitionCycleOver, void());
+ MOCK_METHOD1(OnPendingPermissionChange,
+ void(const std::string& policy_app_id));
+ MOCK_METHOD1(PTExchangeAtUserRequest, void(uint32_t correlation_id));
+ MOCK_METHOD2(AddDevice,
+ void(const std::string& device_id,
+ const std::string& connection_type));
+ MOCK_METHOD2(SetDeviceInfo,
+ void(const std::string& device_id,
+ const policy::DeviceInfo& device_info));
+ MOCK_METHOD2(OnAppPermissionConsent,
+ void(const uint32_t connection_key,
+ const policy::PermissionConsent& permissions));
+ MOCK_METHOD3(OnGetUserFriendlyMessage,
+ void(const std::vector<std::string>& message_codes,
+ const std::string& language,
+ uint32_t correlation_id));
+ MOCK_METHOD2(OnGetListOfPermissions,
+ void(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_METHOD1(OnGetStatusUpdate, void(const uint32_t correlation_id));
+ MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
+ MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
+ std::string(const std::string& policy_app_id));
+ MOCK_METHOD1(OnSystemInfoChanged, void(const std::string& language));
+ MOCK_METHOD3(OnGetSystemInfo,
+ void(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language));
+ MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
+ MOCK_METHOD0(OnVIIsReady, void());
+ MOCK_METHOD1(OnVehicleDataUpdated,
+ void(const smart_objects::SmartObject& message));
+ MOCK_METHOD1(RemoveDevice, void(const std::string& device_id));
+ MOCK_METHOD1(AddStatisticsInfo, void(int type));
+ MOCK_METHOD1(OnSystemError, void(int code));
+ MOCK_CONST_METHOD0(GetAppIdForSending, uint32_t());
+ MOCK_METHOD1(
+ GetAppName,
+ utils::custom_string::CustomString(const std::string& policy_app_id));
+ MOCK_METHOD1(OnUpdateHMIAppType,
+ void(std::map<std::string, policy::StringArray> app_hmi_types));
+ MOCK_METHOD1(OnCertificateUpdated, void(const std::string& certificate_data));
+ MOCK_METHOD1(OnCertificateDecrypted, void(bool is_succeeded));
+ MOCK_METHOD0(CanUpdate, bool());
+ MOCK_METHOD2(OnDeviceConsentChanged,
+ void(const std::string& device_id, bool is_allowed));
+ MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
+ void(const policy::AppPermissions& permissions,
+ const std::string& policy_app_id));
+ MOCK_METHOD0(OnPTExchangeNeeded, void());
+ MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>& apps));
+ MOCK_METHOD1(AddApplication, void(const std::string& application_id));
+ MOCK_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD0(OnUpdateRequestSentToMobile, void());
+ MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
+ MOCK_METHOD0(OnAppsSearchStarted, void());
+ MOCK_METHOD0(OnAppsSearchCompleted, void());
+ MOCK_METHOD1(OnAppRegisteredOnMobile,
+ void(const std::string& application_id));
+ MOCK_CONST_METHOD2(IsRequestTypeAllowed,
+ bool(const std::string& policy_app_id,
+ mobile_apis::RequestType::eType type));
+ MOCK_CONST_METHOD1(
+ GetAppRequestTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+ MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
+ MOCK_METHOD2(Increment,
+ void(const std::string& app_id,
+ usage_statistics::AppCounterId type));
+ MOCK_METHOD3(Set,
+ void(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value));
+ MOCK_METHOD3(Add,
+ void(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds));
+ MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
+ MOCK_CONST_METHOD0(get_settings, const policy::PolicySettings&());
+
+ private:
+ MOCK_METHOD2(OnAppPermissionConsentInternal,
+ void(const uint32_t connection_key,
+ policy::PermissionConsent& permissions));
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_POLICY_HANDLER_INTERFACE_MOCK_H_
diff --git a/src/components/application_manager/test/resumption/include/resumption_data_mock.h b/src/components/application_manager/test/include/application_manager/resumption_data_mock.h
index 2c9285b025..6625b3e5b3 100644
--- a/src/components/application_manager/test/resumption/include/resumption_data_mock.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_mock.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2015, Ford Motor Company
+* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,8 @@
#include "gmock/gmock.h"
#include "application_manager/resumption/resumption_data.h"
#include "application_manager/application.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_application_manager.h"
namespace test {
namespace components {
@@ -42,23 +44,25 @@ namespace resumption_test {
namespace app_mngr = application_manager;
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-class ResumptionDataMock : public ::resumption::ResumptionData {
+class MockResumptionData : public ::resumption::ResumptionData {
public:
+ MockResumptionData(const application_manager_test::MockApplicationManager&
+ application_manager)
+ : ResumptionData(application_manager) {}
MOCK_METHOD1(SaveApplication,
void(app_mngr::ApplicationSharedPtr application));
MOCK_CONST_METHOD2(GetStoredHMILevel,
int32_t(const std::string& policy_app_id,
const std::string& device_id));
MOCK_CONST_METHOD1(IsHMIApplicationIdExist, bool(uint32_t hmi_app_id));
- MOCK_METHOD2(CheckSavedApplication, bool(const std::string& policy_app_id,
- const std::string& device_id));
MOCK_CONST_METHOD2(GetHMIApplicationID,
uint32_t(const std::string& policy_app_id,
const std::string& device_id));
MOCK_METHOD0(OnSuspend, void());
MOCK_CONST_METHOD3(GetHashId,
bool(const std::string& policy_app_id,
- const std::string& device_id, std::string& hash_id));
+ const std::string& device_id,
+ std::string& hash_id));
MOCK_METHOD0(OnAwake, void());
MOCK_CONST_METHOD3(GetSavedApplication,
bool(const std::string& policy_app_id,
@@ -73,10 +77,14 @@ class ResumptionDataMock : public ::resumption::ResumptionData {
const std::string& device_id));
MOCK_CONST_METHOD1(GetDataForLoadResumeData,
void(smart_objects::SmartObject& saved_data));
- MOCK_METHOD3(UpdateHmiLevel, void(const std::string& policy_app_id,
- const std::string& device_id,
- mobile_apis::HMILevel::eType hmi_level));
+ MOCK_METHOD3(UpdateHmiLevel,
+ void(const std::string& policy_app_id,
+ const std::string& device_id,
+ mobile_apis::HMILevel::eType hmi_level));
MOCK_METHOD0(Init, bool());
+ MOCK_METHOD2(DropAppDataResumption,
+ bool(const std::string& device_id, const std::string& app_id));
+ MOCK_METHOD0(Persist, void());
};
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption/include/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index 55767225b5..b648b8ab82 100644
--- a/src/components/application_manager/test/resumption/include/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,13 +30,22 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_
+
#include <string>
#include <algorithm>
#include "gtest/gtest.h"
#include "application_manager/usage_statistics.h"
-#include "application_mock.h"
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "utils/data_accessor.h"
+#include "config_profile/profile.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/mock_application_manager_settings.h"
namespace test {
namespace components {
@@ -52,13 +61,22 @@ using namespace mobile_apis;
class ResumptionDataTest : public ::testing::Test {
protected:
+ ResumptionDataTest()
+ : kCountOfCommands_(5u)
+ , kCountOfChoice_(2u)
+ , kCountOfChoiceSets_(4u)
+ , kCountOfSubmenues_(3u)
+ , kCountOfFiles_(8u)
+ , kCountOfVrhelptitle_(2u)
+ , kMacAddress_("12345") {}
// Check structure in saved application
void CheckSavedApp(sm::SmartObject& saved_data);
-
// Set data for resumption
virtual void PrepareData();
- utils::SharedPtr<NiceMock<ApplicationMock>> app_mock;
+ utils::SharedPtr<NiceMock<application_manager_test::MockApplication>>
+ app_mock;
+ profile::Profile profile_;
HMILevel::eType hmi_level_;
size_t app_id_;
size_t hmi_app_id_;
@@ -105,13 +123,13 @@ class ResumptionDataTest : public ::testing::Test {
void CheckVRTitle(sm::SmartObject& res_list);
void CheckSubscriptions(sm::SmartObject& res_list);
- const size_t count_of_commands = 5;
- const size_t count_of_choice = 2;
- const size_t count_of_choice_sets = 4;
- const size_t count_of_submenues = 3;
- const size_t count_of_files = 8;
- const size_t count_of_vrhelptitle = 2;
- const std::string device_id_ = "12345";
+ const size_t kCountOfCommands_;
+ const size_t kCountOfChoice_;
+ const size_t kCountOfChoiceSets_;
+ const size_t kCountOfSubmenues_;
+ const size_t kCountOfFiles_;
+ const size_t kCountOfVrhelptitle_;
+ const std::string kMacAddress_;
am::CommandsMap test_commands_map;
am::SubMenuMap test_submenu_map;
@@ -126,8 +144,13 @@ class ResumptionDataTest : public ::testing::Test {
sync_primitives::Lock setlock_;
sync_primitives::Lock btnlock_;
sync_primitives::Lock ivilock_;
+ application_manager_test::MockApplicationManagerSettings
+ mock_application_manager_settings_;
+ application_manager_test::MockApplicationManager mock_application_manager_;
};
} // namespace resumption_test
} // namespace components
} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_
diff --git a/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h b/src/components/application_manager/test/include/application_manager/statistics_manager_mock.h
index 4e2dae78d1..cff4194118 100644
--- a/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h
+++ b/src/components/application_manager/test/include/application_manager/statistics_manager_mock.h
@@ -35,18 +35,25 @@
#include <string>
#include "gmock/gmock.h"
-#include "usage_statistics/statistics_manager.h"
+#include "policy/usage_statistics/statistics_manager.h"
+namespace test {
+namespace components {
namespace state_controller_test {
+
namespace us = usage_statistics;
-class StatisticsManagerMock : public us::StatisticsManager {
+class MockStatisticsManager : public us::StatisticsManager {
public:
- MOCK_METHOD1(Increment, void (us::GlobalCounterId));
- MOCK_METHOD2(Increment, void (const std::string&, us::AppCounterId));
- MOCK_METHOD3(Set, void (const std::string&, us::AppInfoId, const std::string&));
- MOCK_METHOD3(Add, void (const std::string&, us::AppStopwatchId, int32_t));
+ MOCK_METHOD1(Increment, void(us::GlobalCounterId));
+ MOCK_METHOD2(Increment, void(const std::string&, us::AppCounterId));
+ MOCK_METHOD3(Set,
+ void(const std::string&, us::AppInfoId, const std::string&));
+ MOCK_METHOD3(Add, void(const std::string&, us::AppStopwatchId, int32_t));
};
} // namespace state_controller_test
+}
+}
+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATISTICS_MANAGER_MOCK_H_
diff --git a/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h b/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h
new file mode 100644
index 0000000000..e10f60afac
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_
+
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "application_manager/resumption/resumption_data_db.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_application_manager.h"
+
+using ::resumption::ResumptionDataDB;
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+class TestResumptionDataDB : public ResumptionDataDB {
+ public:
+ utils::dbms::SQLDatabase* get_db_handle() {
+ return db();
+ }
+
+ application_manager_test::MockApplicationManager mock_application_manager_;
+ TestResumptionDataDB(DbStorage db_storage)
+ : ResumptionDataDB(db_storage, mock_application_manager_) {}
+};
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
new file mode 100755
index 0000000000..bfc0228bbb
--- /dev/null
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -0,0 +1,61 @@
+# Copyright (c) 2015, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+if(BUILD_TESTS)
+
+set(appMain_DIR ${CMAKE_SOURCE_DIR}/src/appMain)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/test/message_helper/include
+ ${COMPONENTS_DIR}/application_manager/test/state_controller/include
+ ${COMPONENTS_DIR}/include
+ ${COMPONENTS_DIR}
+)
+
+set(LIBRARIES
+ gmock
+ ApplicationManager
+ MessageHelper
+ jsoncpp
+ connectionHandler
+ MediaManager
+ Resumption
+ ProtocolHandler
+ Utils
+)
+
+set(SOURCES
+ #message_helper_test.cc
+)
+
+create_test("message_helper_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt.user b/src/components/application_manager/test/message_helper/CMakeLists.txt.user
new file mode 100755
index 0000000000..e7522c1793
--- /dev/null
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt.user
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 3.5.1, 2015-11-19T12:59:06. -->
+<qtcreator>
+ <data>
+ <variable>EnvironmentId</variable>
+ <value type="QByteArray">{6965f0e8-9b58-4b26-8426-81354d6c3400}</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.ActiveTarget</variable>
+ <value type="int">0</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.EditorSettings</variable>
+ <valuemap type="QVariantMap">
+ <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+ <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+ <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+ <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+ <value type="QString" key="language">Cpp</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+ </valuemap>
+ </valuemap>
+ <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+ <value type="QString" key="language">QmlJS</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+ </valuemap>
+ </valuemap>
+ <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+ <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+ <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+ <value type="int" key="EditorConfiguration.IndentSize">4</value>
+ <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+ <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+ <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+ <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+ <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+ <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+ <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+ <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+ <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+ <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+ <value type="int" key="EditorConfiguration.TabSize">8</value>
+ <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+ <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+ <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+ <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+ <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+ <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.PluginSettings</variable>
+ <valuemap type="QVariantMap"/>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.0</variable>
+ <valuemap type="QVariantMap">
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.1 GCC 64bit</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.1 GCC 64bit</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.55.gcc_64_kit</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+ <value type="bool" key="CMakeProjectManager.CMakeBuildConfiguration.UseNinja">false</value>
+ <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/oherasym/sdl_panasonic/src/components/application_manager/test/message_helper-build</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
+ <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
+ <value type="bool" key="CMakeProjectManager.MakeStep.Clean">false</value>
+ <value type="QString" key="CMakeProjectManager.MakeStep.MakeCommand"></value>
+ <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">clean</value>
+ <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
+ <value type="bool" key="CMakeProjectManager.MakeStep.Clean">true</value>
+ <value type="QString" key="CMakeProjectManager.MakeStep.MakeCommand"></value>
+ <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+ <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+ <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">all</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+ <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+ <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+ <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+ <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+ <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+ <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+ <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+ <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+ <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+ <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+ <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+ <value type="int">0</value>
+ <value type="int">1</value>
+ <value type="int">2</value>
+ <value type="int">3</value>
+ <value type="int">4</value>
+ <value type="int">5</value>
+ <value type="int">6</value>
+ <value type="int">7</value>
+ <value type="int">8</value>
+ <value type="int">9</value>
+ <value type="int">10</value>
+ <value type="int">11</value>
+ <value type="int">12</value>
+ <value type="int">13</value>
+ <value type="int">14</value>
+ </valuelist>
+ <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+ <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+ <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
+ <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
+ <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
+ <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+ <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+ <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+ <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.TargetCount</variable>
+ <value type="int">1</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+ <value type="int">18</value>
+ </data>
+ <data>
+ <variable>Version</variable>
+ <value type="int">18</value>
+ </data>
+</qtcreator>
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
new file mode 100644
index 0000000000..77e791dc82
--- /dev/null
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -0,0 +1,906 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "utils/macro.h"
+#include "utils/make_shared.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/test/resumption/include/application_mock.h"
+#include "utils/custom_string.h"
+#include "policy/mock_policy_settings.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace application_manager {
+namespace test {
+
+namespace HmiLanguage = hmi_apis::Common_Language;
+namespace HmiResults = hmi_apis::Common_Result;
+namespace MobileResults = mobile_apis::Result;
+
+typedef ::test::components::resumption_test::MockApplication AppMock;
+typedef utils::SharedPtr<AppMock> MockApplicationSharedPtr;
+typedef std::vector<std::string> StringArray;
+typedef ::application_manager::Application App;
+typedef utils::SharedPtr<App> ApplicationSharedPtr;
+
+using testing::AtLeast;
+using testing::ReturnRefOfCopy;
+using testing::ReturnRef;
+using testing::Return;
+
+TEST(MessageHelperTestCreate,
+ CreateBlockedByPoliciesResponse_SmartObject_Equal) {
+ mobile_apis::FunctionID::eType function_id =
+ mobile_apis::FunctionID::eType::AddCommandID;
+ mobile_apis::Result::eType result = mobile_apis::Result::eType::ABORTED;
+ uint32_t correlation_id = 0;
+ uint32_t connection_key = 0;
+ bool success = false;
+
+ smart_objects::SmartObjectSPtr ptr =
+ MessageHelper::CreateBlockedByPoliciesResponse(
+ function_id, result, correlation_id, connection_key);
+
+ EXPECT_TRUE(ptr);
+
+ smart_objects::SmartObject& obj = *ptr;
+
+ EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt());
+ EXPECT_EQ(kResponse, obj[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(success, obj[strings::msg_params][strings::success].asBool());
+ EXPECT_EQ(result, obj[strings::msg_params][strings::result_code].asInt());
+ EXPECT_EQ(correlation_id,
+ obj[strings::params][strings::correlation_id].asUInt());
+ EXPECT_EQ(connection_key,
+ obj[strings::params][strings::connection_key].asUInt());
+ EXPECT_EQ(kV2, obj[strings::params][strings::protocol_version].asInt());
+}
+
+TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) {
+ std::string path_to_icon = "";
+ uint32_t app_id = 0;
+ smart_objects::SmartObjectSPtr ptr =
+ MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
+
+ EXPECT_TRUE(ptr);
+
+ smart_objects::SmartObject& obj = *ptr;
+
+ int image_type = static_cast<int>(mobile_api::ImageType::DYNAMIC);
+
+ EXPECT_EQ(path_to_icon,
+ obj[strings::sync_file_name][strings::value].asString());
+ EXPECT_EQ(image_type,
+ obj[strings::sync_file_name][strings::image_type].asInt());
+ EXPECT_EQ(app_id, obj[strings::app_id].asUInt());
+}
+
+TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
+ std::string path_to_icon = "/qwe/qwe/";
+ uint32_t app_id = 10;
+ smart_objects::SmartObjectSPtr ptr =
+ MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
+
+ EXPECT_TRUE(ptr);
+
+ smart_objects::SmartObject& obj = *ptr;
+
+ int image_type = static_cast<int>(mobile_api::ImageType::DYNAMIC);
+
+ EXPECT_EQ(path_to_icon,
+ obj[strings::sync_file_name][strings::value].asString());
+ EXPECT_EQ(image_type,
+ obj[strings::sync_file_name][strings::image_type].asInt());
+ EXPECT_EQ(app_id, obj[strings::app_id].asUInt());
+}
+
+TEST(MessageHelperTestCreate,
+ CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ EXPECT_CALL(*appSharedMock, vr_help_title()).Times(AtLeast(1));
+ EXPECT_CALL(*appSharedMock, vr_help()).Times(AtLeast(1));
+ EXPECT_CALL(*appSharedMock, help_prompt()).Times(AtLeast(1));
+ EXPECT_CALL(*appSharedMock, timeout_prompt()).Times(AtLeast(1));
+
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
+
+ EXPECT_TRUE(ptr.empty());
+}
+
+TEST(MessageHelperTestCreate,
+ CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ smart_objects::SmartObjectSPtr objPtr =
+ MakeShared<smart_objects::SmartObject>();
+
+ (*objPtr)[0][strings::vr_help_title] = "111";
+ (*objPtr)[1][strings::vr_help] = "222";
+ (*objPtr)[2][strings::keyboard_properties] = "333";
+ (*objPtr)[3][strings::menu_title] = "444";
+ (*objPtr)[4][strings::menu_icon] = "555";
+ (*objPtr)[5][strings::help_prompt] = "666";
+ (*objPtr)[6][strings::timeout_prompt] = "777";
+
+ EXPECT_CALL(*appSharedMock, vr_help_title())
+ .Times(AtLeast(3))
+ .WillRepeatedly(Return(&(*objPtr)[0]));
+ EXPECT_CALL(*appSharedMock, vr_help())
+ .Times(AtLeast(2))
+ .WillRepeatedly(Return(&(*objPtr)[1]));
+ EXPECT_CALL(*appSharedMock, help_prompt())
+ .Times(AtLeast(3))
+ .WillRepeatedly(Return(&(*objPtr)[5]));
+ EXPECT_CALL(*appSharedMock, timeout_prompt())
+ .Times(AtLeast(2))
+ .WillRepeatedly(Return(&(*objPtr)[6]));
+ EXPECT_CALL(*appSharedMock, keyboard_props())
+ .Times(AtLeast(2))
+ .WillRepeatedly(Return(&(*objPtr)[2]));
+ EXPECT_CALL(*appSharedMock, menu_title())
+ .Times(AtLeast(2))
+ .WillRepeatedly(Return(&(*objPtr)[3]));
+ EXPECT_CALL(*appSharedMock, menu_icon())
+ .Times(AtLeast(2))
+ .WillRepeatedly(Return(&(*objPtr)[4]));
+ EXPECT_CALL(*appSharedMock, app_id()).WillRepeatedly(Return(0));
+
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
+
+ EXPECT_FALSE(ptr.empty());
+
+ smart_objects::SmartObject& first = *ptr[0];
+ smart_objects::SmartObject& second = *ptr[1];
+
+ EXPECT_EQ((*objPtr)[0], first[strings::msg_params][strings::vr_help_title]);
+ EXPECT_EQ((*objPtr)[1], first[strings::msg_params][strings::vr_help]);
+ EXPECT_EQ((*objPtr)[2],
+ first[strings::msg_params][strings::keyboard_properties]);
+ EXPECT_EQ((*objPtr)[3], first[strings::msg_params][strings::menu_title]);
+ EXPECT_EQ((*objPtr)[4], first[strings::msg_params][strings::menu_icon]);
+ EXPECT_EQ((*objPtr)[5], second[strings::msg_params][strings::help_prompt]);
+ EXPECT_EQ((*objPtr)[6], second[strings::msg_params][strings::timeout_prompt]);
+}
+
+TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ utils::MakeShared<smart_objects::SmartObject>();
+
+ const smart_objects::SmartObject& object = *smartObjectPtr;
+
+ EXPECT_CALL(*appSharedMock, show_command())
+ .Times(AtLeast(2))
+ .WillRepeatedly(Return(&object));
+
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateShowRequestToHMI(appSharedMock, 0u);
+
+ EXPECT_FALSE(ptr.empty());
+
+ smart_objects::SmartObject& obj = *ptr[0];
+
+ int function_id = static_cast<int>(hmi_apis::FunctionID::UI_Show);
+
+ EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt());
+ EXPECT_EQ(*smartObjectPtr, obj[strings::msg_params]);
+}
+
+TEST(MessageHelperTestCreate,
+ CreateAddCommandRequestToHMI_SendSmartObject_Empty) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ ::application_manager::CommandsMap vis;
+ DataAccessor<application_manager::CommandsMap> data_accessor(vis, true);
+
+ EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor));
+ application_manager_test::MockApplicationManager mock_application_manager;
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateAddCommandRequestToHMI(appSharedMock,
+ mock_application_manager);
+
+ EXPECT_TRUE(ptr.empty());
+}
+
+TEST(MessageHelperTestCreate,
+ CreateAddCommandRequestToHMI_SendSmartObject_Equal) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ CommandsMap vis;
+ DataAccessor<CommandsMap> data_accessor(vis, true);
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ utils::MakeShared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& object = *smartObjectPtr;
+
+ object[strings::menu_params] = 1;
+ object[strings::cmd_icon] = 1;
+ object[strings::cmd_icon][strings::value] = "10";
+
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(5, &object));
+
+ EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor));
+ EXPECT_CALL(*appSharedMock, app_id()).WillOnce(Return(1u));
+ application_manager_test::MockApplicationManager mock_application_manager;
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateAddCommandRequestToHMI(appSharedMock,
+ mock_application_manager);
+
+ EXPECT_FALSE(ptr.empty());
+
+ smart_objects::SmartObject& obj = *ptr[0];
+
+ int function_id = static_cast<int>(hmi_apis::FunctionID::UI_AddCommand);
+
+ EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt());
+ EXPECT_EQ(1u, obj[strings::msg_params][strings::app_id].asUInt());
+ EXPECT_EQ(5, obj[strings::msg_params][strings::cmd_id].asInt());
+ EXPECT_EQ(object[strings::menu_params],
+ obj[strings::msg_params][strings::menu_params]);
+ EXPECT_EQ(object[strings::cmd_icon],
+ obj[strings::msg_params][strings::cmd_icon]);
+ EXPECT_EQ(
+ "10",
+ obj[strings::msg_params][strings::cmd_icon][strings::value].asString());
+}
+
+TEST(MessageHelperTestCreate,
+ CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ application_manager::ChoiceSetMap vis;
+ DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
+
+ EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor));
+ application_manager_test::MockApplicationManager mock_application_manager;
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
+ appSharedMock, mock_application_manager);
+
+ EXPECT_TRUE(ptr.empty());
+}
+
+TEST(MessageHelperTestCreate,
+ CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ application_manager::ChoiceSetMap vis;
+ DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ utils::MakeShared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& object = *smartObjectPtr;
+
+ object[strings::choice_set] = "10";
+ object[strings::grammar_id] = 111;
+ object[strings::choice_set][0][strings::choice_id] = 1;
+ object[strings::choice_set][0][strings::vr_commands] = 2;
+
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(5, &object));
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(6, &object));
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(7, &object));
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(8, &object));
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(9, &object));
+
+ EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor));
+ EXPECT_CALL(*appSharedMock, app_id())
+ .Times(AtLeast(5))
+ .WillRepeatedly(Return(1u));
+ application_manager_test::MockApplicationManager mock_application_manager;
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
+ appSharedMock, mock_application_manager);
+
+ EXPECT_FALSE(ptr.empty());
+
+ int function_id = static_cast<int>(hmi_apis::FunctionID::VR_AddCommand);
+ int type = static_cast<int>(hmi_apis::Common_VRCommandType::Choice);
+
+ smart_objects::SmartObject& obj = *ptr[0];
+
+ EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt());
+ EXPECT_EQ(1u, obj[strings::msg_params][strings::app_id].asUInt());
+ EXPECT_EQ(111u, obj[strings::msg_params][strings::grammar_id].asUInt());
+ EXPECT_EQ(object[strings::choice_set][0][strings::choice_id],
+ obj[strings::msg_params][strings::cmd_id]);
+ EXPECT_EQ(object[strings::choice_set][0][strings::vr_commands],
+ obj[strings::msg_params][strings::vr_commands]);
+ EXPECT_EQ(type, obj[strings::msg_params][strings::type].asInt());
+}
+
+TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ application_manager::SubMenuMap vis;
+ DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ utils::MakeShared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& object = *smartObjectPtr;
+
+ object[strings::position] = 1;
+ object[strings::menu_name] = 1;
+
+ vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(5, &object));
+
+ EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor));
+ EXPECT_CALL(*appSharedMock, app_id()).Times(AtLeast(1)).WillOnce(Return(1u));
+
+ const uint32_t cor_id = 0u;
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateAddSubMenuRequestToHMI(appSharedMock, cor_id);
+
+ EXPECT_FALSE(ptr.empty());
+
+ smart_objects::SmartObject& obj = *ptr[0];
+
+ int function_id = static_cast<int>(hmi_apis::FunctionID::UI_AddSubMenu);
+
+ EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt());
+ EXPECT_EQ(5, obj[strings::msg_params][strings::menu_id].asInt());
+ EXPECT_EQ(1,
+ obj[strings::msg_params][strings::menu_params][strings::position]
+ .asInt());
+ EXPECT_EQ(1,
+ obj[strings::msg_params][strings::menu_params][strings::menu_name]
+ .asInt());
+ EXPECT_EQ(1u, obj[strings::msg_params][strings::app_id].asUInt());
+}
+
+TEST(MessageHelperTestCreate,
+ CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) {
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ application_manager::SubMenuMap vis;
+ DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
+
+ EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor));
+
+ const uint32_t cor_id = 0u;
+ smart_objects::SmartObjectList ptr =
+ MessageHelper::CreateAddSubMenuRequestToHMI(appSharedMock, cor_id);
+
+ EXPECT_TRUE(ptr.empty());
+}
+
+TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) {
+ uint32_t connection_key = 111;
+ int32_t function_id = 222;
+ uint32_t correlation_id = 333u;
+ int32_t result_code = 0;
+
+ smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateNegativeResponse(
+ connection_key, function_id, correlation_id, result_code);
+
+ EXPECT_TRUE(ptr);
+
+ smart_objects::SmartObject& obj = *ptr;
+
+ int objFunction_id = obj[strings::params][strings::function_id].asInt();
+ uint32_t objCorrelation_id =
+ obj[strings::params][strings::correlation_id].asUInt();
+ int objResult_code = obj[strings::msg_params][strings::result_code].asInt();
+ uint32_t objConnection_key =
+ obj[strings::params][strings::connection_key].asUInt();
+
+ int message_type = static_cast<int>(mobile_apis::messageType::response);
+ int protocol_type =
+ static_cast<int>(commands::CommandImpl::mobile_protocol_type_);
+ int protocol_version =
+ static_cast<int>(commands::CommandImpl::protocol_version_);
+ bool success = false;
+
+ EXPECT_EQ(function_id, objFunction_id);
+ EXPECT_EQ(message_type, obj[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(protocol_type,
+ obj[strings::params][strings::protocol_type].asInt());
+ EXPECT_EQ(protocol_version,
+ obj[strings::params][strings::protocol_version].asInt());
+ EXPECT_EQ(correlation_id, objCorrelation_id);
+ EXPECT_EQ(result_code, objResult_code);
+ EXPECT_EQ(success, obj[strings::msg_params][strings::success].asBool());
+ EXPECT_EQ(connection_key, objConnection_key);
+}
+
+class MessageHelperTest : public ::testing::Test {
+ public:
+ MessageHelperTest()
+ : language_strings{"EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB",
+ "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE",
+ "PT-PT", "NL-NL", "EN-AU", "ZH-CN", "ZH-TW", "JA-JP",
+ "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO",
+ "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK"}
+ , hmi_result_strings{"SUCCESS",
+ "UNSUPPORTED_REQUEST",
+ "UNSUPPORTED_RESOURCE",
+ "DISALLOWED",
+ "REJECTED",
+ "ABORTED",
+ "IGNORED",
+ "RETRY",
+ "IN_USE",
+ "DATA_NOT_AVAILABLE",
+ "TIMED_OUT",
+ "INVALID_DATA",
+ "CHAR_LIMIT_EXCEEDED",
+ "INVALID_ID",
+ "DUPLICATE_NAME",
+ "APPLICATION_NOT_REGISTERED",
+ "WRONG_LANGUAGE",
+ "OUT_OF_MEMORY",
+ "TOO_MANY_PENDING_REQUESTS",
+ "NO_APPS_REGISTERED",
+ "NO_DEVICES_CONNECTED",
+ "WARNINGS",
+ "GENERIC_ERROR",
+ "USER_DISALLOWED",
+ "TRUNCATED_DATA"}
+ , mobile_result_strings{"SUCCESS",
+ "UNSUPPORTED_REQUEST",
+ "UNSUPPORTED_RESOURCE",
+ "DISALLOWED",
+ "REJECTED",
+ "ABORTED",
+ "IGNORED",
+ "RETRY",
+ "IN_USE",
+ "VEHICLE_DATA_NOT_AVAILABLE",
+ "TIMED_OUT",
+ "INVALID_DATA",
+ "CHAR_LIMIT_EXCEEDED",
+ "INVALID_ID",
+ "DUPLICATE_NAME",
+ "APPLICATION_NOT_REGISTERED",
+ "WRONG_LANGUAGE",
+ "OUT_OF_MEMORY",
+ "TOO_MANY_PENDING_REQUESTS",
+ "TOO_MANY_APPLICATIONS",
+ "APPLICATION_REGISTERED_ALREADY",
+ "WARNINGS",
+ "GENERIC_ERROR",
+ "USER_DISALLOWED",
+ "UNSUPPORTED_VERSION",
+ "VEHICLE_DATA_NOT_ALLOWED",
+ "FILE_NOT_FOUND",
+ "CANCEL_ROUTE",
+ "TRUNCATED_DATA",
+ "SAVED",
+ "INVALID_CERT",
+ "EXPIRED_CERT",
+ "RESUME_FAILED"}
+ , function_id_strings{"RESERVED",
+ "RegisterAppInterface",
+ "UnregisterAppInterface",
+ "SetGlobalProperties",
+ "ResetGlobalProperties",
+ "AddCommand",
+ "DeleteCommand",
+ "AddSubMenu",
+ "DeleteSubMenu",
+ "CreateInteractionChoiceSet",
+ "PerformInteraction",
+ "DeleteInteractionChoiceSet",
+ "Alert",
+ "Show",
+ "Speak",
+ "SetMediaClockTimer",
+ "PerformAudioPassThru",
+ "EndAudioPassThru",
+ "SubscribeButton",
+ "UnsubscribeButton",
+ "SubscribeVehicleData",
+ "UnsubscribeVehicleData",
+ "GetVehicleData",
+ "ReadDID",
+ "GetDTCs",
+ "ScrollableMessage",
+ "Slider",
+ "ShowConstantTBT",
+ "AlertManeuver",
+ "UpdateTurnList",
+ "ChangeRegistration",
+ "GenericResponse",
+ "PutFile",
+ "DeleteFile",
+ "ListFiles",
+ "SetAppIcon",
+ "SetDisplayLayout",
+ "DiagnosticMessage",
+ "SystemRequest",
+ "SendLocation",
+ "DialNumber"}
+ , events_id_strings{"OnHMIStatus",
+ "OnAppInterfaceUnregistered",
+ "OnButtonEvent",
+ "OnButtonPress",
+ "OnVehicleData",
+ "OnCommand",
+ "OnTBTClientState",
+ "OnDriverDistraction",
+ "OnPermissionsChange",
+ "OnAudioPassThru",
+ "OnLanguageChange",
+ "OnKeyboardInput",
+ "OnTouchEvent",
+ "OnSystemRequest",
+ "OnHashChange"}
+ , hmi_level_strings{"FULL", "LIMITED", "BACKGROUND", "NONE"}
+ , delta_from_functions_id(32768) {}
+
+ protected:
+ application_manager_test::MockApplicationManager mock_application_manager;
+ const StringArray language_strings;
+ const StringArray hmi_result_strings;
+ const StringArray mobile_result_strings;
+ const StringArray function_id_strings;
+ const StringArray events_id_strings;
+ const StringArray hmi_level_strings;
+
+ const size_t delta_from_functions_id;
+};
+
+TEST_F(MessageHelperTest,
+ CommonLanguageFromString_StringValueOfEnum_CorrectEType) {
+ HmiLanguage::eType enum_value;
+ HmiLanguage::eType enum_from_string_value;
+ // Check all languages >= 0
+ for (size_t array_index = 0; array_index < language_strings.size();
+ ++array_index) {
+ enum_value = static_cast<HmiLanguage::eType>(array_index);
+ enum_from_string_value =
+ MessageHelper::CommonLanguageFromString(language_strings[array_index]);
+ EXPECT_EQ(enum_value, enum_from_string_value);
+ }
+ // Check InvalidEnum == -1
+ enum_value = HmiLanguage::INVALID_ENUM;
+ enum_from_string_value = MessageHelper::CommonLanguageFromString("");
+ EXPECT_EQ(enum_value, enum_from_string_value);
+}
+
+TEST_F(MessageHelperTest,
+ CommonLanguageToString_ETypeValueOfEnum_CorrectString) {
+ std::string string_from_enum;
+ HmiLanguage::eType casted_enum;
+ // Check all languages >=0
+ for (size_t array_index = 0; array_index < language_strings.size();
+ ++array_index) {
+ casted_enum = static_cast<HmiLanguage::eType>(array_index);
+ string_from_enum = MessageHelper::CommonLanguageToString(casted_enum);
+ EXPECT_EQ(language_strings[array_index], string_from_enum);
+ }
+ // Check InvalidEnum == -1
+ string_from_enum =
+ MessageHelper::CommonLanguageToString(HmiLanguage::INVALID_ENUM);
+ EXPECT_EQ("", string_from_enum);
+}
+
+TEST_F(MessageHelperTest, ConvertEnumAPINoCheck_AnyEnumType_AnotherEnumType) {
+ hmi_apis::Common_LayoutMode::eType tested_enum_value =
+ hmi_apis::Common_LayoutMode::ICON_ONLY;
+ hmi_apis::Common_AppHMIType::eType converted =
+ MessageHelper::ConvertEnumAPINoCheck<hmi_apis::Common_LayoutMode::eType,
+ hmi_apis::Common_AppHMIType::eType>(
+ tested_enum_value);
+ EXPECT_EQ(hmi_apis::Common_AppHMIType::DEFAULT, converted);
+}
+
+TEST_F(MessageHelperTest, HMIResultFromString_StringValueOfEnum_CorrectEType) {
+ HmiResults::eType enum_value;
+ HmiResults::eType enum_from_string_value;
+ // Check all results >= 0
+ for (size_t array_index = 0; array_index < hmi_result_strings.size();
+ ++array_index) {
+ enum_value = static_cast<HmiResults::eType>(array_index);
+ enum_from_string_value =
+ MessageHelper::HMIResultFromString(hmi_result_strings[array_index]);
+ EXPECT_EQ(enum_value, enum_from_string_value);
+ }
+ // Check InvalidEnum == -1
+ enum_value = HmiResults::INVALID_ENUM;
+ enum_from_string_value = MessageHelper::HMIResultFromString("");
+ EXPECT_EQ(enum_value, enum_from_string_value);
+}
+
+TEST_F(MessageHelperTest, HMIResultToString_ETypeValueOfEnum_CorrectString) {
+ std::string string_from_enum;
+ HmiResults::eType casted_enum;
+ // Check all results >=0
+ for (size_t array_index = 0; array_index < hmi_result_strings.size();
+ ++array_index) {
+ casted_enum = static_cast<HmiResults::eType>(array_index);
+ string_from_enum = MessageHelper::HMIResultToString(casted_enum);
+ EXPECT_EQ(hmi_result_strings[array_index], string_from_enum);
+ }
+ // Check InvalidEnum == -1
+ string_from_enum = MessageHelper::HMIResultToString(HmiResults::INVALID_ENUM);
+ EXPECT_EQ("", string_from_enum);
+}
+
+TEST_F(MessageHelperTest,
+ HMIToMobileResult_HmiResultEType_GetCorrectMobileResultEType) {
+ MobileResults::eType tested_enum;
+ HmiResults::eType casted_hmi_enum;
+ MobileResults::eType converted_enum;
+ // Check enums >=0
+ for (size_t enum_index = 0; enum_index < hmi_result_strings.size();
+ ++enum_index) {
+ tested_enum =
+ MessageHelper::MobileResultFromString(hmi_result_strings[enum_index]);
+ casted_hmi_enum = static_cast<HmiResults::eType>(enum_index);
+ converted_enum = MessageHelper::HMIToMobileResult(casted_hmi_enum);
+ EXPECT_EQ(tested_enum, converted_enum);
+ }
+ // Check invalid enums == -1
+ tested_enum = MobileResults::INVALID_ENUM;
+ converted_enum = MessageHelper::HMIToMobileResult(HmiResults::INVALID_ENUM);
+ EXPECT_EQ(tested_enum, converted_enum);
+ // Check when out of range (true == result.empty())
+ casted_hmi_enum = static_cast<HmiResults::eType>(INT_MAX);
+ converted_enum = MessageHelper::HMIToMobileResult(casted_hmi_enum);
+ EXPECT_EQ(tested_enum, converted_enum);
+}
+
+TEST_F(MessageHelperTest, VerifySoftButtonString_WrongStrings_False) {
+ const StringArray wrong_strings{"soft_button1\t\ntext",
+ "soft_button1\\ntext",
+ "soft_button1\\ttext",
+ " ",
+ "soft_button1\t\n",
+ "soft_button1\\n",
+ "soft_button1\\t"};
+ for (size_t i = 0; i < wrong_strings.size(); ++i) {
+ EXPECT_FALSE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ }
+}
+
+TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) {
+ const StringArray wrong_strings{"soft_button1.text",
+ "soft_button1?text",
+ " asd asdasd .././/",
+ "soft_button1??....asd",
+ "soft_button12313fcvzxc./.,"};
+ for (size_t i = 0; i < wrong_strings.size(); ++i) {
+ EXPECT_TRUE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ }
+}
+
+TEST_F(MessageHelperTest,
+ GetIVISubscriptionRequests_ValidApplication_HmiRequestNotEmpty) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating data acessor
+ application_manager::VehicleInfoSubscriptions vis;
+ DataAccessor<application_manager::VehicleInfoSubscriptions> data_accessor(
+ vis, true);
+ // Calls for ApplicationManager
+ EXPECT_CALL(*appSharedMock, app_id()).WillOnce(Return(1u));
+ EXPECT_CALL(*appSharedMock, SubscribedIVI()).WillOnce(Return(data_accessor));
+
+ smart_objects::SmartObjectList outList =
+ MessageHelper::GetIVISubscriptionRequests(appSharedMock,
+ mock_application_manager);
+ // Expect not empty request
+ EXPECT_FALSE(outList.empty());
+}
+
+TEST_F(MessageHelperTest,
+ ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject object;
+ policy_handler_test::MockPolicySettings policy_settings_;
+ const policy::PolicyHandler policy_handler(policy_settings_,
+ mock_application_manager);
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::ProcessSoftButtons(
+ object, appSharedMock, policy_handler, mock_application_manager);
+ // Expect
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(MessageHelperTest,
+ ProcessSoftButtons_IncorectSoftButonValue_InvalidData) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject object;
+ smart_objects::SmartObject& buttons = object[strings::soft_buttons];
+ // Setting invalid image string to button
+ buttons[0][strings::image][strings::value] = "invalid\\nvalue";
+ policy_handler_test::MockPolicySettings policy_settings_;
+ const policy::PolicyHandler policy_handler(policy_settings_,
+ mock_application_manager);
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::ProcessSoftButtons(
+ object, appSharedMock, policy_handler, mock_application_manager);
+ // Expect
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
+}
+
+TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject image;
+ image[strings::image_type] = mobile_apis::ImageType::STATIC;
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
+ image, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject image;
+ image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
+ // Invalid value
+ image[strings::value] = " ";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
+ image, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
+}
+
+TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject images;
+ images[0][strings::image_type] = mobile_apis::ImageType::STATIC;
+ images[1][strings::image_type] = mobile_apis::ImageType::STATIC;
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
+ images, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(MessageHelperTest,
+ VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject images;
+ images[0][strings::image_type] = mobile_apis::ImageType::DYNAMIC;
+ images[1][strings::image_type] = mobile_apis::ImageType::DYNAMIC;
+ // Invalid values
+ images[0][strings::value] = " ";
+ images[1][strings::value] = "image\\n";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
+ images, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
+}
+
+TEST_F(MessageHelperTest,
+ VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject message;
+ message[0][strings::image][strings::image_type] =
+ mobile_apis::ImageType::STATIC;
+ message[1][strings::image][strings::image_type] =
+ mobile_apis::ImageType::STATIC;
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
+ message, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(MessageHelperTest,
+ VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ // Creating input data for method
+ smart_objects::SmartObject message;
+ message[0][strings::image][strings::image_type] =
+ mobile_apis::ImageType::DYNAMIC;
+ message[1][strings::image][strings::image_type] =
+ mobile_apis::ImageType::DYNAMIC;
+ // Invalid values
+ message[0][strings::image][strings::value] = " ";
+ message[1][strings::image][strings::value] = "image\\n";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
+ message, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
+}
+
+TEST_F(MessageHelperTest,
+ StringifiedFunctionID_FinctionId_EqualsWithStringsInArray) {
+ // Start from 1 because 1 == RESERVED and haven`t ID in last 2 characters
+ // if FUNCTION ID == 1 inner DCHECK is false
+ mobile_apis::FunctionID::eType casted_enum;
+ std::string converted;
+ for (size_t i = 1; i < function_id_strings.size(); ++i) {
+ casted_enum = static_cast<mobile_apis::FunctionID::eType>(i);
+ converted = MessageHelper::StringifiedFunctionID(casted_enum);
+ EXPECT_EQ(function_id_strings[i], converted);
+ }
+ // EventIDs emum strarts from delta_from_functions_id = 32768
+ for (size_t i = delta_from_functions_id;
+ i < events_id_strings.size() + delta_from_functions_id;
+ ++i) {
+ casted_enum = static_cast<mobile_apis::FunctionID::eType>(i);
+ converted = MessageHelper::StringifiedFunctionID(casted_enum);
+ EXPECT_EQ(events_id_strings[i - delta_from_functions_id], converted);
+ }
+}
+
+TEST_F(MessageHelperTest,
+ StringifiedHmiLevel_LevelEnum_EqualsWithStringsInArray) {
+ mobile_apis::HMILevel::eType casted_enum;
+ std::string converted_value;
+ for (size_t i = 0; i < hmi_level_strings.size(); ++i) {
+ casted_enum = static_cast<mobile_apis::HMILevel::eType>(i);
+ converted_value = MessageHelper::StringifiedHMILevel(casted_enum);
+ EXPECT_EQ(hmi_level_strings[i], converted_value);
+ }
+}
+
+TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) {
+ mobile_apis::HMILevel::eType tested_enum;
+ mobile_apis::HMILevel::eType converted_enum;
+ for (size_t i = 0; i < hmi_level_strings.size(); ++i) {
+ tested_enum = static_cast<mobile_apis::HMILevel::eType>(i);
+ converted_enum = MessageHelper::StringToHMILevel(hmi_level_strings[i]);
+ EXPECT_EQ(tested_enum, converted_enum);
+ }
+}
+
+TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
+ // Create application mock
+ MockApplicationSharedPtr appSharedPtr = utils::MakeShared<AppMock>();
+ // Prepare data for method
+ smart_objects::SmartObject message_params;
+ size_t function_id = 1;
+ //
+ EXPECT_CALL(*appSharedPtr,
+ SubscribeToSoftButtons(function_id, SoftButtonID())).Times(1);
+ MessageHelper::SubscribeApplicationToSoftButton(
+ message_params, appSharedPtr, function_id);
+}
+
+} // namespace test
+} // namespace application_manager
diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc
index ec144826a8..34a817d096 100644
--- a/src/components/application_manager/test/mobile_message_handler_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,19 +30,226 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/mobile_message_handler.h"
+
+#include <string>
+#include <ctime>
+#include <algorithm>
+#include <iterator>
+#include <vector>
#include "gmock/gmock.h"
-#include "application_manager/mobile_message_handler.h"
+#include "application_manager/message.h"
+#include "protocol/raw_message.h"
+#include "utils/make_shared.h"
+namespace application_manager {
+namespace test {
+using protocol_handler::RawMessage;
+using protocol_handler::RawMessagePtr;
+using protocol_handler::ServiceType;
+using protocol_handler::MessagePriority;
+using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
+using application_manager::MobileMessageHandler;
+using application_manager::ProtocolVersion;
using ::testing::_;
-namespace application_manager {
+using testing::Return;
+
+namespace {
+
+const unsigned char kJjson_size = 0x5e;
+const unsigned char kCorrelation_id = 0x5c;
+unsigned char binary_header[PROTOCOL_HEADER_V2_SIZE] = {0x20,
+ 0x00,
+ 0x00,
+ 0xf7,
+ 0x00,
+ 0x00,
+ 0x00,
+ kCorrelation_id,
+ 0x00,
+ 0x00,
+ 0x00,
+ kJjson_size};
+
+std::string data(
+ "{\n \"audioStreamingState\" : \"AUDIBLE\",\n \"hmiLevel\" : "
+ "\"FULL\",\n \"systemContext\" : \"MAIN\"\n}\n");
+
+} // namespace
+
+template <class T, class T2, class T3>
+T joiner(T2 begin, T2 end, const T3& data) {
+ T cont(begin, end);
+ std::copy(data.begin(), data.end(), std::back_inserter(cont));
+ return cont;
+}
+
+class MobileMessageHandlerTest : public testing::Test {
+ public:
+ MobileMessageHandlerTest() : connection_key_(1) {}
+
+ protected:
+ RawMessagePtr message_ptr_;
+ const uint32_t connection_key_;
+
+ Message* HandleIncomingMessage(const uint32_t protocol_version,
+ const std::string data,
+ const uint32_t payload_size) {
+ std::vector<uint8_t> full_data = joiner<std::vector<uint8_t> >(
+ binary_header, binary_header + PROTOCOL_HEADER_V2_SIZE, data);
+
+ size_t full_size = sizeof(uint8_t) * full_data.size();
+
+ message_ptr_ = utils::MakeShared<RawMessage>(connection_key_,
+ protocol_version,
+ &full_data[0],
+ full_size,
+ ServiceType::kRpc,
+ payload_size);
+
+ return MobileMessageHandler::HandleIncomingMessageProtocol(message_ptr_);
+ }
+
+ void TestHandlingIncomingMessageWithBinaryDataProtocol(
+ int32_t protocol_version) {
+ // Arrange
+ // Add binary data to json message
+ std::string binary_data("\a\a\a\a");
+ std::string json_plus_binary_data =
+ joiner<std::string>(data.begin(), data.end(), binary_data);
+ size_t full_data_size = json_plus_binary_data.size() * sizeof(uint8_t) +
+ PROTOCOL_HEADER_V2_SIZE;
+
+ // Act
+ size_t payload_size = data.size();
+ Message* message = HandleIncomingMessage(
+ protocol_version, json_plus_binary_data, payload_size);
+
+ // Checks
+ EXPECT_EQ(data, message->json_message());
+ EXPECT_EQ(1, message->connection_key());
+ EXPECT_EQ(247, message->function_id());
+ EXPECT_EQ(protocol_version, message->protocol_version());
+ EXPECT_EQ(0x5c, message->correlation_id());
+ EXPECT_EQ(full_data_size, message->data_size());
+ EXPECT_EQ(payload_size, message->payload_size());
+ EXPECT_TRUE(message->has_binary_data());
+ EXPECT_EQ(MessageType::kNotification, message->type());
+ }
+
+ void TestHandlingIncomingMessageWithoutBinaryDataProtocol(
+ uint32_t protocol_version) {
+ // Arrange
+ size_t payload_size = data.size();
+ size_t full_data_size = data.size() + PROTOCOL_HEADER_V2_SIZE;
+ Message* message =
+ HandleIncomingMessage(protocol_version, data, payload_size);
+
+ // Checks
+ EXPECT_EQ(data, message->json_message());
+ EXPECT_EQ(1, message->connection_key());
+ EXPECT_EQ(247, message->function_id());
+ EXPECT_EQ(protocol_version, (uint32_t)message->protocol_version());
+ EXPECT_EQ(0x5c, message->correlation_id());
+ EXPECT_EQ(full_data_size, message->data_size());
+ EXPECT_EQ(payload_size, message->payload_size());
+ EXPECT_FALSE(message->has_binary_data());
+ EXPECT_EQ(MessageType::kNotification, message->type());
+ }
+
+ MobileMessage CreateMessageForSending(uint32_t protocol_version,
+ uint32_t function_id,
+ uint32_t correlation_id,
+ uint32_t connection_key,
+ const std::string& json_msg,
+ BinaryData* data = NULL) {
+ MobileMessage message = utils::MakeShared<Message>(
+ MessagePriority::FromServiceType(ServiceType::kRpc));
+ message->set_function_id(function_id);
+ message->set_correlation_id(correlation_id);
+ message->set_connection_key(connection_key);
+ message->set_protocol_version(
+ static_cast<ProtocolVersion>(protocol_version));
+ message->set_message_type(MessageType::kNotification);
+ if (data) {
+ message->set_binary_data(data);
+ }
+ if (!json_msg.empty()) {
+ message->set_json_message(json_msg);
+ }
+ return message;
+ }
+
+ void TestHandlingOutgoingMessageProtocolWithoutBinaryData(
+ const uint32_t protocol_version) {
+ // Arrange
+ const uint32_t function_id = 247u;
+ const uint32_t correlation_id = 92u;
+ const uint32_t connection_key = 1u;
+
+ MobileMessage message_to_send = CreateMessageForSending(
+ protocol_version, function_id, correlation_id, connection_key, data);
+ // Act
+ RawMessage* result_message =
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message_to_send);
+
+ std::vector<uint8_t> full_data = joiner<std::vector<uint8_t> >(
+ binary_header, binary_header + PROTOCOL_HEADER_V2_SIZE, data);
+
+ size_t full_size = sizeof(uint8_t) * full_data.size();
+
+ // Checks
+ EXPECT_EQ(protocol_version, result_message->protocol_version());
+ EXPECT_EQ(connection_key, result_message->connection_key());
+ EXPECT_EQ(full_size, result_message->data_size());
+ for (uint8_t i = 0; i < full_data.size(); ++i) {
+ EXPECT_EQ(full_data[i], result_message->data()[i]);
+ }
+ EXPECT_EQ(ServiceType::kRpc, result_message->service_type());
+ }
+
+ void TestHandlingOutgoingMessageProtocolWithBinaryData(
+ const uint32_t protocol_version) {
+ // Arrange
+ BinaryData* bin_dat = new BinaryData;
+ bin_dat->push_back('\a');
+
+ const uint32_t function_id = 247u;
+ const uint32_t correlation_id = 92u;
+ const uint32_t connection_key = 1u;
+
+ MobileMessage message_to_send = CreateMessageForSending(protocol_version,
+ function_id,
+ correlation_id,
+ connection_key,
+ data,
+ bin_dat);
+ // Act
+ RawMessage* result_message =
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message_to_send);
+ std::vector<uint8_t> full_data = joiner<std::vector<uint8_t> >(
+ binary_header, binary_header + PROTOCOL_HEADER_V2_SIZE, data);
+ size_t full_size =
+ sizeof(uint8_t) * full_data.size() + bin_dat->size() * sizeof(uint8_t);
+
+ // Checks
+ EXPECT_EQ(protocol_version, result_message->protocol_version());
+ EXPECT_EQ(connection_key, result_message->connection_key());
+ EXPECT_EQ(full_size, result_message->data_size());
+ for (uint8_t i = 0; i < full_data.size(); ++i) {
+ EXPECT_EQ(full_data[i], result_message->data()[i]);
+ }
+ EXPECT_EQ(0x0F, result_message->service_type());
+ }
+};
TEST(mobile_message_test, basic_test) {
// Example message
- MobileMessage message = new application_manager::Message(
- protocol_handler::MessagePriority::kDefault);
+ MobileMessage message =
+ utils::MakeShared<Message>(protocol_handler::MessagePriority::kDefault);
EXPECT_FALSE(message->has_binary_data());
BinaryData* binary_data = new BinaryData;
binary_data->push_back('X');
@@ -50,4 +257,98 @@ TEST(mobile_message_test, basic_test) {
EXPECT_TRUE(message->has_binary_data());
}
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleIncomingMessageProtocol_MessageWithUnknownProtocolVersion_ExpectNull) {
+ // Arrange
+ size_t payload_size = data.size();
+ std::srand(time(0));
+ // Generate unknown random protocol version except 1-3
+ uint32_t protocol_version = 4 + rand() % UINT32_MAX;
+ Message* message =
+ HandleIncomingMessage(protocol_version, data, payload_size);
+
+ // Checks
+ EXPECT_EQ(NULL, message);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleOutgoingMessageProtocol_MessageWithUnknownProtocolVersion_ExpectNull) {
+ // Arrange
+ std::srand(time(0));
+
+ const uint32_t function_id = 247u;
+ const uint32_t correlation_id = 92u;
+ const uint32_t connection_key = 1u;
+ // Generate unknown random protocol version except 1-3
+ uint32_t protocol_version = 4 + rand() % UINT32_MAX;
+
+ MobileMessage message_to_send = CreateMessageForSending(
+ protocol_version, function_id, correlation_id, connection_key, data);
+ // Act
+ RawMessage* result_message =
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message_to_send);
+
+ // Check
+ EXPECT_EQ(NULL, result_message);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleIncomingMessageProtocol_MessageWithProtocolV2_WithoutBinaryData) {
+ const uint32_t protocol_version = 2u;
+ TestHandlingIncomingMessageWithoutBinaryDataProtocol(protocol_version);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleIncomingMessageProtocol_MessageWithProtocolV3_WithoutBinaryData) {
+ const uint32_t protocol_version = 3u;
+ TestHandlingIncomingMessageWithoutBinaryDataProtocol(protocol_version);
}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleIncomingMessageProtocol_MessageWithProtocolV2_WithBinaryData) {
+ const uint32_t protocol_version = 2u;
+ TestHandlingIncomingMessageWithBinaryDataProtocol(protocol_version);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleIncomingMessageProtocol_MessageWithProtocolV3_WithBinaryData) {
+ const uint32_t protocol_version = 3u;
+ TestHandlingIncomingMessageWithBinaryDataProtocol(protocol_version);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleOutgoingMessageProtocol_MessageWithProtocolV2_WithoutBinaryData) {
+ const uint32_t protocol_version = 2u;
+ TestHandlingOutgoingMessageProtocolWithoutBinaryData(protocol_version);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleOutgoingMessageProtocol_MessageWithProtocolV3_WithoutBinaryData) {
+ const uint32_t protocol_version = 3u;
+ TestHandlingOutgoingMessageProtocolWithoutBinaryData(protocol_version);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleOutgoingMessageProtocol_MessageWithProtocolV2_WithBinaryData) {
+ const uint32_t protocol_version = 2u;
+ TestHandlingOutgoingMessageProtocolWithBinaryData(protocol_version);
+}
+
+TEST_F(
+ MobileMessageHandlerTest,
+ Test_HandleOutgoingMessageProtocol_MessageWithProtocolV3_WithBinaryData) {
+ const uint32_t protocol_version = 3u;
+ TestHandlingOutgoingMessageProtocolWithBinaryData(protocol_version);
+}
+
+} // namespace test
+} // namespace application_manager
diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
new file mode 100644
index 0000000000..8301bf6f18
--- /dev/null
+++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/mobile_message_handler.h"
+
+#include <string>
+#include <vector>
+#include <algorithm>
+#include <iterator>
+
+#include "gmock/gmock.h"
+#include "application_manager/message.h"
+#include "protocol/raw_message.h"
+#include "utils/make_shared.h"
+
+using protocol_handler::RawMessage;
+using protocol_handler::RawMessagePtr;
+using protocol_handler::PROTOCOL_HEADER_V1_SIZE;
+
+namespace application_manager {
+namespace test {
+
+const int32_t connection_key_p1 = 1;
+const int32_t protocol_version_1 = 1;
+
+const std::string data_json(
+ "\"{\"menu\": {\"id\": \"file\",\"va"
+ "lue\": \"File\",\"popup\": {\"menuitem\": [ {\"val"
+ "ue\": \"New\", \"onclick\": \"CreateNe"
+ "wDoc()\"}, {\"value\": \"Open\", \"oncli"
+ "ck\": \"OpenDoc()\"},{\"value\": \"Cl"
+ "ose\", \"onclick\": \"CloseDoc()\"}]}}}\"");
+
+const unsigned char binary[PROTOCOL_HEADER_V1_SIZE] = {
+ 0x20, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10};
+
+const unsigned char* data_v1 =
+ reinterpret_cast<const unsigned char*>(data_json.c_str());
+
+TEST(MobileMessageHandlerTestV1Test,
+ HandleIncomingMessageProtocolV1_SendJSONData_ExpectEqual) {
+ RawMessagePtr message = utils::MakeShared<RawMessage>(
+ connection_key_p1, protocol_version_1, data_v1, data_json.length());
+
+ application_manager::Message* ptr =
+ MobileMessageHandler::HandleIncomingMessageProtocol(message);
+
+ ASSERT_TRUE(ptr);
+
+ EXPECT_EQ(connection_key_p1, ptr->connection_key());
+ EXPECT_EQ(protocol_version_1, ptr->protocol_version());
+ EXPECT_EQ(data_json, ptr->json_message());
+}
+
+TEST(MobileMessageHandlerTestV1Test,
+ HandleIncomingMessageProtocolV1_SendBinaryJSONData_ExpectEqual) {
+ std::string full_data(reinterpret_cast<const char*>(binary));
+ full_data += data_json;
+ const unsigned char* data_v1 =
+ reinterpret_cast<const unsigned char*>(full_data.c_str());
+
+ RawMessagePtr message = utils::MakeShared<RawMessage>(
+ connection_key_p1, protocol_version_1, data_v1, full_data.length());
+
+ application_manager::Message* ptr =
+ MobileMessageHandler::HandleIncomingMessageProtocol(message);
+
+ ASSERT_TRUE(ptr);
+
+ EXPECT_EQ(connection_key_p1, ptr->connection_key());
+ EXPECT_EQ(protocol_version_1, ptr->protocol_version());
+ EXPECT_EQ(full_data, ptr->json_message());
+}
+
+TEST(MobileMessageHandlerTestV1Test,
+ HandleOutgoingMessageProtocol_SendMessage_ExpectEqual) {
+ uint32_t connection_key = 1;
+
+ MobileMessage message =
+ utils::MakeShared<Message>(protocol_handler::MessagePriority::kDefault);
+
+ message->set_protocol_version(application_manager::ProtocolVersion::kV1);
+ message->set_json_message(data_json);
+ message->set_connection_key(connection_key_p1);
+
+ RawMessage* ptr =
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message);
+
+ ASSERT_TRUE(ptr);
+
+ EXPECT_EQ(connection_key, ptr->connection_key());
+ EXPECT_EQ(static_cast<uint32_t>(application_manager::ProtocolVersion::kV1),
+ ptr->protocol_version());
+}
+
+} // namespace test
+} // namespace application_manager
diff --git a/src/components/application_manager/test/mock/include/application_manager/application.h b/src/components/application_manager/test/mock/include/application_manager/application.h
deleted file mode 120000
index 7b86b18d4b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/application.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/application.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
deleted file mode 120000
index a53ea11d5b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/application_data_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_impl.h
deleted file mode 120000
index 838885790a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/application_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/application_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager.h b/src/components/application_manager/test/mock/include/application_manager/application_manager.h
deleted file mode 120000
index d9f08e4c22..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/application_manager.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/application_manager.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
deleted file mode 100644
index bc6a4e6ba4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-#include <stdint.h>
-#include <vector>
-#include <map>
-#include <set>
-#include "application_manager/hmi_command_factory.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/hmi_capabilities.h"
-#include "application_manager/message.h"
-#include "application_manager/request_controller.h"
-#include "application_manager/resume_ctrl.h"
-#include "application_manager/vehicle_info_data.h"
-#include "application_manager/state_controller.h"
-#include "protocol_handler/protocol_observer.h"
-#include "protocol_handler/protocol_handler.h"
-#include "hmi_message_handler/hmi_message_observer.h"
-#include "hmi_message_handler/hmi_message_sender.h"
-
-#include "media_manager/media_manager_impl.h"
-
-#include "connection_handler/connection_handler_observer.h"
-#include "connection_handler/device.h"
-
-#include "formatters/CSmartFactory.hpp"
-
-#include "interfaces/HMI_API.h"
-#include "interfaces/HMI_API_schema.h"
-#include "interfaces/MOBILE_API_schema.h"
-
-#include "interfaces/v4_protocol_v1_2_no_extra.h"
-#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
-#ifdef TIME_TESTER
-#include "time_metric_observer.h"
-#endif // TIME_TESTER
-
-#include "utils/macro.h"
-#include "utils/shared_ptr.h"
-#include "utils/message_queue.h"
-#include "utils/prioritized_queue.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/message_loop_thread.h"
-#include "utils/lock.h"
-#include "utils/singleton.h"
-
-namespace application_manager {
- enum VRTTSSessionChanging {
- kVRSessionChanging = 0,
- kTTSSessionChanging
- };
-
-namespace impl {
-
-struct MessageFromMobile: public utils::SharedPtr<Message> {
- explicit MessageFromMobile(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {
- }
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-struct MessageToMobile: public utils::SharedPtr<Message> {
- explicit MessageToMobile(const utils::SharedPtr<Message>& message,
- bool final_message)
- : utils::SharedPtr<Message>(message),
- is_final(final_message) {
- }
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
- // Signals if connection to mobile must be closed after sending this message
- bool is_final;
-};
-
-struct MessageFromHmi: public utils::SharedPtr<Message> {
- explicit MessageFromHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {
- }
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-struct MessageToHmi: public utils::SharedPtr<Message> {
- explicit MessageToHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {
- }
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> > FromMobileQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> > ToMobileQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> > FromHmiQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> > ToHmiQueue;
-
-// AudioPassThru
-typedef struct {
-std::vector<uint8_t> binary_data;
-int32_t session_key;
-} AudioData;
-typedef std::queue<AudioData> RawAudioDataQueue;
-typedef threads::MessageLoopThread<RawAudioDataQueue> AudioPassThruQueue;
-}
-typedef std::vector<std::string> RPCParams;
-
-class ApplicationManagerImpl : public ApplicationManager,
- public hmi_message_handler::HMIMessageObserver,
- public protocol_handler::ProtocolObserver,
- public connection_handler::ConnectionHandlerObserver,
- public impl::FromMobileQueue::Handler, public impl::ToMobileQueue::Handler,
- public impl::FromHmiQueue::Handler, public impl::ToHmiQueue::Handler,
- public impl::AudioPassThruQueue::Handler,
- public utils::Singleton<ApplicationManagerImpl> {
-
- friend class ResumeCtrl;
- friend class CommandImpl;
-
- public:
- ApplicationManagerImpl() {
- std::cout << "ApplicationManagerImpl Mock created " << std::endl;
- }
-
- MOCK_METHOD0(Init, bool());
- MOCK_METHOD0(Stop, bool());
- MOCK_METHOD1(OnMessageReceived, void (utils::SharedPtr<application_manager::Message>));
- MOCK_METHOD1(OnErrorSending, void (utils::SharedPtr<application_manager::Message>));
- MOCK_METHOD1(OnMessageReceived, void (const ::protocol_handler::RawMessagePtr));
- MOCK_METHOD1(OnMobileMessageSent, void (const ::protocol_handler::RawMessagePtr));
- MOCK_METHOD1(OnDeviceListUpdated, void (const connection_handler::DeviceMap&));
- MOCK_METHOD0(OnFindNewApplicationsRequest, void ());
- MOCK_METHOD1(RemoveDevice, void (const connection_handler::DeviceHandle&));
- MOCK_METHOD3(OnServiceStartedCallback, bool (const connection_handler::DeviceHandle&,
- const int32_t&,
- const protocol_handler::ServiceType&));
- MOCK_METHOD3(OnServiceEndedCallback, void (const int32_t&,
- const protocol_handler::ServiceType&,
- const connection_handler::CloseSessionReason&));
- MOCK_METHOD1(Handle, void (const impl::MessageFromMobile));
- MOCK_METHOD1(Handle, void (const impl::MessageToMobile));
- MOCK_METHOD1(Handle, void (const impl::MessageFromHmi));
- MOCK_METHOD1(Handle, void (const impl::MessageToHmi));
- MOCK_METHOD1(Handle, void (const impl::AudioData));
-
- //ApplicationManager methods
- MOCK_METHOD1(set_hmi_message_handler, void (hmi_message_handler::HMIMessageHandler*));
- MOCK_METHOD1(set_protocol_handler, void (protocol_handler::ProtocolHandler*));
- MOCK_METHOD1(set_connection_handler, void (connection_handler::ConnectionHandler*));
-
- //ApplicationManagerImpl methods:
-#ifdef TIME_TESTER
- MOCK_METHOD1(SetTimeMetricObserver, void(AMMetricObserver*));
-#endif
- MOCK_METHOD1(RegisterApplication,
- ApplicationSharedPtr(const utils::SharedPtr<smart_objects::SmartObject>&));
- MOCK_METHOD0(hmi_capabilities, HMICapabilities& ());
- MOCK_METHOD1(ProcessQueryApp, void (const smart_objects::SmartObject& sm_object));
- MOCK_METHOD1(ManageHMICommand, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
- MOCK_METHOD1(ManageMobileCommand, bool (const utils::SharedPtr<smart_objects::SmartObject>& message));
- MOCK_METHOD1(SendMessageToHMI, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
- MOCK_METHOD2(SendMessageToMobile, bool (const utils::SharedPtr<smart_objects::SmartObject>&,
- bool));
- MOCK_METHOD1(SendMessageToMobile, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
- MOCK_METHOD1(GetDeviceName, std::string (connection_handler::DeviceHandle));
- MOCK_METHOD1(GetDeviceTransportType, hmi_apis::Common_TransportType::eType (const std::string&));
- MOCK_METHOD1(application, ApplicationSharedPtr (uint32_t));
- MOCK_METHOD1(application_by_policy_id, ApplicationSharedPtr (const std::string&));
- MOCK_METHOD1(RemoveAppDataFromHMI, bool(ApplicationSharedPtr));
- MOCK_METHOD1(HeadUnitReset, void(mobile_api::AppInterfaceUnregisteredReason::eType));
- MOCK_METHOD1(LoadAppDataToHMI, bool(ApplicationSharedPtr));
- MOCK_METHOD1(ActivateApplication, bool (ApplicationSharedPtr));
- MOCK_METHOD1(IsHmiLevelFullAllowed, mobile_api::HMILevel::eType (ApplicationSharedPtr));
- MOCK_METHOD3(OnHMILevelChanged, void (uint32_t, mobile_apis::HMILevel::eType, mobile_apis::HMILevel::eType));
- MOCK_METHOD2(UnregisterRevokedApplication, void(uint32_t, mobile_apis::Result::eType));
- MOCK_METHOD1(SetUnregisterAllApplicationsReason, void(mobile_api::AppInterfaceUnregisteredReason::eType));
- MOCK_METHOD0(UnregisterAllApplications, void());
- MOCK_METHOD0(connection_handler, connection_handler::ConnectionHandler*());
- MOCK_METHOD0(protocol_handler, protocol_handler::ProtocolHandler*());
- MOCK_METHOD0(hmi_message_handler, hmi_message_handler::HMIMessageHandler*());
- MOCK_METHOD5(CheckPolicyPermissions, mobile_apis::Result::eType(const std::string&,
- mobile_apis::HMILevel::eType,
- mobile_apis::FunctionID::eType,
- const RPCParams&,
- CommandParametersPermissions*));
- MOCK_METHOD3(updateRequestTimeout, void(uint32_t, uint32_t, uint32_t));
- MOCK_METHOD0(GenerateGrammarID, uint32_t());
- MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
- MOCK_METHOD1(GetAvailableSpaceForApp, uint32_t(const std::string&));
- MOCK_METHOD0(begin_audio_pass_thru, bool ());
- MOCK_METHOD0(end_audio_pass_thru, uint32_t());
- MOCK_METHOD1(StopAudioPassThru, void(uint32_t));
- MOCK_METHOD1(applications_by_button, std::vector<ApplicationSharedPtr>(uint32_t));
- MOCK_METHOD0(applications_with_navi, std::vector<ApplicationSharedPtr>());
- MOCK_METHOD1(applications_by_ivi, std::vector<ApplicationSharedPtr>(uint32_t));
- MOCK_METHOD2(IviInfoUpdated, std::vector<utils::SharedPtr<Application>> (VehicleDataType,
- int));
- MOCK_METHOD6(StartAudioPassThruThread, void(uint32_t, uint32_t, uint32_t,
- uint32_t, uint32_t, uint32_t));
- MOCK_METHOD4(SaveBinary, mobile_apis::Result::eType(const std::vector<uint8_t>&,
- const std::string&,
- const std::string&,
- const int64_t));
- MOCK_METHOD1(ReplaceHMIByMobileAppId, void(smart_objects::SmartObject&));
- MOCK_METHOD1(ReplaceMobileByHMIAppId, void(smart_objects::SmartObject&));
- MOCK_METHOD0(resume_controller, ResumeCtrl&());
- MOCK_METHOD1(GetDefaultHmiLevel, mobile_api::HMILevel::eType (ApplicationSharedPtr));
-
- MOCK_METHOD2(HMILevelAllowsStreaming, bool(uint32_t, protocol_handler::ServiceType));
- MOCK_METHOD2(CanAppStream, bool(uint32_t, protocol_handler::ServiceType));
- MOCK_METHOD1(EndNaviServices, void(int32_t));
- MOCK_METHOD1(ForbidStreaming, void(int32_t));
- MOCK_METHOD3(OnAppStreaming, void(int32_t, protocol_handler::ServiceType, bool));
-
- MOCK_METHOD1(Unmute, void(VRTTSSessionChanging));
- MOCK_METHOD1(Mute, void(VRTTSSessionChanging));
- MOCK_METHOD2(set_application_id, void(const int32_t, const uint32_t));
- MOCK_METHOD1(application_id, uint32_t(const int32_t));
- MOCK_METHOD1(removeNotification, void(const commands::Command*));
- MOCK_METHOD1(addNotification, void(const CommandSharedPtr ));
- MOCK_METHOD0(StartDevicesDiscovery, void());
- MOCK_METHOD2(SendAudioPassThroughNotification, void(uint32_t, std::vector<uint8_t>&));
- MOCK_METHOD1(set_all_apps_allowed, void(const bool));
- MOCK_METHOD4(CreateRegularState, HmiStatePtr (uint32_t, mobile_api::HMILevel::eType,
- mobile_apis::AudioStreamingState::eType,
- mobile_apis::SystemContext::eType));
-
- template<bool SendActivateApp>
- MOCK_METHOD2(SetState, void(uint32_t, HmiState));
- template<bool SendActivateApp>
- MOCK_METHOD2(SetState, void(uint32_t, mobile_api::HMILevel::eType));
- template<bool SendActivateApp>
- MOCK_METHOD3(SetState, void(uint32_t, mobile_api::HMILevel::eType,
- mobile_apis::AudioStreamingState::eType));
- template<bool SendActivateApp>
- MOCK_METHOD4(SetState, void(uint32_t, mobile_api::HMILevel::eType,
- mobile_apis::AudioStreamingState::eType,
- mobile_apis::SystemContext::eType));
- MOCK_METHOD2(SetState, void(uint32_t,
- mobile_apis::AudioStreamingState::eType));
-
- MOCK_CONST_METHOD0(all_apps_allowed, bool());
- MOCK_METHOD1(set_vr_session_started, void(const bool));
- MOCK_CONST_METHOD0(vr_session_started, bool());
- MOCK_METHOD1(set_driver_distraction, void(const bool));
- MOCK_CONST_METHOD0(driver_distraction, bool());
- MOCK_METHOD1(ConnectToDevice, void(uint32_t));
- MOCK_METHOD0(OnHMIStartedCooperation, void());
- MOCK_METHOD0(GetNextHMICorrelationID, uint32_t ());
- MOCK_CONST_METHOD0(IsHMICooperating, bool());
- MOCK_METHOD0(OnTimerSendTTSGlobalProperties, void());
- MOCK_METHOD0(CreatePhoneCallAppList, void());
- MOCK_METHOD0(ResetPhoneCallAppList, void());
- MOCK_METHOD2(ChangeAppsHMILevel, void(uint32_t, mobile_apis::HMILevel::eType));
- MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t));
- MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList, void(const uint32_t));
- MOCK_METHOD1(application_by_hmi_app, ApplicationSharedPtr(uint32_t));
- MOCK_METHOD2(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType));
- MOCK_METHOD3(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType,
- bool));
- MOCK_METHOD4(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType,
- bool, bool));
- MOCK_METHOD1(OnAppUnauthorized, void(const uint32_t&));
- MOCK_CONST_METHOD0(get_limited_media_application, ApplicationSharedPtr());
- MOCK_CONST_METHOD0(get_limited_navi_application, ApplicationSharedPtr());
- MOCK_CONST_METHOD0(get_limited_voice_application, ApplicationSharedPtr());
- MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited, bool(ApplicationSharedPtr));
- MOCK_CONST_METHOD0(active_application, ApplicationSharedPtr ());
- MOCK_METHOD0(OnApplicationListUpdateTimer, void());
- MOCK_METHOD0(OnLowVoltage, void());
- MOCK_METHOD0(OnWakeUp, void());
- MOCK_METHOD1(OnUpdateHMIAppType, void(std::map<std::string, std::vector<std::string> >));
- MOCK_METHOD3(set_state, void(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType,
- mobile_apis::AudioStreamingState::eType));
-MOCK_CONST_METHOD0(IsStopping, bool());
-
- struct ApplicationsAppIdSorter {
- bool operator() (const ApplicationSharedPtr lhs,
- const ApplicationSharedPtr rhs) {
- return lhs->app_id() < rhs->app_id();
- }
- };
-
- // typedef for Applications list
- typedef std::set<ApplicationSharedPtr,
- ApplicationsAppIdSorter> ApplictionSet;
-
- // typedef for Applications list iterator
- typedef ApplictionSet::iterator ApplictionSetIt;
-
- // typedef for Applications list const iterator
- typedef ApplictionSet::const_iterator ApplictionSetConstIt;
-
-
- /**
- * Class for thread-safe access to applications list
- */
- class ApplicationListAccessor: public DataAccessor<ApplictionSet> {
- public:
- ApplicationListAccessor() :
- DataAccessor<ApplictionSet>(ApplictionSet(),sync_primitives::Lock()) {
- }
- MOCK_CONST_METHOD0(applications, const ApplictionSet());
- MOCK_METHOD0(begin, ApplictionSetConstIt());
- MOCK_METHOD0(end, ApplictionSetConstIt());
- MOCK_METHOD1(Erase, void(ApplicationSharedPtr));
- MOCK_METHOD1(Insert, void(ApplicationSharedPtr));
- MOCK_METHOD0(Empty, bool());
- };
-
- friend class ApplicationListAccessor;
-
-
- class ApplicationListUpdateTimer : public timer::TimerThread<ApplicationManagerImpl> {
- public:
- ApplicationListUpdateTimer(ApplicationManagerImpl* callee) :
- timer::TimerThread<ApplicationManagerImpl>("AM ListUpdater",
- callee, &ApplicationManagerImpl::OnApplicationListUpdateTimer
- ) {
- }
- };
- typedef utils::SharedPtr<ApplicationListUpdateTimer> ApplicationListUpdateTimerSptr;
-
-
- private:
- //FIXME(AKutsan) In resume_controller is is nessesery to change realisation for remove using application_list_
- ApplictionSet application_list_;
- FRIEND_BASE_SINGLETON_CLASS(ApplicationManagerImpl);
-};
-
-} //application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command.h b/src/components/application_manager/test/mock/include/application_manager/commands/command.h
deleted file mode 120000
index 07b2c07963..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/command.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
deleted file mode 120000
index eb9e9576d1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/command_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h
deleted file mode 120000
index 1e3d6f0afe..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/command_notification_from_mobile_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
deleted file mode 120000
index 2b946196d2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/command_notification_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
deleted file mode 120000
index 953008ead7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/command_request_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
deleted file mode 120000
index 71136ecbf9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/command_response_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
deleted file mode 120000
index 5ebc425677..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/activate_app_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
deleted file mode 120000
index 74e0b401ae..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/activate_app_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
deleted file mode 120000
index 0a68ef8aa0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/add_statistics_info_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
deleted file mode 120000
index f110d55969..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/allow_all_apps_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
deleted file mode 120000
index 5d81eebc08..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/allow_all_apps_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
deleted file mode 120000
index 4674c56259..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/allow_app_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
deleted file mode 120000
index a972bbe3fe..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/allow_app_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
deleted file mode 120000
index a7f0223e3e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
deleted file mode 120000
index 4190191f1b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/basic_communication_system_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
deleted file mode 120000
index 62e9bdbac4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/basic_communication_system_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
deleted file mode 120000
index 8262591764..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/button_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
deleted file mode 120000
index 8ca8d92829..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/button_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
deleted file mode 120000
index bac5ced3ba..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/close_popup_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
deleted file mode 120000
index 607da1f8bb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/close_popup_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
deleted file mode 120000
index 45a17a4c4d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/get_system_info_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
deleted file mode 120000
index dd46df23e7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/get_system_info_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
deleted file mode 120000
index 68789b0a50..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/get_urls.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
deleted file mode 120000
index b76a19d07b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/get_urls_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
deleted file mode 120000
index 73c501170c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/mixing_audio_supported_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
deleted file mode 120000
index 041b46c653..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/mixing_audio_supported_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
deleted file mode 120000
index 9b879237eb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_alert_maneuver_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
deleted file mode 120000
index 4ed6ec165d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_alert_maneuver_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
deleted file mode 120000
index 0c83f540ae..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_audio_start_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
deleted file mode 120000
index fd9ca2d591..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_audio_start_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
deleted file mode 120000
index 3b9a69ee37..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_audio_stop_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
deleted file mode 120000
index 46c13499ce..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_audio_stop_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
deleted file mode 120000
index beff169e82..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
deleted file mode 120000
index e1c9b1266f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
deleted file mode 120000
index c3f11a7981..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_send_location_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
deleted file mode 120000
index 8728efe1e7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_send_location_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
deleted file mode 120000
index 82bb72563c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_show_constant_tbt_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
deleted file mode 120000
index 116c2428d1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_show_constant_tbt_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
deleted file mode 120000
index 9f6e2036f4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_start_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
deleted file mode 120000
index 788f569dd1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_start_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
deleted file mode 120000
index 433340adb1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_stop_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
deleted file mode 120000
index 5015565371..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_stop_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
deleted file mode 120000
index 2d8888a1b8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_update_turn_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
deleted file mode 120000
index 37f5dcf4b9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/navi_update_turn_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
deleted file mode 120000
index d2fb7da954..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/notification_from_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
deleted file mode 120000
index cd2036c6cb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/notification_to_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
deleted file mode 120000
index 7088e09776..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
deleted file mode 120000
index e3dee83334..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_app_activated_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
deleted file mode 120000
index 3db5068c21..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_app_deactivated_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
deleted file mode 120000
index 698c66aeeb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_app_permission_changed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
deleted file mode 120000
index 4feacfd699..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_app_permission_consent_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
deleted file mode 120000
index 8c6b32f1bd..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_app_registered_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
deleted file mode 120000
index e5a5bc23cd..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_app_unregistered_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
deleted file mode 120000
index 5276b6e208..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_button_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
deleted file mode 120000
index 89460e876d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_button_press_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h
deleted file mode 120000
index f35c69137b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_button_subscription_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
deleted file mode 120000
index 3cceadabde..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_device_chosen_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
deleted file mode 120000
index 87c152730e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_device_state_changed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
deleted file mode 120000
index 8d7b4e9990..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_driver_distraction_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h
deleted file mode 120000
index 4458ec5028..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_emergency_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
deleted file mode 120000
index 482ae71548..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_exit_all_applications_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
deleted file mode 120000
index ebe9dc9b9f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_exit_application_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
deleted file mode 120000
index bec80bf2c9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_file_removed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
deleted file mode 120000
index 5c427c8837..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_find_applications.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
deleted file mode 120000
index 8caf1afa59..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
deleted file mode 120000
index 2ef1136e29..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h
deleted file mode 120000
index 4ab1c99860..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_phone_call_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
deleted file mode 120000
index 21fd85dac3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_play_tone_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
deleted file mode 120000
index fb8c782b83..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_policy_update.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
deleted file mode 120000
index 61c4005e46..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_put_file_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
deleted file mode 120000
index 735af42379..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ready_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
deleted file mode 120000
index c53f1ce658..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_received_policy_update.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
deleted file mode 120000
index 733827254b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_record_start_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
deleted file mode 120000
index f7b6f6bba1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_resume_audio_source_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
deleted file mode 120000
index a8cd1db472..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_sdl_close_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
deleted file mode 120000
index 531002efa6..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
deleted file mode 120000
index 2a8c51814d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
deleted file mode 120000
index 459d55684a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_start_device_discovery.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
deleted file mode 120000
index 5304b2fcbe..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_status_update_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
deleted file mode 120000
index 4403b0fc90..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_system_context_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
deleted file mode 120000
index 8612089978..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_system_error_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
deleted file mode 120000
index 9bfb39bb89..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_system_info_changed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
deleted file mode 120000
index 923cbe7956..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_system_request_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
deleted file mode 120000
index 2ad7fd6287..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_tts_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
deleted file mode 120000
index e91f381a03..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
deleted file mode 120000
index c5c748cecc..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_tts_started_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
deleted file mode 120000
index d40bc7ffb5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_tts_stopped_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
deleted file mode 120000
index 86b7591eb3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ui_command_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
deleted file mode 120000
index 04873772df..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
deleted file mode 120000
index 419745c084..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ui_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
deleted file mode 120000
index 3a68034b36..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
deleted file mode 120000
index 86531d491e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_ui_touch_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
deleted file mode 120000
index 2a6c0c4acf..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_update_device_list.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
deleted file mode 120000
index 35f259dd5b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
deleted file mode 120000
index 2ca86120d9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_belt_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
deleted file mode 120000
index c0ff7d8c27..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_body_information_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
deleted file mode 120000
index 4f32e21534..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_device_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
deleted file mode 120000
index 01fc3fdf49..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_driver_braking_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
deleted file mode 120000
index a2f074b766..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_engine_torque_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
deleted file mode 120000
index aef5bd9136..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_external_temperature_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
deleted file mode 120000
index 1f63c652b3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_fuel_level_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
deleted file mode 120000
index 2f8a4a8aab..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
deleted file mode 120000
index 9fcf1f9808..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_gps_data_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
deleted file mode 120000
index c837834b48..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
deleted file mode 120000
index bdbbf718b9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
deleted file mode 120000
index d1d9ed76b4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_my_key_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
deleted file mode 120000
index d1b3715060..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_odometer_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
deleted file mode 120000
index 1e5fe3c22e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_prndl_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
deleted file mode 120000
index 1be92ae38c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_rpm_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
deleted file mode 120000
index 6ed9e5a224..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_speed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
deleted file mode 120000
index 7dbf52e868..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
deleted file mode 120000
index d86bd602c9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
deleted file mode 120000
index a86015d35e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
deleted file mode 120000
index 4d055a2dbe..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_vin_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
deleted file mode 120000
index 0de802fea8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vi_wiper_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
deleted file mode 120000
index ca58b0c54c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vr_command_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
deleted file mode 120000
index 0ee1334d1c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vr_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
deleted file mode 120000
index 3ad1e6a4c2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vr_started_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
deleted file mode 120000
index b230685cf3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/on_vr_stopped_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
deleted file mode 120000
index cc64e0435d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/request_from_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
deleted file mode 120000
index 8f4f9bfc62..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/request_to_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
deleted file mode 120000
index 7352ba5033..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/response_from_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
deleted file mode 120000
index eea5e52522..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/response_to_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
deleted file mode 120000
index dbd2927575..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_activate_app_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
deleted file mode 120000
index 359281f715..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_activate_app_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
deleted file mode 120000
index 852f46c8e7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
deleted file mode 120000
index aabab692de..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
deleted file mode 120000
index 19aea33e82..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_get_status_update_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
deleted file mode 120000
index 2b8a3579e2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_get_status_update_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
deleted file mode 120000
index a7de550338..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
deleted file mode 120000
index 888023b1c7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
deleted file mode 120000
index fce6df879e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_policy_update.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
deleted file mode 120000
index 32c5d5c9d0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/sdl_policy_update_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
deleted file mode 120000
index 07988fae12..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
deleted file mode 120000
index a3f6db17e4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
deleted file mode 120000
index bf50cc1ea8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
deleted file mode 120000
index 2b3a1013ec..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
deleted file mode 120000
index 11363e063d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_get_language_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
deleted file mode 120000
index a60f44c467..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_get_language_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
deleted file mode 120000
index f3f6d97664..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_get_supported_languages_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
deleted file mode 120000
index 855129ba90..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_get_supported_languages_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
deleted file mode 120000
index 76a09f3446..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
deleted file mode 120000
index 42e69db575..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
deleted file mode 120000
index 6ec0b44a60..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_set_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
deleted file mode 120000
index 0067742926..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_set_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
deleted file mode 120000
index 09dd90b890..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_speak_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
deleted file mode 120000
index af8a6598fe..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_speak_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
deleted file mode 120000
index 8d32593fd1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_stop_speaking_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
deleted file mode 120000
index d8cec177c0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/tts_stop_speaking_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
deleted file mode 120000
index 7c8ecca061..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_add_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
deleted file mode 120000
index c48d437da7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_add_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
deleted file mode 120000
index 07ed923893..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_add_submenu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
deleted file mode 120000
index 1fb095cc44..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_add_submenu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
deleted file mode 120000
index 576c8967ae..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_alert_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
deleted file mode 120000
index 78b58a1b20..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_alert_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
deleted file mode 120000
index ae2a74d2ab..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
deleted file mode 120000
index 4a207b3ea7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
deleted file mode 120000
index cd78986534..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_delete_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
deleted file mode 120000
index 0421c44faa..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_delete_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
deleted file mode 120000
index 4afa039810..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_delete_submenu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
deleted file mode 120000
index 4374dea7cc..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_delete_submenu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
deleted file mode 120000
index c19af2221d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
deleted file mode 120000
index 20a9a7ff12..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
deleted file mode 120000
index c999d31f26..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
deleted file mode 120000
index 4d8267f2de..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
deleted file mode 120000
index b5a3e98402..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_get_language_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
deleted file mode 120000
index e06614fba2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_get_language_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
deleted file mode 120000
index 90bedce441..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_get_supported_languages_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
deleted file mode 120000
index ae94b347bb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_get_supported_languages_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
deleted file mode 120000
index 53e9aadbb2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
deleted file mode 120000
index b2e926541a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
deleted file mode 120000
index 8255ac277f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
deleted file mode 120000
index 3b26071854..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
deleted file mode 120000
index 668e395635..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_perform_interaction_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
deleted file mode 120000
index 30e74367b6..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_perform_interaction_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
deleted file mode 120000
index c554acc317..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_scrollable_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
deleted file mode 120000
index e5bb7ab1b2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_scrollable_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h
deleted file mode 120000
index d79aae3c4d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_app_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h
deleted file mode 120000
index d961f29dcc..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_app_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
deleted file mode 120000
index f4d379ef2e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_display_layout_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
deleted file mode 120000
index e09307f1e2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_display_layout_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
deleted file mode 120000
index 09760bc97f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
deleted file mode 120000
index 7975cd942c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
deleted file mode 120000
index 8d3d935498..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
deleted file mode 120000
index 6415eaf205..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
deleted file mode 120000
index 65d9c7fbd4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
deleted file mode 120000
index 3035e4f461..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
deleted file mode 120000
index 5669790e29..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_show_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
deleted file mode 120000
index 22d0aab4ab..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_show_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
deleted file mode 120000
index bc7ee7f1b7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_slider_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
deleted file mode 120000
index b630730e4f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/ui_slider_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
deleted file mode 120000
index 28a8e01032..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/update_app_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
deleted file mode 120000
index 11af157345..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/update_app_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
deleted file mode 120000
index bf55fd6c45..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/update_device_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
deleted file mode 120000
index 87653d8d0d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/update_device_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
deleted file mode 120000
index 116a6c36c8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/update_sdl_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
deleted file mode 120000
index d12d01f24f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/update_sdl_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
deleted file mode 120000
index d11b2d66cb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_diagnostic_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
deleted file mode 120000
index a9874fb19c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_diagnostic_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
deleted file mode 120000
index 5e5516e662..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_dtcs_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
deleted file mode 120000
index 378b95743b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_dtcs_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
deleted file mode 120000
index 2dde6fcea0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
deleted file mode 120000
index abc1bbb910..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
deleted file mode 120000
index 0f5636732a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
deleted file mode 120000
index cbde6eb303..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
deleted file mode 120000
index 534638fb6e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_type_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
deleted file mode 120000
index d346b466cc..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_type_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
deleted file mode 120000
index 2b345707b5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
deleted file mode 120000
index 95ba17d5e5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
deleted file mode 120000
index de1f2ac0d6..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_read_did_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
deleted file mode 120000
index 2ba6a58d24..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_read_did_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
deleted file mode 120000
index 61ddc3a548..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
deleted file mode 120000
index 0822b5732a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
deleted file mode 120000
index 485cc17afe..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
deleted file mode 120000
index 6790cc663c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
deleted file mode 120000
index 786a8cabe9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
deleted file mode 120000
index c95c2267a1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
deleted file mode 120000
index 7fe6df28ee..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
deleted file mode 120000
index aed21a8296..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
deleted file mode 120000
index 7fe9944f31..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_add_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
deleted file mode 120000
index 734f31c8d4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_add_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
deleted file mode 120000
index d8e68ce6d9..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
deleted file mode 120000
index b220b61c94..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
deleted file mode 120000
index 864ab3d817..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_delete_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
deleted file mode 120000
index 02be59d164..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_delete_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
deleted file mode 120000
index 48f24ad628..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
deleted file mode 120000
index e5f7e2d645..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
deleted file mode 120000
index a625a08837..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_get_language_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
deleted file mode 120000
index 8facd3e436..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_get_language_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
deleted file mode 120000
index df9ab1ed8d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_get_supported_languages_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
deleted file mode 120000
index dbd01ab4ff..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_get_supported_languages_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
deleted file mode 120000
index 79cbd18e87..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
deleted file mode 120000
index b9db7f3fda..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
deleted file mode 120000
index c26f6f8237..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_perform_interaction_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
deleted file mode 120000
index 6dcda065e2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/hmi/vr_perform_interaction_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
deleted file mode 120000
index cbae637fe0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/add_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
deleted file mode 120000
index d2bd280607..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/add_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
deleted file mode 120000
index e2e5940aae..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/add_sub_menu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
deleted file mode 120000
index fdac5156c3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/add_sub_menu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
deleted file mode 120000
index ff657e3327..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/alert_maneuver_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
deleted file mode 120000
index b78ff30d89..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/alert_maneuver_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
deleted file mode 120000
index c251277605..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/alert_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
deleted file mode 120000
index 42269e9ed6..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/alert_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
deleted file mode 120000
index aa92e20658..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
deleted file mode 120000
index b0cb006227..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
deleted file mode 120000
index 64357af6c8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/create_interaction_choice_set_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
deleted file mode 120000
index eb4145c228..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/create_interaction_choice_set_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
deleted file mode 120000
index d7187ab756..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
deleted file mode 120000
index 4d877b7cdb..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
deleted file mode 120000
index 7f82ed14e0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_file_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
deleted file mode 120000
index f419031684..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_file_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
deleted file mode 120000
index d1ac513649..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_interaction_choice_set_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
deleted file mode 120000
index abf9ed5eb5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_interaction_choice_set_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
deleted file mode 120000
index 10baa78dd3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_sub_menu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
deleted file mode 120000
index 22f6561919..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/delete_sub_menu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
deleted file mode 120000
index cfc9d7bc38..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/diagnostic_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
deleted file mode 120000
index 73fe20f089..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/diagnostic_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
deleted file mode 120000
index c448f3a5aa..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/dial_number_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
deleted file mode 120000
index 331f7b8cca..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/end_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
deleted file mode 120000
index 7b7eff611e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/end_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
deleted file mode 120000
index 10f5e3b009..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/generic_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
deleted file mode 120000
index 995fb84419..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/get_dtcs_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
deleted file mode 120000
index 53786a9163..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/get_dtcs_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
deleted file mode 120000
index 18e2658a63..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/get_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
deleted file mode 120000
index 9641c9cb72..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/get_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
deleted file mode 120000
index 633ee9dda3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/list_files_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
deleted file mode 120000
index 75443a836e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/list_files_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
deleted file mode 120000
index 82c74342aa..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
deleted file mode 120000
index 7cf9f3d1c0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_audio_pass_thru_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
deleted file mode 120000
index d41cba2c0c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_button_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
deleted file mode 120000
index 7ef855750a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_button_press_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
deleted file mode 120000
index 759c4d33f1..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_command_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
deleted file mode 120000
index ebe3fed8ff..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_driver_distraction_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
deleted file mode 120000
index 16aa5c9bb0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_hash_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
deleted file mode 120000
index bc9cedbfb3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_hmi_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
deleted file mode 120000
index 617cc46042..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
deleted file mode 120000
index 41474d2cb7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_keyboard_input_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
deleted file mode 120000
index d65fdc56a7..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
deleted file mode 120000
index 9dff29eebf..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_permissions_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
deleted file mode 120000
index 77c3741be5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_system_request_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
deleted file mode 120000
index 63d770348d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_tbt_client_state_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
deleted file mode 120000
index 6ec885678f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_touch_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
deleted file mode 120000
index 4b628b7c62..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/on_vehicle_data_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
deleted file mode 120000
index 0316606c08..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/perform_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
deleted file mode 120000
index ba81d3e53b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/perform_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
deleted file mode 120000
index 9cb56984d5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/perform_interaction_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
deleted file mode 120000
index 8b90adea95..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/perform_interaction_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
deleted file mode 120000
index be4b97728e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/put_file_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
deleted file mode 120000
index 664c76e53f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/put_file_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
deleted file mode 120000
index c9727e504f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/read_did_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
deleted file mode 120000
index 95e0c625a5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/read_did_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
deleted file mode 120000
index cc1fb2feef..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/register_app_interface_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
deleted file mode 120000
index 0f1ffccc69..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/register_app_interface_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
deleted file mode 120000
index ea2ae40b8f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/reset_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
deleted file mode 120000
index daba7103a2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/reset_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
deleted file mode 120000
index 50bd0a294b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/scrollable_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
deleted file mode 120000
index d73af42f69..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/scrollable_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
deleted file mode 120000
index d362057759..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/send_location_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
deleted file mode 120000
index 547cf897e5..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/send_location_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h
deleted file mode 120000
index a2b137233e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_app_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h
deleted file mode 120000
index 6deebcabc8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_app_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
deleted file mode 120000
index f02f9317c6..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_display_layout_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
deleted file mode 120000
index b5b2e73549..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_display_layout_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
deleted file mode 120000
index fee7f8c00b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
deleted file mode 120000
index 76c7bf2497..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
deleted file mode 120000
index 2db9520a22..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
deleted file mode 120000
index ac04c4d9f3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
deleted file mode 120000
index 1961671131..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_media_clock_timer_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
deleted file mode 120000
index ecffab999b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/set_media_clock_timer_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
deleted file mode 120000
index 35acb02f10..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/show_constant_tbt_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
deleted file mode 120000
index 5b3738ca80..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/show_constant_tbt_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
deleted file mode 120000
index e299277b4d..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/show_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
deleted file mode 120000
index afa7d2547e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/show_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
deleted file mode 120000
index 8a1c85497e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/slider_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
deleted file mode 120000
index a869256ee0..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/slider_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
deleted file mode 120000
index 5921def798..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/speak_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
deleted file mode 120000
index f4b69f7937..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/speak_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
deleted file mode 120000
index e5da6a4484..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/subscribe_button_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
deleted file mode 120000
index dda081d9b4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/subscribe_button_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
deleted file mode 120000
index 8e4908abd8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/subscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
deleted file mode 120000
index 262a56f0d4..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/subscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
deleted file mode 120000
index b4b9ca7641..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/system_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
deleted file mode 120000
index f71dd2f314..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/system_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
deleted file mode 120000
index 0851fea063..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/unregister_app_interface_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
deleted file mode 120000
index 16ed184de8..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/unregister_app_interface_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
deleted file mode 120000
index 98b4796053..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/unsubscribe_button_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
deleted file mode 120000
index 12d3efc86e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/unsubscribe_button_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
deleted file mode 120000
index 8bd2f28445..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
deleted file mode 120000
index 980a885341..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
deleted file mode 120000
index 4432804761..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/update_turn_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
deleted file mode 120000
index c778fb169e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/commands/mobile/update_turn_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/pending.h b/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
deleted file mode 120000
index 4dd9a4a88f..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/commands/pending.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
deleted file mode 120000
index 7b6f069885..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/event_engine/event.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
deleted file mode 120000
index b0f651781b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/event_engine/event_dispatcher.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
deleted file mode 120000
index dc6af86240..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/event_engine/event_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h b/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
deleted file mode 120000
index 9ceb7b9b97..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/hmi_capabilities.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h b/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
deleted file mode 120000
index 327faa9730..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/hmi_command_factory.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_state.h b/src/components/application_manager/test/mock/include/application_manager/hmi_state.h
deleted file mode 120000
index 62e3c1a937..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/hmi_state.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/hmi_state.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/message.h b/src/components/application_manager/test/mock/include/application_manager/message.h
deleted file mode 120000
index 3ae48a9129..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/message.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/message.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/message_helper.h b/src/components/application_manager/test/mock/include/application_manager/message_helper.h
deleted file mode 120000
index 6227694b37..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/message_helper.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/message_helper.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h b/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
deleted file mode 120000
index 20bd35432a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/mobile_command_factory.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h b/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
deleted file mode 120000
index 8cfa824c4a..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/mobile_message_handler.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h b/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h
deleted file mode 120000
index 0dc895b545..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/policies/delegates/app_permission_delegate.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h b/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h
deleted file mode 120000
index 4e71cefaa3..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../include/application_manager/policies/delegates/statistics_delegate.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
deleted file mode 120000
index 5cba69ed20..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/policy_event_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
deleted file mode 120000
index 522113630c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/policy_handler.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h
deleted file mode 120000
index 22acc100db..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/policy_handler_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
deleted file mode 120000
index 569a62252b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/policy_retry_sequence.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
deleted file mode 120000
index 22e071c885..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/pt_exchange_handler.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
deleted file mode 120000
index 080045466b..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/pt_exchange_handler_ext.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
deleted file mode 120000
index f3a2017c58..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../include/application_manager/policies/pt_exchange_handler_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_controller.h b/src/components/application_manager/test/mock/include/application_manager/request_controller.h
deleted file mode 120000
index 1b619cf77c..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/request_controller.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/request_controller.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_info.h b/src/components/application_manager/test/mock/include/application_manager/request_info.h
deleted file mode 120000
index c726e09a39..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/request_info.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/request_info.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h b/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
deleted file mode 120000
index 889e967d4e..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/resume_ctrl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h b/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
deleted file mode 120000
index 94919c6ced..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/smart_object_keys.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/state_context.h b/src/components/application_manager/test/mock/include/application_manager/state_context.h
deleted file mode 120000
index f94c0054c2..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/state_context.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/state_context.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/state_controller.h b/src/components/application_manager/test/mock/include/application_manager/state_controller.h
deleted file mode 120000
index 6c61865d18..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/state_controller.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/state_controller.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h b/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
deleted file mode 120000
index 4786675fde..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/time_metric_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h b/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
deleted file mode 120000
index bff65d5633..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/usage_statistics.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h b/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
deleted file mode 120000
index 0ea43f1210..0000000000
--- a/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/application_manager/vehicle_info_data.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
new file mode 100644
index 0000000000..c53927d3a4
--- /dev/null
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace application_manager {
+
+void MessageHelper::SendHashUpdateNotification(uint32_t const app_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendHashUpdateNotification(
+ app_id, app_mngr);
+}
+void MessageHelper::SendNaviStartStream(int32_t connection_key,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendNaviStartStream(connection_key,
+ app_mngr);
+}
+void MessageHelper::SendNaviStopStream(int32_t connection_key,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendNaviStopStream(connection_key,
+ app_mngr);
+}
+void MessageHelper::SendAudioStartStream(int32_t connection_key,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendAudioStartStream(connection_key,
+ app_mngr);
+}
+void MessageHelper::SendAudioStopStream(int32_t connection_key,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendAudioStopStream(connection_key,
+ app_mngr);
+}
+void MessageHelper::SendOnDataStreaming(protocol_handler::ServiceType service,
+ bool available,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendOnDataStreaming(
+ service, available, app_mngr);
+}
+
+smart_objects::SmartObjectSPtr GetHashUpdateNotification(
+ const uint32_t app_id) {
+ return MockMessageHelper::message_helper_mock()->GetHashUpdateNotification(
+ app_id);
+}
+
+std::string MessageHelper::HMIResultToString(
+ hmi_apis::Common_Result::eType hmi_result) {
+ return MockMessageHelper::message_helper_mock()->HMIResultToString(
+ hmi_result);
+}
+
+hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
+ const std::string& hmi_result) {
+ return MockMessageHelper::message_helper_mock()->HMIResultFromString(
+ hmi_result);
+}
+
+std::string MessageHelper::MobileResultToString(
+ mobile_apis::Result::eType mobile_result) {
+ return MockMessageHelper::message_helper_mock()->MobileResultToString(
+ mobile_result);
+}
+
+mobile_api::Result::eType MessageHelper::MobileResultFromString(
+ const std::string& mobile_result) {
+ return MockMessageHelper::message_helper_mock()->MobileResultFromString(
+ mobile_result);
+}
+
+mobile_api::Result::eType MessageHelper::HMIToMobileResult(
+ const hmi_apis::Common_Result::eType hmi_result) {
+ return MockMessageHelper::message_helper_mock()->HMIToMobileResult(
+ hmi_result);
+}
+
+hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
+ const mobile_api::Result::eType mobile_result) {
+ return MockMessageHelper::message_helper_mock()->MobileToHMIResult(
+ mobile_result);
+}
+
+mobile_api::HMILevel::eType MessageHelper::StringToHMILevel(
+ const std::string& hmi_level) {
+ return MockMessageHelper::message_helper_mock()->StringToHMILevel(hmi_level);
+}
+
+smart_objects::SmartObjectSPtr CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices) {
+ return MockMessageHelper::message_helper_mock()->CreateDeviceListSO(devices);
+}
+
+void MessageHelper::SendOnAppPermissionsChangedNotification(
+ uint32_t connection_key,
+ const policy::AppPermissions& permissions,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()
+ ->SendOnAppPermissionsChangedNotification(
+ connection_key, permissions, app_mngr);
+}
+
+void MessageHelper::SendGetUserFriendlyMessageResponse(
+ const std::vector<policy::UserFriendlyMessage>& msg,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendGetUserFriendlyMessageResponse(
+ msg, correlation_id, app_mngr);
+}
+
+void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendGetStatusUpdateResponse(
+ status, correlation_id, app_mngr);
+}
+
+void MessageHelper::SendOnStatusUpdate(const std::string& status,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendOnStatusUpdate(status,
+ app_mngr);
+}
+
+void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendGetSystemInfoRequest(app_mngr);
+}
+
+void MessageHelper::CreateGetVehicleDataRequest(
+ uint32_t correlation_id,
+ const std::vector<std::string>& params,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->CreateGetVehicleDataRequest(
+ correlation_id, params, app_mngr);
+}
+
+void MessageHelper::SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendGetListOfPermissionsResponse(
+ permissions, correlation_id, app_mngr);
+}
+
+void MessageHelper::SendOnPermissionsChangeNotification(
+ uint32_t connection_key,
+ const policy::Permissions& permissions,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendOnPermissionsChangeNotification(
+ connection_key, permissions, app_mngr);
+}
+
+void MessageHelper::SendPolicySnapshotNotification(
+ uint32_t connection_key,
+ const std::vector<uint8_t>& policy_data,
+ const std::string& url,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendPolicySnapshotNotification(
+ connection_key, policy_data, url, app_mngr);
+}
+
+void MessageHelper::SendSDLActivateAppResponse(
+ policy::AppPermissions& permissions,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendSDLActivateAppResponse(
+ permissions, correlation_id, app_mngr);
+}
+
+void MessageHelper::SendPolicyUpdate(const std::string& file_path,
+ int timeout,
+ const std::vector<int>& retries,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendPolicyUpdate(
+ file_path, timeout, retries, app_mngr);
+}
+
+void MessageHelper::SendUpdateSDLResponse(const std::string& result,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendUpdateSDLResponse(
+ result, correlation_id, app_mngr);
+}
+
+hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
+ const std::string& language) {
+ return MockMessageHelper::message_helper_mock()->CommonLanguageFromString(
+ language);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
+ uint32_t function_id, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->CreateModuleInfoSO(
+ function_id, app_mngr);
+}
+
+MockMessageHelper* MockMessageHelper::message_helper_mock() {
+ static MockMessageHelper message_helper_mock;
+ return &message_helper_mock;
+}
+void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()
+ ->SendAllOnButtonSubscriptionNotificationsForApp(app, app_mngr);
+}
+
+void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendOnResumeAudioSourceToHMI(
+ app_id, app_mngr);
+}
+
+smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
+ ApplicationConstSharedPtr app, const uint32_t correlation_id) {
+ return MockMessageHelper::message_helper_mock()->CreateAddSubMenuRequestToHMI(
+ app, correlation_id);
+}
+
+smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->CreateAddCommandRequestToHMI(
+ app, app_mngr);
+}
+
+smart_objects::SmartObjectList
+MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()
+ ->CreateAddVRCommandRequestFromChoiceToHMI(app);
+}
+
+void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendGlobalPropertiesToHMI(
+ app);
+}
+
+smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
+ ApplicationSharedPtr app, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->GetIVISubscriptionRequests(
+ app);
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
+ smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->VerifyImageFiles(
+ message, app, app_mngr);
+}
+std::string MessageHelper::CommonLanguageToString(
+ hmi_apis::Common_Language::eType lang) {
+ return MockMessageHelper::message_helper_mock()->CommonLanguageToString(lang);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
+ ApplicationConstSharedPtr app,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->GetBCActivateAppRequestToHMI(
+ app,
+ session_observer,
+ policy_handler,
+ level,
+ send_policy_priority,
+ app_mngr);
+}
+
+NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ int32_t connection_key,
+ mobile_apis::AppInterfaceUnregisteredReason::eType reason) {
+ return MockMessageHelper::message_helper_mock()
+ ->GetOnAppInterfaceUnregisteredNotificationToMobile(connection_key,
+ reason);
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc
new file mode 100644
index 0000000000..25b54453e5
--- /dev/null
+++ b/src/components/application_manager/test/policy_event_observer_test.cc
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/policies/policy_event_observer.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+#include "gmock/gmock.h"
+#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+using application_manager::event_engine::Event;
+using namespace policy;
+
+using testing::_;
+using ::testing::Return;
+
+class PolicyEventObserverTest : public ::testing::Test {
+ public:
+ PolicyEventObserverTest()
+ : policy_event_observer_(NULL), event_(NULL), field_name("odometer") {}
+
+ protected:
+ MockPolicyHandlerInterface policy_handler_mock_;
+ event_engine_test::MockEventDispatcher mock_event_dispatcher_;
+ PolicyEventObserver* policy_event_observer_;
+ Event* event_;
+ smart_objects::SmartObject smart_object_;
+ const std::string field_name;
+ const int field_value = 100;
+
+ virtual void SetUp() OVERRIDE {
+ policy_event_observer_ =
+ new PolicyEventObserver(&policy_handler_mock_, mock_event_dispatcher_);
+ }
+
+ void TearDown() OVERRIDE {
+ delete policy_event_observer_;
+ DeleteEvent();
+ }
+
+ void CreateEvent(const Event::EventID& event_id) {
+ event_ = new Event(event_id);
+ }
+
+ void CookSmartObject(const hmi_apis::Common_Result::eType& result,
+ const std::string& msg_params_field,
+ int msg_params_field_value) {
+ smart_object_["params"]["code"] = result;
+ smart_object_["msg_params"][msg_params_field] = msg_params_field_value;
+ }
+
+ void CheckResultsOnEvent(uint32_t pt_updated_calls_number,
+ uint32_t on_system_ready_calls_number) {
+ event_->set_smart_object(smart_object_);
+ EXPECT_CALL(policy_handler_mock_,
+ PTUpdatedAt(Counters::KILOMETERS, field_value))
+ .Times(pt_updated_calls_number);
+ EXPECT_CALL(policy_handler_mock_, OnSystemReady())
+ .Times(on_system_ready_calls_number);
+ policy_event_observer_->on_event(*event_);
+ }
+
+ void DeleteEvent() {
+ delete event_;
+ }
+};
+
+TEST_F(PolicyEventObserverTest, OnEvent_EventInvalid_ExpectNoProcessingEvent) {
+ // Arrange
+ CreateEvent(Event::EventID::INVALID_ENUM);
+ CookSmartObject(hmi_apis::Common_Result::SUCCESS, field_name, field_value);
+ CheckResultsOnEvent(0u, 0u);
+}
+
+TEST_F(PolicyEventObserverTest,
+ OnEvent_EventInvalidCommonResult_ExpectNoProcessingEvent) {
+ // Arrange
+ CreateEvent(Event::EventID::VehicleInfo_GetVehicleData);
+ CookSmartObject(
+ hmi_apis::Common_Result::INVALID_DATA, field_name, field_value);
+ // Check
+ CheckResultsOnEvent(0u, 0u);
+}
+
+TEST_F(PolicyEventObserverTest,
+ OnEvent_EventGetVehicleData_ExpectProcessOdometerEvent) {
+ // Arrange
+ CreateEvent(Event::EventID::VehicleInfo_GetVehicleData);
+ CookSmartObject(hmi_apis::Common_Result::SUCCESS, field_name, field_value);
+ // Check
+ CheckResultsOnEvent(1u, 0u);
+}
+
+TEST_F(PolicyEventObserverTest,
+ OnEvent_EventBasicCommunication_OnReady_ExpectOnSystemReady) {
+ // Arrange
+ CreateEvent(Event::EventID::BasicCommunication_OnReady);
+ CookSmartObject(hmi_apis::Common_Result::SUCCESS, field_name, field_value);
+ // Check
+ CheckResultsOnEvent(0u, 1u);
+}
+
+} // namespace policy_event_observer
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
new file mode 100644
index 0000000000..44b4791f85
--- /dev/null
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -0,0 +1,1478 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <vector>
+#include <fstream>
+#include "gmock/gmock.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "policy/mock_policy_manager.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "security_manager/mock_security_manager.h"
+#include "security_manager/mock_crypto_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "transport_manager/mock_transport_manager.h"
+#include "policy/policy_types.h"
+#include "json/reader.h"
+#include "json/writer.h"
+#include "json/value.h"
+#include "smart_objects/smart_object.h"
+#include "utils/file_system.h"
+#include "utils/make_shared.h"
+#include "utils/custom_string.h"
+#include "policy/usage_statistics/counter.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "interfaces/MOBILE_API.h"
+#include "policy/mock_policy_settings.h"
+#include "application_manager/mock_application.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/policies/mock_policy_handler_observer.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_state_controller.h"
+
+namespace test {
+namespace components {
+namespace policy_handler_test {
+
+using namespace application_manager;
+using namespace policy;
+using namespace utils::custom_string;
+using testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SetArgReferee;
+using ::testing::SetArgPointee;
+using ::testing::DoAll;
+using ::testing::SetArgReferee;
+
+class PolicyHandlerTest : public ::testing::Test {
+ public:
+ PolicyHandlerTest()
+ : policy_handler_(policy_settings_, app_manager_)
+ , kPolicyAppId_("fake_app_id")
+ , kMacAddr_("kMacAddr_ess")
+ , kDeviceId_("fake_device_id")
+ , kHmiLevel_("NONE")
+ , kRpc_("fake_rpc")
+ , priority_("fake_priority")
+ , default_hmi_("fake_hmi")
+ , kPreloadPTFile_("sdl_preloaded_pt.json")
+ , kAppStorageFolder_("storage")
+ , app_set(test_app, app_lock)
+ , kAppId_(10u)
+ , kSnapshotFile_("snapshot")
+ , kSnapshotStorage_("snapshot_storage") {}
+
+ protected:
+ NiceMock<MockPolicySettings> policy_settings_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+ utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ connection_handler_test::MockConnectionHandler conn_handler;
+ protocol_handler_test::MockSessionObserver mock_session_observer;
+ application_manager_test::MockStateController mock_state_controller;
+ PolicyHandler policy_handler_;
+ utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ application_manager_test::MockApplicationManager app_manager_;
+ const std::string kPolicyAppId_;
+ const std::string kMacAddr_;
+ const std::string kDeviceId_;
+ const std::string kHmiLevel_;
+ const std::string kRpc_;
+ std::string priority_;
+ std::string default_hmi_;
+ const std::string kPreloadPTFile_;
+ const std::string kAppStorageFolder_;
+ ApplicationSet test_app;
+ sync_primitives::Lock app_lock;
+ DataAccessor<ApplicationSet> app_set;
+ const uint32_t kAppId_;
+ const std::string kSnapshotFile_;
+ const std::string kSnapshotStorage_;
+
+ virtual void SetUp() OVERRIDE {
+ ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set));
+ ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
+ ON_CALL(app_manager_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ std::string path = file_system::CreateDirectory("storage");
+ file_system::CreateFile(path + "/" + "certificate");
+ mock_policy_manager_ =
+ utils::MakeShared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.valid());
+
+ ON_CALL(app_manager_, connection_handler())
+ .WillByDefault(ReturnRef(conn_handler));
+ ON_CALL(conn_handler, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer));
+
+ mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ }
+
+ virtual void TearDown() OVERRIDE {
+ ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ }
+
+ void ChangePolicyManagerToMock() {
+ policy_handler_.SetPolicyManager(mock_policy_manager_);
+ }
+
+ void EnablePolicy() {
+ ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
+ ON_CALL(policy_settings_, preloaded_pt_file())
+ .WillByDefault(ReturnRef(kPreloadPTFile_));
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder_));
+ }
+
+ void EnablePolicyAndPolicyManagerMock() {
+ EnablePolicy();
+ ChangePolicyManagerToMock();
+ }
+
+ void TestActivateApp(const uint32_t connection_key,
+ const uint32_t correlation_id);
+ void GetAppIDForSending();
+ void OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType hmi_level);
+
+ void ExtendedPolicyExpectations() {
+ const std::vector<int> retry_sequence_delay_seconds;
+
+ EXPECT_CALL(policy_settings_, policies_snapshot_file_name())
+ .WillOnce(ReturnRef(kSnapshotFile_));
+ EXPECT_CALL(policy_settings_, system_files_path())
+ .WillOnce(ReturnRef(kSnapshotStorage_));
+ EXPECT_CALL(*mock_policy_manager_, TimeoutExchange()).WillOnce(Return(1));
+ EXPECT_CALL(*mock_policy_manager_, RetrySequenceDelaysSeconds())
+ .WillOnce(Return(retry_sequence_delay_seconds));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendPolicyUpdate(_, _, _, _));
+ }
+};
+
+TEST_F(PolicyHandlerTest, LoadPolicyLibrary_Method_ExpectLibraryLoaded) {
+ // Check before policy enabled from ini file
+ EXPECT_CALL(policy_settings_, enable_policy()).WillRepeatedly(Return(false));
+ EXPECT_FALSE(policy_handler_.LoadPolicyLibrary());
+ EXPECT_CALL(policy_settings_, enable_policy()).WillRepeatedly(Return(true));
+ // Check
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+
+ EXPECT_TRUE(policy_handler_.UnloadPolicyLibrary());
+}
+
+TEST_F(PolicyHandlerTest,
+ InitPolicyTable_WithoutPreloadedFile_ExpectPolicyTableNotInitialized) {
+ // Check
+ EXPECT_FALSE(policy_handler_.InitPolicyTable());
+}
+
+TEST_F(PolicyHandlerTest,
+ InitPolicyTable_WithPreloadedFile_ExpectPolicyTableInitialized) {
+ // Arrange
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ // Check
+ EXPECT_TRUE(policy_handler_.InitPolicyTable());
+ EXPECT_TRUE(policy_handler_.UnloadPolicyLibrary());
+}
+
+TEST_F(PolicyHandlerTest,
+ ResetPolicyTable_WithoutPreloadedFile_ExpectPolicyTableNotReset) {
+ // Check
+ EXPECT_FALSE(policy_handler_.ResetPolicyTable());
+}
+
+TEST_F(PolicyHandlerTest, ResetPolicyTable_PTNotInitialised_PTNotReset) {
+ // Arrange
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ // Check
+ EXPECT_TRUE(policy_handler_.ResetPolicyTable());
+}
+
+TEST_F(PolicyHandlerTest,
+ ResetPolicyTable_WithPreloadedFile_ExpectPolicyTableReset) {
+ // Arrange
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ EXPECT_TRUE(policy_handler_.InitPolicyTable());
+ // Check
+ EXPECT_TRUE(policy_handler_.ResetPolicyTable());
+}
+
+TEST_F(PolicyHandlerTest, ResetPolicyTable_ExpectCallPMResetPT) {
+ ChangePolicyManagerToMock();
+ EnablePolicy();
+ EXPECT_CALL(*mock_policy_manager_, ResetPT(_));
+ policy_handler_.ResetPolicyTable();
+}
+
+TEST_F(PolicyHandlerTest, ClearUserConsent) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(*mock_policy_manager_, ResetUserConsent());
+ policy_handler_.ClearUserConsent();
+}
+
+TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK) {
+ // Arrange
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ // Check
+ EXPECT_TRUE(policy_handler_.InitPolicyTable());
+ ChangePolicyManagerToMock();
+ std::string file_name("sdl_pt_update.json");
+ std::ifstream ifile(file_name);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ json = root.toStyledString();
+ }
+ ifile.close();
+ BinaryMessage msg(json.begin(), json.end());
+ // Checks
+ EXPECT_CALL(app_manager_, GetNextHMICorrelationID());
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ CreateGetVehicleDataRequest(_, _, _));
+ EXPECT_CALL(*mock_policy_manager_, PTUpdatedAt(_, _));
+ EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(true));
+ EXPECT_CALL(*mock_policy_manager_, CleanupUnpairedDevices());
+ policy_handler_.ReceiveMessageFromSDK("", msg);
+}
+
+TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK_PTNotLoaded) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ BinaryMessage msg;
+ // Checks
+
+ EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(false));
+ EXPECT_CALL(*mock_policy_manager_, ForcePTExchange()).WillOnce(Return(""));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnStatusUpdate(_, _));
+ EXPECT_CALL(app_manager_, GetNextHMICorrelationID()).Times(0);
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ CreateGetVehicleDataRequest(_, _, _)).Times(0);
+ policy_handler_.ReceiveMessageFromSDK("", msg);
+}
+
+TEST_F(PolicyHandlerTest, UnloadPolicyLibrary_method_ExpectLibraryUnloaded) {
+ // Arrange
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ EXPECT_TRUE(policy_handler_.InitPolicyTable());
+ ChangePolicyManagerToMock();
+ // Act
+ EXPECT_TRUE(policy_handler_.UnloadPolicyLibrary());
+ // Check
+ EXPECT_FALSE(policy_handler_.InitPolicyTable());
+}
+
+TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) {
+ // Check expectations
+ EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnPermissionsChangeNotification(kAppId_, _, _));
+ // Act
+ Permissions perms;
+ policy_handler_.OnPermissionsUpdated(kPolicyAppId_, perms);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPermissionsUpdated_MethodWith3Parameters_FromNONE_ToFULL) {
+ // Set hmi level from NONE to FULL
+ const std::string new_kHmiLevel_string = "HMI_FULL";
+ mobile_apis::HMILevel::eType new_hmi_level = mobile_apis::HMILevel::HMI_FULL;
+ // Check expectations
+ EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ .Times(2)
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ StringToHMILevel(new_kHmiLevel_string))
+ .WillOnce(Return(new_hmi_level));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnPermissionsChangeNotification(kAppId_, _, _));
+
+ EXPECT_CALL(app_manager_, state_controller())
+ .WillRepeatedly(ReturnRef(mock_state_controller));
+ EXPECT_CALL(mock_state_controller, SetRegularState(_, new_hmi_level, true));
+ // Act
+ Permissions perms;
+ policy_handler_.OnPermissionsUpdated(
+ kPolicyAppId_, perms, new_kHmiLevel_string);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPermissionsUpdated_MethodWith3Parameters_FromNONE_ToNotFull) {
+ // Set hmi level from NONE to Limited
+ const std::string new_kHmiLevel_string = "HMI_LIMITED";
+ mobile_apis::HMILevel::eType new_hmi_level =
+ mobile_apis::HMILevel::HMI_LIMITED;
+ // Check expectations
+ EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ .Times(2)
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ StringToHMILevel(new_kHmiLevel_string))
+ .WillOnce(Return(new_hmi_level));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnPermissionsChangeNotification(kAppId_, _, _));
+
+ EXPECT_CALL(app_manager_, state_controller())
+ .WillRepeatedly(ReturnRef(mock_state_controller));
+ EXPECT_CALL(mock_state_controller, SetRegularState(_, new_hmi_level, false));
+ // Act
+ Permissions perms;
+ policy_handler_.OnPermissionsUpdated(
+ kPolicyAppId_, perms, new_kHmiLevel_string);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPermissionsUpdated_MethodWith3Parameters_FromNotNONE) {
+ // Set hmi level from LIMITED to FULL
+ std::string new_kHmiLevel_string = "HMI_FULL";
+ mobile_apis::HMILevel::eType new_hmi_level = mobile_apis::HMILevel::HMI_FULL;
+ // Check expectations
+ EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ .Times(2)
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ StringToHMILevel(new_kHmiLevel_string))
+ .WillOnce(Return(new_hmi_level));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnPermissionsChangeNotification(kAppId_, _, _));
+
+ EXPECT_CALL(app_manager_, state_controller()).Times(0);
+ // Act
+ Permissions perms;
+ policy_handler_.OnPermissionsUpdated(
+ kPolicyAppId_, perms, new_kHmiLevel_string);
+}
+
+TEST_F(PolicyHandlerTest, GetPriority) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetPriority(kPolicyAppId_, &priority_));
+ // Act
+ policy_handler_.GetPriority(kPolicyAppId_, &priority_);
+}
+
+TEST_F(PolicyHandlerTest, CheckPermissions) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ CheckPermissionResult result;
+ RPCParams kRpc_params;
+ // Check expectations
+ EXPECT_CALL(
+ *mock_policy_manager_,
+ CheckPermissions(kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, _));
+ // Act
+ policy_handler_.CheckPermissions(
+ kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, result);
+}
+
+TEST_F(PolicyHandlerTest, GetNotificationsNumber) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetNotificationsNumber(priority_));
+ // Act
+ policy_handler_.GetNotificationsNumber(priority_);
+}
+
+TEST_F(PolicyHandlerTest, GetUserConsentForDevice) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kDeviceId_))
+ .WillOnce(Return(DeviceConsent::kDeviceHasNoConsent));
+ // Act
+ policy_handler_.GetUserConsentForDevice(kDeviceId_);
+}
+
+TEST_F(PolicyHandlerTest, GetDefaultHmi) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_,
+ GetDefaultHmi(kPolicyAppId_, &default_hmi_));
+ // Act
+ policy_handler_.GetDefaultHmi(kPolicyAppId_, &default_hmi_);
+}
+
+TEST_F(PolicyHandlerTest, GetInitialAppData) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ StringArray* nicknames = NULL;
+ StringArray* app_hmi_types = NULL;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_,
+ GetInitialAppData(kPolicyAppId_, nicknames, app_hmi_types));
+ // Act
+ policy_handler_.GetInitialAppData(kPolicyAppId_, nicknames, app_hmi_types);
+}
+
+TEST_F(PolicyHandlerTest, GetServiceUrls) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ EndpointUrls endpoints;
+ const std::string service_type_ = "0x0";
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetServiceUrls(service_type_, _));
+ // Act
+ policy_handler_.GetServiceUrls(service_type_, endpoints);
+}
+
+TEST_F(PolicyHandlerTest, ResetRetrySequence) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, ResetRetrySequence());
+ // Act
+ policy_handler_.ResetRetrySequence();
+}
+
+TEST_F(PolicyHandlerTest, NextRetryTimeout) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, NextRetryTimeout());
+ // Act
+ policy_handler_.NextRetryTimeout();
+}
+
+TEST_F(PolicyHandlerTest, TimeoutExchange) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, TimeoutExchange());
+ // Act
+ policy_handler_.TimeoutExchange();
+}
+
+TEST_F(PolicyHandlerTest, OnExceededTimeout) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, OnExceededTimeout());
+ // Act
+ policy_handler_.OnExceededTimeout();
+}
+
+TEST_F(PolicyHandlerTest, OnSystemReady) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, OnSystemReady());
+ // Act
+ policy_handler_.OnSystemReady();
+}
+
+TEST_F(PolicyHandlerTest, PTUpdatedAt_method_UseCounter_KILOMETERS) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ const int value = 1000;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, PTUpdatedAt(Counters::KILOMETERS, value));
+ // Act
+ policy_handler_.PTUpdatedAt(Counters::KILOMETERS, value);
+}
+
+TEST_F(PolicyHandlerTest, PTUpdatedAt_method_UseCounter_DAYS_AFTER_EPOCH) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ const int value = 16000;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_,
+ PTUpdatedAt(Counters::DAYS_AFTER_EPOCH, value));
+ // Act
+ policy_handler_.PTUpdatedAt(Counters::DAYS_AFTER_EPOCH, value);
+}
+
+TEST_F(PolicyHandlerTest, CheckSystemAction_method_WithType_KEEP_CONTEXT) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ mobile_apis::SystemAction::eType system_action =
+ mobile_apis::SystemAction::eType::KEEP_CONTEXT;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, CanAppKeepContext(kPolicyAppId_));
+ // Act
+ policy_handler_.CheckSystemAction(system_action, kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, CheckSystemAction_method_WithType_STEAL_FOCUS) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ mobile_apis::SystemAction::eType system_action =
+ mobile_apis::SystemAction::eType::STEAL_FOCUS;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, CanAppStealFocus(kPolicyAppId_));
+ // Act
+ policy_handler_.CheckSystemAction(system_action, kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, CheckSystemAction_method_WithType_DEFAULT_ACTION) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ mobile_apis::SystemAction::eType system_action =
+ mobile_apis::SystemAction::eType::DEFAULT_ACTION;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, CanAppStealFocus(kPolicyAppId_)).Times(0);
+ EXPECT_CALL(*mock_policy_manager_, CanAppKeepContext(kPolicyAppId_)).Times(0);
+ // Act
+ EXPECT_TRUE(policy_handler_.CheckSystemAction(system_action, kPolicyAppId_));
+}
+
+TEST_F(PolicyHandlerTest, CheckSystemAction_method_WithType_INVALID_ENUM) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ mobile_apis::SystemAction::eType system_action =
+ mobile_apis::SystemAction::eType::INVALID_ENUM;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, CanAppStealFocus(kPolicyAppId_)).Times(0);
+ EXPECT_CALL(*mock_policy_manager_, CanAppKeepContext(kPolicyAppId_)).Times(0);
+ // Act
+ EXPECT_FALSE(policy_handler_.CheckSystemAction(system_action, kPolicyAppId_));
+}
+
+TEST_F(PolicyHandlerTest, KmsChanged) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ const int kilometers = 1600;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, KmsChanged(kilometers));
+ // Act
+ policy_handler_.KmsChanged(kilometers);
+}
+// policy_handler l:1026
+
+void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
+ const uint32_t correlation_id) {
+ utils::SharedPtr<application_manager_test::MockApplication> application1 =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ EXPECT_CALL(app_manager_, ActivateApplication(_))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(app_manager_, application(connection_key))
+ .WillRepeatedly(Return(application1));
+
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appPermissionsConsentNeeded = true;
+
+ // Check expectations
+ EXPECT_CALL(*application1, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+ ON_CALL(*mock_policy_manager_, Increment(_, _)).WillByDefault(Return());
+ EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(_));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendSDLActivateAppResponse(_, _, _));
+ ON_CALL(*application1, app_id()).WillByDefault(Return(kAppId_));
+ // Act
+ policy_handler_.OnActivateApp(connection_key, correlation_id);
+}
+
+TEST_F(PolicyHandlerTest, OnActivateApp) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t connection_key = 1;
+ const uint32_t correlation_id = 2;
+ TestActivateApp(connection_key, correlation_id);
+}
+
+TEST_F(PolicyHandlerTest, OnIgnitionCycleOver) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, IncrementIgnitionCycles());
+ // Act
+ policy_handler_.OnIgnitionCycleOver();
+}
+
+void PolicyHandlerTest::OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType hmi_level) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ utils::SharedPtr<application_manager_test::MockApplication> application =
+ utils::MakeShared<application_manager_test::MockApplication>();
+
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(application));
+ EXPECT_CALL(*application, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*application, hmi_level()).WillRepeatedly(Return(hmi_level));
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPendingPermissionChange_AppInLimitedConsentnotNeeded) {
+ // Arrange
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_LIMITED);
+ // Check expectations
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appPermissionsConsentNeeded = false;
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(kAppId_, _, _)).Times(0);
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_)).Times(0);
+ // Act
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInLimitedConsentNeeded) {
+ // Arrange
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_LIMITED);
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appPermissionsConsentNeeded = true;
+ // Check expectations
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_));
+ // Act
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppLimitedAndRevoked) {
+ // Arrange
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_LIMITED);
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appRevoked = true;
+
+ // Check expectations
+ EXPECT_CALL(app_manager_, state_controller())
+ .WillRepeatedly(ReturnRef(mock_state_controller));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_state_controller,
+ SetRegularState(_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ true));
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_));
+ // Act
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInBackgroundAndRevoked) {
+ // Arrange
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_BACKGROUND);
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.isAppPermissionsRevoked = true;
+
+ // Check expectations
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_));
+ // Act
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPendingPermissionChange_AppInLIMITEDAndUnauthorized) {
+ // Arrange
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_LIMITED);
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appUnauthorized = true;
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
+ utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ // Check expectations
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
+ .WillOnce(Return(message));
+ EXPECT_CALL(app_manager_,
+ ManageMobileCommand(_, commands::Command::ORIGIN_SDL));
+
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_));
+
+ // Act
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPendingPermissionChange_AppInBackgroundAndUnauthorized) {
+ // Arrange
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_BACKGROUND);
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appUnauthorized = true;
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
+ utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ // Check expectations
+ // Notification won't be sent
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(kAppId_, _, _)).Times(0);
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
+ .WillOnce(Return(message));
+ EXPECT_CALL(app_manager_,
+ ManageMobileCommand(_, commands::Command::ORIGIN_SDL));
+
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_));
+
+ // Act
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, PTExchangeAtUserRequest) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, ForcePTExchange());
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendUpdateSDLResponse(_, _, _));
+ // Act
+ const uint32_t correlation_id = 2;
+ policy_handler_.PTExchangeAtUserRequest(correlation_id);
+}
+
+TEST_F(PolicyHandlerTest, AddDevice) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ const std::string connection_type("BT");
+ EXPECT_CALL(*mock_policy_manager_, AddDevice(kDeviceId_, connection_type));
+ // Act
+ policy_handler_.AddDevice(kDeviceId_, connection_type);
+}
+
+TEST_F(PolicyHandlerTest, SetDeviceInfo) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ std::string kDeviceId_;
+ const DeviceInfo device_info;
+ EXPECT_CALL(*mock_policy_manager_, SetDeviceInfo(kDeviceId_, _));
+ // Act
+ policy_handler_.SetDeviceInfo(kDeviceId_, device_info);
+}
+
+TEST_F(PolicyHandlerTest, OnGetUserFriendlyMessage) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ std::vector<std::string> message_codes;
+ const std::string language("ru-ru");
+ const uint32_t correlation_id = 2;
+ EXPECT_CALL(*mock_policy_manager_,
+ GetUserFriendlyMessages(message_codes, language))
+ .WillOnce(Return(std::vector<UserFriendlyMessage>()));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendGetUserFriendlyMessageResponse(_, _, _));
+ // Act
+ policy_handler_.OnGetUserFriendlyMessage(
+ message_codes, language, correlation_id);
+}
+
+TEST_F(PolicyHandlerTest, OnGetStatusUpdate) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ const uint32_t correlation_id = 2;
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetPolicyTableStatus());
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendGetStatusUpdateResponse(_, correlation_id, _));
+ // Act
+ policy_handler_.OnGetStatusUpdate(correlation_id);
+}
+
+TEST_F(PolicyHandlerTest, OnUpdateStatusChanged) {
+ // Check expectations
+ const std::string& status("new status");
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnStatusUpdate(status, _));
+ // Act
+ policy_handler_.OnUpdateStatusChanged(status);
+}
+
+TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ utils::SharedPtr<application_manager_test::MockApplication> application =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(application));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ protocol_handler_test::MockSessionObserver session_observer;
+
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(session_observer));
+
+ EXPECT_CALL(session_observer, GetDataOnDeviceID(0u, _, _, _, _));
+
+ // Act
+ policy_handler_.OnCurrentDeviceIdUpdateRequired(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnSystemInfoChanged) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ const std::string language("ru-ru");
+ EXPECT_CALL(*mock_policy_manager_, SetSystemLanguage(language));
+ // Act
+ policy_handler_.OnSystemInfoChanged(language);
+}
+
+TEST_F(PolicyHandlerTest, OnGetSystemInfo) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ const std::string ccpu_version("4.1.3.B_EB355B");
+ const std::string wers_country_code("WAEGB");
+ const std::string language("ru-ru");
+ EXPECT_CALL(*mock_policy_manager_,
+ SetSystemInfo(ccpu_version, wers_country_code, language));
+ // Act
+ policy_handler_.OnGetSystemInfo(ccpu_version, wers_country_code, language);
+}
+
+TEST_F(PolicyHandlerTest, IsApplicationRevoked) {
+ // Arrange
+ EnablePolicy();
+ ChangePolicyManagerToMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, IsApplicationRevoked(kPolicyAppId_));
+ // Act
+ policy_handler_.IsApplicationRevoked(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnSystemInfoUpdateRequired) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendGetSystemInfoRequest(_));
+ // Act
+ policy_handler_.OnSystemInfoUpdateRequired();
+}
+
+TEST_F(PolicyHandlerTest, GetAppRequestTypes) {
+ // Arrange
+ EnablePolicy();
+ ChangePolicyManagerToMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(kPolicyAppId_))
+ .WillOnce(Return(std::vector<std::string>()));
+ // Act
+ policy_handler_.GetAppRequestTypes(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnVIIsReady) {
+ // Arrange
+ ChangePolicyManagerToMock();
+ // Check expectations
+ EXPECT_CALL(app_manager_, GetNextHMICorrelationID());
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ CreateGetVehicleDataRequest(_, _, _));
+ // Act
+ policy_handler_.OnVIIsReady();
+}
+
+TEST_F(PolicyHandlerTest, RemoveDevice) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, MarkUnpairedDevice(kDeviceId_));
+ // Act
+ policy_handler_.RemoveDevice(kDeviceId_);
+}
+
+TEST_F(PolicyHandlerTest, GetAppName) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ const CustomString app_name("my_mobile_app");
+
+ utils::SharedPtr<application_manager_test::MockApplication> application =
+ utils::MakeShared<application_manager_test::MockApplication>();
+
+ EXPECT_CALL(*application, name()).WillOnce(ReturnRef(app_name));
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(application));
+ // Act
+ EXPECT_EQ(app_name, policy_handler_.GetAppName(kPolicyAppId_));
+}
+
+TEST_F(PolicyHandlerTest, OnUpdateRequestSentToMobile) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, OnUpdateStarted());
+ // Act
+ policy_handler_.OnUpdateRequestSentToMobile();
+}
+
+TEST_F(PolicyHandlerTest, OnUpdateHMIAppType) {
+ // Arrange
+ EnablePolicy();
+ application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
+ policy_handler_.add_listener(&policy_handler_observer);
+ std::map<std::string, StringArray> app_hmi_types;
+ StringArray arr;
+ arr.push_back("test_hmi_type");
+ app_hmi_types["app1"] = arr;
+ // Check expectations
+ EXPECT_CALL(policy_handler_observer, OnUpdateHMIAppType(_));
+ // Act
+ policy_handler_.OnUpdateHMIAppType(app_hmi_types);
+}
+
+TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ utils::SharedPtr<application_manager_test::MockApplication> application =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ // Check expectations
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(application));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnAppPermissionsChangedNotification(_, _, _));
+ AppPermissions permissions(kPolicyAppId_);
+ // Act
+ policy_handler_.SendOnAppPermissionsChanged(permissions, kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnPTExchangeNeeded) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, ForcePTExchange());
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendOnStatusUpdate(_, _));
+ // Act
+ policy_handler_.OnPTExchangeNeeded();
+}
+
+TEST_F(PolicyHandlerTest, AddApplication) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, AddApplication(kPolicyAppId_));
+ // Act
+ policy_handler_.AddApplication(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, HeartBeatTimeout) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, HeartBeatTimeout(kPolicyAppId_));
+ // Act
+ policy_handler_.HeartBeatTimeout(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, OnAppsSearchStarted) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, OnAppsSearchStarted());
+ // Act
+ policy_handler_.OnAppsSearchStarted();
+}
+
+TEST_F(PolicyHandlerTest, OnAppsSearchCompleted) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, OnAppsSearchCompleted());
+ // Act
+ policy_handler_.OnAppsSearchCompleted();
+}
+
+TEST_F(PolicyHandlerTest, OnAppRegisteredOnMobile) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+
+ EXPECT_CALL(*mock_policy_manager_, OnAppRegisteredOnMobile(kPolicyAppId_));
+ // Act
+ policy_handler_.OnAppRegisteredOnMobile(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest, IsRequestTypeAllowed) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+
+ mobile_apis::RequestType::eType type =
+ mobile_apis::RequestType::eType::EMERGENCY;
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(kPolicyAppId_))
+ .WillOnce(Return(std::vector<std::string>()));
+ // Act
+ policy_handler_.IsRequestTypeAllowed(kPolicyAppId_, type);
+}
+
+TEST_F(PolicyHandlerTest, GetVehicleInfo) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetVehicleInfo())
+ .WillOnce(Return(VehicleInfo()));
+ // Act
+ policy_handler_.GetVehicleInfo();
+}
+
+TEST_F(PolicyHandlerTest, Increment_method_WithOneParameter) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+ usage_statistics::GlobalCounterId type =
+ usage_statistics::GlobalCounterId::IAP_BUFFER_FULL;
+ EXPECT_CALL(*mock_policy_manager_, Increment(type));
+ // Act
+ policy_handler_.Increment(type);
+}
+
+TEST_F(PolicyHandlerTest, Increment_method_WithTwoParameters) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+
+ usage_statistics::AppCounterId type =
+ usage_statistics::AppCounterId::USER_SELECTIONS;
+ EXPECT_CALL(*mock_policy_manager_, Increment(kPolicyAppId_, type));
+ // Act
+ policy_handler_.Increment(kPolicyAppId_, type);
+}
+
+TEST_F(PolicyHandlerTest, Set) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+
+ const std::string value("ru-ru");
+ usage_statistics::AppInfoId type = usage_statistics::AppInfoId::LANGUAGE_GUI;
+ EXPECT_CALL(*mock_policy_manager_, Set(kPolicyAppId_, type, value));
+ // Act
+ policy_handler_.Set(kPolicyAppId_, type, value);
+}
+
+TEST_F(PolicyHandlerTest, Add) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ // Check expectations
+
+ const int32_t timespan_seconds = 100;
+ usage_statistics::AppStopwatchId type =
+ usage_statistics::AppStopwatchId::SECONDS_HMI_FULL;
+ EXPECT_CALL(*mock_policy_manager_,
+ Add(kPolicyAppId_, type, timespan_seconds));
+ // Act
+ policy_handler_.Add(kPolicyAppId_, type, timespan_seconds);
+}
+
+TEST_F(PolicyHandlerTest, GetAvailableApps) {
+ // Set does not have any apps
+ std::queue<std::string> apps;
+ policy_handler_.GetAvailableApps(apps);
+ EXPECT_EQ(0u, apps.size());
+
+ // Added one app
+ test_app.insert(mock_app_);
+
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return("app_id"));
+
+ policy_handler_.GetAvailableApps(apps);
+
+ EXPECT_EQ(1u, apps.size());
+}
+
+TEST_F(PolicyHandlerTest, OnGetListOfPermissions) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ const uint32_t kAppId_ = 10u;
+ const uint32_t kCorId = 1u;
+ const std::string default_mac = "00:00:00:00:00:00";
+ test_app.insert(mock_app_);
+
+ // Expectations
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForApp(default_mac, _, _));
+
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendGetListOfPermissionsResponse(_, kCorId, _));
+
+ EXPECT_CALL(app_manager_, application(kAppId_))
+ .WillRepeatedly(Return(mock_app_));
+
+ policy_handler_.OnGetListOfPermissions(kAppId_, kCorId);
+}
+
+TEST_F(PolicyHandlerTest, OnGetListOfPermissions_WithoutConnectionKey) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ const uint32_t kAppId_ = 0u;
+ const uint32_t kCorId = 1u;
+ test_app.insert(mock_app_);
+
+ // Expectations
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendGetListOfPermissionsResponse(_, kCorId, _));
+
+ policy_handler_.OnGetListOfPermissions(kAppId_, kCorId);
+}
+
+TEST_F(PolicyHandlerTest, RetrieveCertificate) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ const std::string test_certificate = "test certificate";
+ EXPECT_CALL(*mock_policy_manager_, RetrieveCertificate())
+ .WillOnce(Return(test_certificate));
+ EXPECT_EQ(test_certificate, policy_handler_.RetrieveCertificate());
+}
+
+TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlNotAdded) {
+ EnablePolicyAndPolicyManagerMock();
+ BinaryMessage msg;
+ EndpointUrls test_data;
+#ifdef EXTENDED_POLICY
+ ExtendedPolicyExpectations();
+#else
+ EXPECT_CALL(*mock_policy_manager_, GetServiceUrls(_, _))
+ .WillRepeatedly(SetArgReferee<1>(test_data));
+#endif // EXTENDED_POLICY
+
+ policy_handler_.OnSnapshotCreated(msg);
+}
+
+TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
+ EnablePolicyAndPolicyManagerMock();
+ BinaryMessage msg;
+ EndpointUrls test_data;
+ EndpointData data("some_data");
+ test_data.push_back(data);
+
+#ifdef EXTENDED_POLICY
+ ExtendedPolicyExpectations();
+#else
+ EXPECT_CALL(*mock_policy_manager_, GetServiceUrls(_, _))
+ .WillRepeatedly(SetArgReferee<1>(test_data));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set));
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendPolicySnapshotNotification(_, _, _, _));
+ // Check expectations for get app id
+ GetAppIDForSending();
+ // Expectations
+ EXPECT_CALL(app_manager_, application(kAppId_))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+#endif // EXTENDED_POLICY
+
+ policy_handler_.OnSnapshotCreated(msg);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAllowSDLFunctionalityNotification_AllowedWithDevId_AppActivated) {
+ // Arrange
+
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t connection_key = 1;
+ const uint32_t correlation_id = 2;
+ TestActivateApp(connection_key, correlation_id);
+
+ const bool is_allowed = true;
+ std::vector<std::string> device_macs;
+ device_macs.push_back(kPolicyAppId_);
+
+ // Not called because id was setted
+ EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_)).Times(0);
+ EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ .WillRepeatedly(Return(true));
+
+ policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed,
+ kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAllowSDLFunctionalityNotification_Allowed_WithoutDevId_AppActivated) {
+ // Arrange
+ const bool is_allowed = true;
+ std::vector<std::string> device_macs;
+ device_macs.push_back(kPolicyAppId_);
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t connection_key = 1;
+ const uint32_t correlation_id = 2;
+ TestActivateApp(connection_key, correlation_id);
+
+ // Device ID is not setted by us
+ EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_))
+ .WillOnce(SetArgReferee<0>(device_macs));
+
+ EXPECT_CALL(*mock_policy_manager_,
+ SetUserConsentForDevice(kPolicyAppId_, is_allowed));
+
+ policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed, "");
+}
+
+TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentAllowed) {
+ const bool is_allowed = true;
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ connection_handler::DeviceHandle test_device_id = 100u;
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+
+ EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(test_device_id), Return(true)));
+
+ test_app.insert(mock_app_);
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(test_device_id));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+
+ EXPECT_CALL(*mock_policy_manager_, IsPredataPolicy(kPolicyAppId_))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_policy_manager_,
+ ReactOnUserDevConsentForApp(kPolicyAppId_, is_allowed));
+ EXPECT_CALL(*mock_policy_manager_,
+ SendNotificationOnPermissionsUpdated(kPolicyAppId_));
+
+ policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
+}
+
+TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentNotAllowed) {
+ const bool is_allowed = false;
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ connection_handler::DeviceHandle test_device_id = 100u;
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+
+ // Check expectations
+ EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(test_device_id), Return(true)));
+ test_app.insert(mock_app_);
+
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(test_device_id));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+
+ EXPECT_CALL(*mock_policy_manager_, IsPredataPolicy(kPolicyAppId_))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_policy_manager_, ReactOnUserDevConsentForApp(_, _))
+ .Times(0);
+ EXPECT_CALL(*mock_policy_manager_, SendNotificationOnPermissionsUpdated(_))
+ .Times(0);
+
+ policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
+}
+
+TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
+ const bool is_allowed = false;
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ connection_handler::DeviceHandle test_device_id = 100u;
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+
+ EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(test_device_id), Return(true)));
+
+ test_app.insert(mock_app_);
+
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(test_device_id));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+
+ // App does not have predate policy
+ EXPECT_CALL(*mock_policy_manager_, IsPredataPolicy(kPolicyAppId_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_policy_manager_,
+ ReactOnUserDevConsentForApp(kPolicyAppId_, is_allowed));
+ EXPECT_CALL(*mock_policy_manager_,
+ SendNotificationOnPermissionsUpdated(kPolicyAppId_));
+
+ policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
+}
+
+TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
+ application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
+ policy_handler_.add_listener(&policy_handler_observer);
+ std::string cert_data = "data";
+ EXPECT_CALL(policy_handler_observer, OnCertificateUpdated(cert_data));
+ policy_handler_.OnCertificateUpdated(cert_data);
+}
+
+TEST_F(PolicyHandlerTest, GetAppIdForSending_WithoutApps) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+ // Set does not include any applications
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)).Times(0);
+ EXPECT_EQ(0u, policy_handler_.GetAppIdForSending());
+}
+
+TEST_F(PolicyHandlerTest, GetAppIdForSending_GetDefaultMacAddress) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ // Set does not include any applications
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)).Times(0);
+ // Check expectations
+ test_app.insert(mock_app_);
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillRepeatedly(Return(kDeviceAllowed));
+ // Act
+ EXPECT_EQ(kAppId_, policy_handler_.GetAppIdForSending());
+}
+
+void PolicyHandlerTest::GetAppIDForSending() {
+ EnablePolicyAndPolicyManagerMock();
+ test_app.insert(mock_app_);
+
+ // Check expectations
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+ EXPECT_CALL(mock_session_observer, GetDataOnDeviceID(_, _, _, _, _))
+ .WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
+ .WillRepeatedly(Return(kDeviceAllowed));
+}
+
+TEST_F(PolicyHandlerTest, GetAppIdForSending_SetMacAddress) {
+ // Arrange
+ GetAppIDForSending();
+ // Act
+ EXPECT_EQ(kAppId_, policy_handler_.GetAppIdForSending());
+}
+
+TEST_F(PolicyHandlerTest, SendMessageToSDK) {
+ // Precondition
+ BinaryMessage msg;
+ const std::string url = "test_url";
+ EnablePolicyAndPolicyManagerMock();
+ test_app.insert(mock_app_);
+ // Check expectations for get app id
+ GetAppIDForSending();
+ // Expectations
+ EXPECT_CALL(app_manager_, application(kAppId_))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendPolicySnapshotNotification(kAppId_, msg, url, _));
+ // Act
+ EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, url));
+}
+
+TEST_F(PolicyHandlerTest, CanUpdate) {
+ GetAppIDForSending();
+ EXPECT_TRUE(policy_handler_.CanUpdate());
+}
+
+} // namespace policy_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc
new file mode 100644
index 0000000000..6d08e5bf56
--- /dev/null
+++ b/src/components/application_manager/test/request_controller/request_controller_test.cc
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/mock_request.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "utils/make_shared.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "resumption/last_state.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace request_controller_test {
+
+using application_manager::request_controller::RequestController;
+using application_manager::request_controller::RequestInfo;
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef utils::SharedPtr<application_manager_test::MockRequest> RequestPtr;
+typedef utils::SharedPtr<RequestController> RequestControllerSPtr;
+
+class RequestControllerTestClass : public ::testing::Test {
+ public:
+ RequestControllerTestClass()
+ : request_ctrl_(utils::MakeShared<RequestController>(
+ mock_request_controller_settings_)) {
+ register_request_ = GetMockRequest();
+ }
+
+ RequestController::TResult AddRequest(
+ const RequestInfo::RequestType request_type,
+ const bool RegisterRequest = false,
+ const mobile_apis::HMILevel::eType& hmi_level =
+ mobile_apis::HMILevel::INVALID_ENUM) {
+ RequestPtr request;
+ if (RegisterRequest) {
+ request = register_request_;
+ EXPECT_CALL(*register_request_, default_timeout()).WillOnce(Return(0));
+ } else {
+ request = empty_register_request_;
+ }
+ if (RequestInfo::RequestType::HMIRequest == request_type) {
+ return request_ctrl_->addHMIRequest(request);
+ }
+ return request_ctrl_->addMobileRequest(request, hmi_level);
+ }
+
+ RequestPtr GetMockRequest(const uint32_t id = 1,
+ const uint32_t connection_key = 0) {
+ return utils::MakeShared<application_manager_test::MockRequest>(
+ connection_key, id);
+ }
+ void CallSettings() {
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale())
+ .WillOnce(ReturnRef(kDefaultAppHmiLevelNoneRequestsTimeScale));
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale_max_requests())
+ .WillOnce(ReturnRef(kDefaultAppHmiLevelNoneTimeScaleMaxRequests));
+
+ EXPECT_CALL(mock_request_controller_settings_, app_time_scale())
+ .WillOnce(ReturnRef(kDefaultAppRequestsTimeScale));
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_time_scale_max_requests())
+ .WillOnce(ReturnRef(kDefaultAppTimeScaleMaxRequests));
+
+ EXPECT_CALL(mock_request_controller_settings_, pending_requests_amount())
+ .WillOnce(ReturnRef(kDefaultPendingRequestsAmount));
+ }
+
+ application_manager_test::MockRequestControlerSettings
+ mock_request_controller_settings_;
+ RequestPtr register_request_;
+ RequestPtr empty_register_request_;
+ RequestControllerSPtr request_ctrl_;
+
+ const uint32_t kDefaultAppHmiLevelNoneRequestsTimeScale = 10;
+ const uint32_t kDefaultAppHmiLevelNoneTimeScaleMaxRequests = 100u;
+ const uint32_t kDefaultAppTimeScaleMaxRequests = 0;
+ const uint32_t kDefaultAppRequestsTimeScale = 0;
+ const uint32_t kDefaultPendingRequestsAmount = 0;
+};
+
+TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_HMI_FULL_SUCCESS) {
+ CallSettings();
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
+ AddRequest(RequestInfo::RequestType::MobileRequest,
+ true,
+ mobile_apis::HMILevel::HMI_FULL));
+}
+
+TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_HMI_NONE_SUCCESS) {
+ CallSettings();
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
+ AddRequest(RequestInfo::RequestType::MobileRequest,
+ true,
+ mobile_apis::HMILevel::HMI_NONE));
+}
+
+TEST_F(RequestControllerTestClass, IsLowVoltage_SetOnLowVoltage_TRUE) {
+ request_ctrl_->OnLowVoltage();
+ const bool result = true;
+ EXPECT_EQ(result, request_ctrl_->IsLowVoltage());
+}
+
+TEST_F(RequestControllerTestClass, IsLowVoltage_SetOnWakeUp_FALSE) {
+ request_ctrl_->OnWakeUp();
+ const bool result = false;
+ EXPECT_EQ(result, request_ctrl_->IsLowVoltage());
+}
+
+TEST_F(RequestControllerTestClass,
+ AddMobileRequest_SetInvalidData_INVALID_DATA) {
+ EXPECT_EQ(RequestController::INVALID_DATA,
+ AddRequest(RequestInfo::RequestType::MobileRequest,
+ false,
+ mobile_apis::HMILevel::HMI_NONE));
+}
+
+TEST_F(RequestControllerTestClass, addHMIRequest_AddRequest_SUCCESS) {
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(RequestInfo::RequestType::HMIRequest, true));
+}
+
+TEST_F(RequestControllerTestClass, addHMIRequest_AddInvalidData_INVALID_DATA) {
+ EXPECT_EQ(RequestController::INVALID_DATA,
+ AddRequest(RequestInfo::RequestType::HMIRequest));
+}
+
+TEST_F(RequestControllerTestClass, ZeroValuePendingRequestsAmount) {
+ // Bigger than pending_requests_amount count
+ const uint32_t big_count_of_requests_for_test_ = 10;
+ for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
+ CallSettings();
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(RequestInfo::RequestType::MobileRequest,
+ true,
+ mobile_apis::HMILevel::HMI_FULL));
+ }
+}
+
+} // namespace request_controller
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
index 86103e7998..886736fa97 100644
--- a/src/components/application_manager/test/request_info_test.cc
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -1,242 +1,487 @@
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
#include "application_manager/request_info.h"
-#include "application_manager/message_helper.h"
#include <iostream>
+#include <vector>
+#include <limits>
+#include "gmock/gmock.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
namespace request_info = application_manager::request_controller;
-class MockRequest: public application_manager::commands::Command {
- public:
- MockRequest(uint32_t connection_key,
- uint32_t correlation_id):
- connection_key_(connection_key),
- correlation_id_(correlation_id) {
-
- }
- MOCK_METHOD0(CheckPermissions, bool ());
- MOCK_METHOD0(Init, bool ());
- MOCK_METHOD0(Run, void ());
- MOCK_METHOD0(CleanUp, bool ());
- MOCK_CONST_METHOD0(default_timeout, uint32_t ());
- MOCK_CONST_METHOD0(function_id, int32_t ());
- MOCK_METHOD0(onTimeOut, void ());
- MOCK_METHOD0(AllowedToTerminate, bool ());
- MOCK_METHOD1(SetAllowedToTerminate, void (bool));
-
- uint32_t connection_key_;
- uint32_t correlation_id_;
- virtual uint32_t connection_key() const;
- virtual uint32_t correlation_id() const;
-};
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockRequest : public application_manager::commands::Command {
+ public:
+ MockRequest(uint32_t connection_key, uint32_t correlation_id)
+ : connection_key_(connection_key), correlation_id_(correlation_id) {}
+ MOCK_METHOD0(CheckPermissions, bool());
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD0(Run, void());
+ MOCK_METHOD0(CleanUp, bool());
+ MOCK_CONST_METHOD0(default_timeout, uint32_t());
+ MOCK_CONST_METHOD0(function_id, int32_t());
+ MOCK_METHOD0(onTimeOut, void());
+ MOCK_METHOD0(AllowedToTerminate, bool());
+ MOCK_METHOD1(SetAllowedToTerminate, void(bool));
-class TestRequestInfo: public request_info::RequestInfo {
- public:
- TestRequestInfo(request_info::RequestPtr request,
- const RequestType requst_type,
- const TimevalStruct& start_time,
- const uint64_t timeout_sec):
- RequestInfo(request, requst_type, start_time,timeout_sec) {
+ uint32_t connection_key_;
+ uint32_t correlation_id_;
+ virtual uint32_t connection_key() const {
+ return connection_key_;
+ }
+ virtual uint32_t correlation_id() const {
+ return correlation_id_;
+ }
+};
- }
- void SetEndTime(const TimevalStruct& end_time);
+class TestRequestInfo : public request_info::RequestInfo {
+ public:
+ TestRequestInfo(request_info::RequestPtr request,
+ const RequestType requst_type,
+ const TimevalStruct& start_time,
+ const uint64_t timeout_msec)
+ : RequestInfo(request, requst_type, start_time, timeout_msec) {}
+ void SetEndTime(const TimevalStruct& end_time) {
+ end_time_ = end_time;
+ }
};
+
class RequestInfoTest : public ::testing::Test {
- protected:
- virtual void SetUp() {
- //INIT_LOGGER("log4cxx.properties");
- count_of_requests_for_test_ = 1000;
- hmi_connection_key_ = 0;
- mobile_connection_key1_ = 65431;
- mobile_connection_key2_ = 65123;
- default_timeout_ = 10;
- srand(42);
- }
- virtual void TearDown() {
- //DEINIT_LOGGER();
- }
-
- request_info::RequestInfoSet request_info_set_;
- uint32_t count_of_requests_for_test_ ;
- uint32_t hmi_connection_key_;
- uint32_t mobile_connection_key1_;
- uint32_t mobile_connection_key2_;
- uint32_t default_timeout_;
-
- utils::SharedPtr<TestRequestInfo> create_test_info(uint32_t connection_key,
- uint32_t correlation_id,
- request_info::RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
- uint64_t timeout_sec) {
- utils::SharedPtr<MockRequest> mock_request(new MockRequest(connection_key,correlation_id));
- TestRequestInfo* test_request_raw = new TestRequestInfo(mock_request,requst_type,
- start_time, timeout_sec);
- utils::SharedPtr<TestRequestInfo> request(test_request_raw);
- return request;
- }
+ protected:
+ virtual void SetUp() OVERRIDE {
+ count_of_requests_for_test_ = 1000;
+ hmi_connection_key_ = 0;
+ mobile_connection_key1_ = 65431;
+ mobile_connection_key2_ = 65123;
+ mobile_correlation_id = 111;
+ default_timeout_ = 10;
+ }
+
+ request_info::RequestInfoSet request_info_set_;
+ uint32_t count_of_requests_for_test_;
+ uint32_t hmi_connection_key_;
+ uint32_t mobile_connection_key1_;
+ uint32_t mobile_connection_key2_;
+ uint32_t default_timeout_;
+ uint32_t mobile_correlation_id;
+
+ utils::SharedPtr<TestRequestInfo> CreateTestInfo(
+ uint32_t connection_key,
+ uint32_t correlation_id,
+ request_info::RequestInfo::RequestType requst_type,
+ const TimevalStruct& start_time,
+ uint64_t timeout_msec) {
+ utils::SharedPtr<MockRequest> mock_request =
+ utils::MakeShared<MockRequest>(connection_key, correlation_id);
+ utils::SharedPtr<TestRequestInfo> request =
+ utils::MakeShared<TestRequestInfo>(
+ mock_request, requst_type, start_time, timeout_msec);
+ return request;
+ }
};
-TEST_F(RequestInfoTest, RequestInfoEqualEndTimeTest) {
- std::list<utils::SharedPtr<TestRequestInfo> > requests;
+TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
+ std::vector<utils::SharedPtr<TestRequestInfo>> requests;
const TimevalStruct& time = date_time::DateTime::getCurrentTime();
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
- create_test_info(rand(), rand(), request_info::RequestInfo::MobileRequest,
- time, default_timeout_);
+ utils::SharedPtr<TestRequestInfo> request = CreateTestInfo(
+ i, i, request_info::RequestInfo::MobileRequest, time, default_timeout_);
request->SetEndTime(time);
EXPECT_TRUE(request_info_set_.Add(request));
}
EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
}
-TEST_F(RequestInfoTest, RequestInfoSetInsertErazeTest) {
+TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
utils::SharedPtr<TestRequestInfo> request =
- create_test_info(hmi_connection_key_, i, request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(), default_timeout_);
- EXPECT_TRUE(request_info_set_.Add(request));
- EXPECT_EQ(1, request_info_set_.RemoveRequest(request));
+ CreateTestInfo(hmi_connection_key_,
+ i,
+ request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+ EXPECT_TRUE(request_info_set_.Add(request));
+ EXPECT_TRUE(request_info_set_.RemoveRequest(request));
}
EXPECT_EQ(0u, request_info_set_.Size());
- std::list<utils::SharedPtr<TestRequestInfo> > requests;
+}
+TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
+ std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+
+ // Add hmi requests
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
- create_test_info(hmi_connection_key_, i, request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(), default_timeout_);
- requests.push_back(request);
- EXPECT_TRUE(request_info_set_.Add(request));
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(hmi_connection_key_,
+ i,
+ request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+ requests.push_back(request);
+ EXPECT_TRUE(request_info_set_.Add(request));
}
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
- std::list<utils::SharedPtr<TestRequestInfo> >::iterator it = requests.begin();
- std::list<utils::SharedPtr<TestRequestInfo> >::iterator end = requests.end();
+ // Delete every request
+ std::vector<utils::SharedPtr<TestRequestInfo>>::iterator req_it =
+ requests.begin();
- for (; it != end; ++it) {
- EXPECT_EQ(1,request_info_set_.RemoveRequest(*it));
+ for (; req_it != requests.end(); ++req_it) {
+ EXPECT_TRUE(request_info_set_.RemoveRequest(*req_it));
}
EXPECT_EQ(0u, request_info_set_.Size());
- it = requests.begin();
- for (; it != end; ++it) {
- EXPECT_TRUE(request_info_set_.Add(*it));
+
+ // Delete requests by connection key
+ req_it = requests.begin();
+ for (; req_it != requests.end(); ++req_it) {
+ EXPECT_TRUE(request_info_set_.Add(*req_it));
}
EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
- EXPECT_EQ(count_of_requests_for_test_, request_info_set_.RemoveByConnectionKey(hmi_connection_key_));
+ EXPECT_EQ(count_of_requests_for_test_,
+ request_info_set_.RemoveByConnectionKey(hmi_connection_key_));
EXPECT_EQ(0u, request_info_set_.Size());
- it = requests.begin();
- for (; it != end; ++it) {
- EXPECT_TRUE(request_info_set_.Add(*it));
+}
+
+TEST_F(RequestInfoTest, CheckRequestsMaxCount) {
+ const uint32_t app_hmi_level_time_scale = 100;
+ const uint32_t hmi_level_count = 1000;
+
+ // Count of added requests is less than max possible
+ std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+ for (uint32_t i = 0; i < hmi_level_count - 1; ++i) {
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(mobile_connection_key1_,
+ i,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+
+ request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ requests.push_back(request);
+ EXPECT_TRUE(request_info_set_.Add(request));
}
- EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
+ EXPECT_EQ(hmi_level_count - 1, request_info_set_.Size());
+
+ EXPECT_TRUE(request_info_set_.CheckHMILevelTimeScaleMaxRequest(
+ mobile_apis::HMILevel::HMI_FULL,
+ mobile_connection_key1_,
+ app_hmi_level_time_scale,
+ hmi_level_count));
+
+ // Adding new request is correct
+ utils::SharedPtr<TestRequestInfo> new_request =
+ CreateTestInfo(mobile_connection_key1_,
+ hmi_level_count,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+ new_request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_TRUE(request_info_set_.Add(new_request));
+ EXPECT_EQ(hmi_level_count, request_info_set_.Size());
+
+ // Count of added requests is max
+ EXPECT_FALSE(request_info_set_.CheckHMILevelTimeScaleMaxRequest(
+ mobile_apis::HMILevel::HMI_FULL,
+ mobile_connection_key1_,
+ app_hmi_level_time_scale,
+ hmi_level_count));
+
+ utils::SharedPtr<TestRequestInfo> new_request2 =
+ CreateTestInfo(mobile_connection_key1_,
+ hmi_level_count + 1,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+
+ EXPECT_TRUE(request_info_set_.Add(new_request2));
+}
+
+TEST_F(RequestInfoTest, CheckMaxCountOfRequest) {
+ const uint32_t app_hmi_level_time_scale = 100;
+ const uint32_t hmi_level_count = 1000;
+
+ // Count of added requests is less than max possible
+ std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+ for (uint32_t i = 0; i < hmi_level_count - 1; ++i) {
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(mobile_connection_key1_,
+ i,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+ request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ requests.push_back(request);
+ EXPECT_TRUE(request_info_set_.Add(request));
+ }
+ EXPECT_EQ(hmi_level_count - 1, request_info_set_.Size());
+
+ EXPECT_TRUE(request_info_set_.CheckTimeScaleMaxRequest(
+ mobile_connection_key1_, app_hmi_level_time_scale, hmi_level_count));
+
+ // Adding new request is correct
+ utils::SharedPtr<TestRequestInfo> new_request =
+ CreateTestInfo(mobile_connection_key1_,
+ hmi_level_count,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+ new_request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_TRUE(request_info_set_.Add(new_request));
+ EXPECT_EQ(hmi_level_count, request_info_set_.Size());
+
+ // Count of added requests is max
+ EXPECT_FALSE(request_info_set_.CheckTimeScaleMaxRequest(
+ mobile_connection_key1_, app_hmi_level_time_scale, hmi_level_count));
+
+ utils::SharedPtr<TestRequestInfo> new_request2 =
+ CreateTestInfo(mobile_connection_key1_,
+ hmi_level_count + 1,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+
+ EXPECT_TRUE(request_info_set_.Add(new_request2));
+}
+
+TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
utils::SharedPtr<TestRequestInfo> mobile_request1 =
- create_test_info(mobile_connection_key1_, 12345, request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(), default_timeout_);
+ CreateTestInfo(mobile_connection_key1_,
+ 12345,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request1));
utils::SharedPtr<TestRequestInfo> mobile_request2 =
- create_test_info(mobile_connection_key2_, 54321, request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(), default_timeout_);
+ CreateTestInfo(mobile_connection_key2_,
+ 54321,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request2));
- EXPECT_EQ(count_of_requests_for_test_ + 2, request_info_set_.Size());
+ EXPECT_EQ(2u, request_info_set_.Size());
EXPECT_EQ(2u, request_info_set_.RemoveMobileRequests());
- EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
- EXPECT_TRUE(request_info_set_.Add(mobile_request1));
- EXPECT_TRUE(request_info_set_.Add(mobile_request2));
- EXPECT_EQ(1u, request_info_set_.RemoveByConnectionKey(mobile_connection_key1_));
- EXPECT_EQ(count_of_requests_for_test_ + 1, request_info_set_.Size());
- EXPECT_EQ(count_of_requests_for_test_, request_info_set_.RemoveByConnectionKey(hmi_connection_key_));
- EXPECT_EQ(1u, request_info_set_.Size());
- EXPECT_EQ(1u, request_info_set_.RemoveMobileRequests());
EXPECT_EQ(0u, request_info_set_.Size());
}
-TEST_F(RequestInfoTest, RequestInfoSetFrontTest) {
+TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
+ std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+ const uint32_t count_of_mobile_request1 = 200;
+ const uint32_t count_of_mobile_request2 = 100;
+ for (uint32_t i = 0; i < count_of_mobile_request1; ++i) {
+ utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ CreateTestInfo(mobile_connection_key1_,
+ i,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+ requests.push_back(mobile_request1);
+ EXPECT_TRUE(request_info_set_.Add(mobile_request1));
+ }
+ EXPECT_EQ(count_of_mobile_request1, request_info_set_.Size());
+
+ for (uint32_t i = 0; i < count_of_mobile_request2; ++i) {
+ utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ CreateTestInfo(mobile_connection_key2_,
+ i,
+ request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(),
+ default_timeout_);
+
+ requests.push_back(mobile_request2);
+ EXPECT_TRUE(request_info_set_.Add(mobile_request2));
+ }
+ EXPECT_EQ(count_of_mobile_request1 + count_of_mobile_request2,
+ request_info_set_.Size());
+
+ EXPECT_EQ(count_of_mobile_request1,
+ request_info_set_.RemoveByConnectionKey(mobile_connection_key1_));
+ EXPECT_EQ(count_of_mobile_request2,
+ request_info_set_.RemoveByConnectionKey(mobile_connection_key2_));
+ EXPECT_EQ(0u, request_info_set_.Size());
+}
+
+TEST_F(RequestInfoTest, RequestInfoSetFront) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
- create_test_info(mobile_connection_key1_, i, request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(), i);
- request_info_set_.Add(request);
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(mobile_connection_key1_,
+ i,
+ request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(),
+ i);
+ request_info_set_.Add(request);
}
for (uint32_t i = 1; i < count_of_requests_for_test_; ++i) {
request_info::RequestInfoPtr request_info = request_info_set_.Front();
EXPECT_TRUE(request_info.valid());
- EXPECT_EQ(0u, request_info->timeout_sec());
request_info = request_info_set_.FrontWithNotNullTimeout();
EXPECT_TRUE(request_info.valid());
- EXPECT_EQ(i, request_info->timeout_sec());
EXPECT_TRUE(request_info_set_.RemoveRequest(request_info));
}
EXPECT_EQ(1u, request_info_set_.Size());
- EXPECT_EQ(1u, request_info_set_.RemoveByConnectionKey(mobile_connection_key1_));
+ EXPECT_EQ(1u,
+ request_info_set_.RemoveByConnectionKey(mobile_connection_key1_));
EXPECT_EQ(0u, request_info_set_.Size());
}
-TEST_F(RequestInfoTest, RequestInfoSetFindTest) {
-
- std::list <std::pair<uint32_t, uint32_t> > appId_coorrId;
+TEST_F(RequestInfoTest, RequestInfoSetFind) {
+ std::vector<std::pair<uint32_t, uint32_t>> appid_connection_id;
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- appId_coorrId.push_back(std::pair<uint32_t, uint32_t>(rand(),rand()));
+ appid_connection_id.push_back(
+ std::pair<uint32_t, uint32_t>(i, count_of_requests_for_test_ - i));
}
- std::list <std::pair<uint32_t, uint32_t> >::iterator it;
- std::list <std::pair<uint32_t, uint32_t> >::iterator end =
- appId_coorrId.end();;
+ std::vector<std::pair<uint32_t, uint32_t>>::iterator req_it =
+ appid_connection_id.begin();
+ const std::vector<std::pair<uint32_t, uint32_t>>::iterator end =
+ appid_connection_id.end();
- for (it = appId_coorrId.begin(); it != end; ++it) {
+ for (; req_it != end; ++req_it) {
utils::SharedPtr<TestRequestInfo> request =
- create_test_info(it->first, it->second, request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(), 10);
+ CreateTestInfo(req_it->first,
+ req_it->second,
+ request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(),
+ 10);
EXPECT_TRUE(request_info_set_.Add(request));
}
- request_info::RequestInfoPtr request = request_info_set_.Find(rand(),rand());
+ request_info::RequestInfoPtr request = request_info_set_.Find(
+ count_of_requests_for_test_, count_of_requests_for_test_);
EXPECT_FALSE(request.valid());
- for (it = appId_coorrId.begin(); it != end; ++it) {
- request_info::RequestInfoPtr request = request_info_set_.Find(it->first, it->second);
+
+ req_it = appid_connection_id.begin();
+ for (; req_it != end; ++req_it) {
+ request_info::RequestInfoPtr request =
+ request_info_set_.Find(req_it->first, req_it->second);
EXPECT_TRUE(request.valid());
- EXPECT_EQ(1u, request_info_set_.RemoveRequest(request));
- request = request_info_set_.Find(it->first, it->second);
+ EXPECT_TRUE(request_info_set_.RemoveRequest(request));
+ request = request_info_set_.Find(req_it->first, req_it->second);
EXPECT_FALSE(request.valid());
}
EXPECT_EQ(0u, request_info_set_.Size());
}
-TEST_F(RequestInfoTest, RequestInfoSetEqualHashTest) {
+TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
request_info::RequestInfoSet request_info_set;
const uint32_t connection_key = 65483;
const uint32_t corr_id = 65483;
utils::SharedPtr<TestRequestInfo> request =
- create_test_info(connection_key, corr_id, request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(), 10);
+ CreateTestInfo(connection_key,
+ corr_id,
+ request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(),
+ 10);
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
EXPECT_EQ(1u, request_info_set.Size());
- request_info::RequestInfoPtr found = request_info_set.Find(connection_key, corr_id);
+ request_info::RequestInfoPtr found =
+ request_info_set.Find(connection_key, corr_id);
EXPECT_TRUE(found.valid());
- EXPECT_EQ(1u, request_info_set.RemoveRequest(found));
+ EXPECT_TRUE(request_info_set.RemoveRequest(found));
EXPECT_EQ(0u, request_info_set.Size());
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
- found = request_info_set.FrontWithNotNullTimeout();
+ found = request_info_set.FrontWithNotNullTimeout();
EXPECT_TRUE(found.valid());
- EXPECT_EQ(1u, request_info_set.RemoveRequest(found));
- found = request_info_set.FrontWithNotNullTimeout();
+ EXPECT_TRUE(request_info_set.RemoveRequest(found));
+ found = request_info_set.FrontWithNotNullTimeout();
+ EXPECT_FALSE(found.valid());
+ found = request_info_set.Front();
EXPECT_FALSE(found.valid());
EXPECT_EQ(0u, request_info_set.Size());
}
+TEST_F(RequestInfoTest, EndTimeisExpired) {
+ TimevalStruct time = date_time::DateTime::getCurrentTime();
-uint32_t MockRequest::correlation_id() const {
- return correlation_id_;
-}
+ TimevalStruct not_expired = date_time::DateTime::getCurrentTime();
+ not_expired.tv_usec = std::numeric_limits<time_t>::min();
-uint32_t MockRequest::connection_key() const {
- return connection_key_;
+ TimevalStruct expired = date_time::DateTime::getCurrentTime();
+ expired.tv_usec = std::numeric_limits<time_t>::max();
+
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(mobile_connection_key1_,
+ mobile_correlation_id,
+ request_info::RequestInfo::MobileRequest,
+ time,
+ default_timeout_);
+
+ request->SetEndTime(expired);
+ EXPECT_FALSE(request->isExpired());
+
+ request->SetEndTime(not_expired);
+ EXPECT_TRUE(request->isExpired());
}
+TEST_F(RequestInfoTest, UpdateEndTime) {
+ TimevalStruct time = date_time::DateTime::getCurrentTime();
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(mobile_connection_key1_,
+ mobile_correlation_id,
+ request_info::RequestInfo::MobileRequest,
+ time,
+ default_timeout_);
+ request->SetEndTime(time);
+ request->updateEndTime();
+ TimevalStruct last_time = request->end_time();
+ EXPECT_LE(time.tv_sec, last_time.tv_sec);
+}
+TEST_F(RequestInfoTest, UpdateTimeOut) {
+ TimevalStruct time = date_time::DateTime::getCurrentTime();
+ utils::SharedPtr<TestRequestInfo> request =
+ CreateTestInfo(mobile_connection_key1_,
+ mobile_correlation_id,
+ request_info::RequestInfo::MobileRequest,
+ time,
+ default_timeout_);
+ request->SetEndTime(time);
+ request->updateEndTime();
-void TestRequestInfo::SetEndTime(const TimevalStruct& end_time) {
- end_time_ = end_time;
+ request->updateTimeOut(100);
+ time = date_time::DateTime::getCurrentTime();
+ TimevalStruct last_time = request->end_time();
+ EXPECT_NEAR(time.tv_sec + 100, last_time.tv_sec, 500);
}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index bfd41b0f08..9857072674 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,14 +35,18 @@
#include <algorithm>
#include "gtest/gtest.h"
#include "application_manager/usage_statistics.h"
-#include "include/application_mock.h"
-#include "include/resumption_data_mock.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_resumption_data.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application.h"
-#include "config_profile/profile.h"
#include "utils/data_accessor.h"
-#include "application_manager/test/mock_message_helper.h"
+#include "utils/make_shared.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_state_controller.h"
namespace test {
namespace components {
@@ -50,48 +54,77 @@ namespace resumption_test {
using ::testing::_;
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::DoAll;
using ::testing::SetArgReferee;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::AtLeast;
+using namespace application_manager_test;
using namespace resumption;
using namespace mobile_apis::HMILevel;
class ResumeCtrlTest : public ::testing::Test {
- public:
+ protected:
+ ResumeCtrlTest()
+ : kTestAppId_(10u)
+ , kTestPolicyAppId_("test_policy_app_id")
+ , kMacAddress_("12345")
+ , kDefaultTestLevel_(eType::HMI_NONE)
+ , kCorId_(7u)
+ , kTestDevId_(5u)
+ , kTestGrammarId_(10)
+ , kHash_("saved_hash")
+ , kAppResumingTimeout_(30000000u) {}
+
virtual void SetUp() OVERRIDE {
- app_mngr = application_manager::ApplicationManagerImpl::instance();
- // Singleton should not be destroyed
- Mock::AllowLeak(app_mngr);
- mock_storage = new NiceMock<ResumptionDataMock>();
- app_mock = new NiceMock<ApplicationMock>();
- res_ctrl.set_resumption_storage(mock_storage);
- test_audio_state = mobile_apis::AudioStreamingState::NOT_AUDIBLE;
- test_app_id = 10;
- default_testType = eType::HMI_NONE;
- test_dev_id = 5;
- test_policy_app_id = "test_policy_app_id";
- test_grammar_id = 10;
- hash = "saved_hash";
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ mock_storage =
+ ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData>>(
+ app_mngr_);
+ app_mock = utils::MakeShared<NiceMock<MockApplication>>();
+ res_ctrl = utils::MakeShared<ResumeCtrl>(app_mngr_);
+ res_ctrl->set_resumption_storage(mock_storage);
+
+ ON_CALL(app_mngr_, state_controller())
+ .WillByDefault(ReturnRef(state_controller_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(mock_application_manager_settings_));
+
+ ON_CALL(mock_application_manager_settings_, use_db_for_resumption())
+ .WillByDefault(Return(false));
+ ON_CALL(mock_application_manager_settings_, app_resuming_timeout())
+ .WillByDefault(ReturnRef(kAppResumingTimeout_));
+ }
+ void GetInfoFromApp() {
+ ON_CALL(*app_mock, policy_app_id())
+ .WillByDefault(Return(kTestPolicyAppId_));
+ ON_CALL(*app_mock, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(kTestDevId_));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(kTestAppId_));
}
- protected:
- application_manager::ApplicationManagerImpl* app_mngr;
- ResumeCtrl res_ctrl;
- NiceMock<ResumptionDataMock>* mock_storage;
- NiceMock<ApplicationMock>* app_mock;
- mobile_apis::AudioStreamingState::eType test_audio_state;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+ application_manager_test::MockApplicationManagerSettings
+ mock_application_manager_settings_;
+ application_manager_test::MockApplicationManager app_mngr_;
+ MockStateController state_controller_;
+ utils::SharedPtr<ResumeCtrl> res_ctrl;
+ utils::SharedPtr<NiceMock<resumption_test::MockResumptionData>> mock_storage;
+ utils::SharedPtr<NiceMock<MockApplication>> app_mock;
// app_mock.app_id() will return this value
- uint32_t test_app_id;
- std::string test_policy_app_id;
- mobile_apis::HMILevel::eType default_testType;
-
+ const uint32_t kTestAppId_;
+ const std::string kTestPolicyAppId_;
+ const std::string kMacAddress_;
+ const mobile_apis::HMILevel::eType kDefaultTestLevel_;
+ const uint32_t kCorId_;
// app_mock.Device() will return this value
- uint32_t test_dev_id;
- uint32_t test_grammar_id;
- std::string hash;
+ const uint32_t kTestDevId_;
+ const uint32_t kTestGrammarId_;
+ const std::string kHash_;
+ const uint32_t kAppResumingTimeout_;
};
/**
@@ -100,17 +133,20 @@ class ResumeCtrlTest : public ::testing::Test {
TEST_F(ResumeCtrlTest, StartResumption_AppWithGrammarId) {
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
// Check RestoreApplicationData
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
+ GetInfoFromApp();
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_storage,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
@@ -123,20 +159,23 @@ MATCHER_P4(CheckAppFile, is_persistent, is_download, file_name, file_type, "") {
TEST_F(ResumeCtrlTest, StartResumption_WithoutGrammarId) {
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ GetInfoFromApp();
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id)).Times(0);
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_)).Times(0);
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_FALSE(res);
}
TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
+ GetInfoFromApp();
smart_objects::SmartObject test_application_files;
smart_objects::SmartObject test_file;
const uint32_t count_of_files = 8;
@@ -164,29 +203,33 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
}
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_files] =
test_application_files;
// Check RestoreApplicationData
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_files; ++i) {
EXPECT_CALL(*app_mock,
AddFile(CheckAppFile(
- true, true, file_names[i],
+ true,
+ true,
+ file_names[i],
static_cast<mobile_apis::FileType::eType>(file_types[i]))));
}
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
+ GetInfoFromApp();
smart_objects::SmartObject test_application_submenues;
smart_objects::SmartObject test_submenu;
@@ -197,31 +240,37 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
}
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_submenus] =
test_application_submenues;
// Check RestoreApplicationData
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_submenues; ++i) {
EXPECT_CALL(*app_mock, AddSubMenu(i, test_application_submenues[i]));
}
smart_objects::SmartObjectList requests;
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillRepeatedly(Return(kCorId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- CreateAddSubMenuRequestToHMI(_)).WillRepeatedly(Return(requests));
+ CreateAddSubMenuRequestToHMI(_, kCorId_))
+ .WillRepeatedly(Return(requests));
EXPECT_CALL(*app_mock, UpdateHash());
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
+ GetInfoFromApp();
smart_objects::SmartObject test_application_commands;
smart_objects::SmartObject test_commands;
const uint32_t count_of_commands = 20;
@@ -232,17 +281,18 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
}
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_commands] =
test_application_commands;
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_commands; ++i) {
EXPECT_CALL(*app_mock, AddCommand(i, test_application_commands[i]));
@@ -250,9 +300,10 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
smart_objects::SmartObjectList requests;
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- CreateAddCommandRequestToHMI(_)).WillRepeatedly(Return(requests));
+ CreateAddCommandRequestToHMI(_, _))
+ .WillRepeatedly(Return(requests));
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
@@ -280,17 +331,19 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
}
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_choice_sets] =
application_choice_sets;
// Check RestoreApplicationData
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
EXPECT_CALL(*app_mock, AddChoiceSet(i, application_choice_sets[i]));
@@ -301,7 +354,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
CreateAddVRCommandRequestFromChoiceToHMI(_))
.WillRepeatedly(Return(requests));
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
@@ -309,17 +362,19 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
// Prepare Data
smart_objects::SmartObject test_global_properties;
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_global_properties] =
test_global_properties;
// Check RestoreApplicationData
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendGlobalPropertiesToHMI(_));
@@ -327,7 +382,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
EXPECT_CALL(*app_mock, load_global_properties(test_global_properties));
EXPECT_CALL(*app_mock, UpdateHash());
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
@@ -345,28 +400,31 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
app_buttons;
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_subscribtions] =
test_subscriptions;
// Check RestoreApplicationData
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_buttons; ++i) {
- EXPECT_CALL(*app_mock, SubscribeToButton(
- static_cast<mobile_apis::ButtonName::eType>(i)));
+ EXPECT_CALL(
+ *app_mock,
+ SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(i)));
}
EXPECT_CALL(*app_mock, UpdateHash());
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- SendAllOnButtonSubscriptionNotificationsForApp(_)).Times(2);
+ SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2);
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
@@ -386,17 +444,19 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
app_vi;
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::application_subscribtions] =
test_subscriptions;
// Check RestoreApplicationData
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .Times(3)
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
for (size_t i = 0; i < app_vi.length(); ++i) {
EXPECT_CALL(
@@ -404,97 +464,62 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
SubscribeToIVI(static_cast<application_manager::VehicleDataType>(i)));
}
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
smart_objects::SmartObjectList requests;
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
GetIVISubscriptionRequests(_)).WillRepeatedly(Return(requests));
EXPECT_CALL(*app_mock, UpdateHash());
- bool res = res_ctrl.StartResumption(app_mock, hash);
+ bool res = res_ctrl->StartResumption(app_mock, kHash_);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
smart_objects::SmartObject saved_app;
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillOnce(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
+ EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
.WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
-
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .Times(3)
- .WillRepeatedly(Return(default_testType));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr, SetState(test_app_id, default_testType,
- test_audio_state)).Times(2);
- bool res = res_ctrl.StartResumptionOnlyHMILevel(app_mock);
+ bool res = res_ctrl->StartResumptionOnlyHMILevel(app_mock);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
- mobile_apis::HMILevel::eType restored_testType = eType::HMI_FULL;
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
- saved_app[application_manager::strings::hmi_level] = restored_testType;
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr,
- SetHmiState(test_app_id, restored_testType)).Times(AtLeast(1));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
- .Times(2)
+ EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
-
EXPECT_CALL(*mock_storage, RemoveApplicationFromSaved(_, _))
.WillOnce(Return(true));
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
.WillRepeatedly(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(true));
-
- res_ctrl.StartAppHmiStateResumption(app_mock);
+ res_ctrl->StartAppHmiStateResumption(app_mock);
}
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
- mobile_apis::HMILevel::eType restored_testType = eType::HMI_BACKGROUND;
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_BACKGROUND;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
- saved_app[application_manager::strings::hmi_level] = restored_testType;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
-
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
- .WillOnce(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(true));
-
- res_ctrl.StartAppHmiStateResumption(app_mock);
+ res_ctrl->StartAppHmiStateResumption(app_mock);
}
/**
@@ -502,320 +527,153 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
*/
TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
- mobile_apis::HMILevel::eType restored_testType = eType::HMI_FULL;
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hash_id] = hash;
- saved_app[application_manager::strings::grammar_id] = test_grammar_id;
- saved_app[application_manager::strings::hmi_level] = restored_testType;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
.WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice(""))
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
.WillOnce(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillRepeatedly(Return(false));
+ EXPECT_CALL(*app_mock, set_is_resuming(true));
- utils::SharedPtr<application_manager::Application> null_app;
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(null_app));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, restored_testType, test_audio_state));
-
- bool res = res_ctrl.RestoreAppHMIState(app_mock);
+ bool res = res_ctrl->RestoreAppHMIState(app_mock);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
smart_objects::SmartObject saved_app;
- saved_app[application_manager::strings::hmi_level] = default_testType;
+ saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(default_testType));
-
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(true));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
- EXPECT_CALL(*app_mngr,
- SetHmiState(test_app_id, default_testType)).Times(AtLeast(1));
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillOnce(Return(kDefaultTestLevel_));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr, SetState(test_app_id, default_testType,
- test_audio_state)).Times(2);
+ EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ .Times(AtLeast(1));
- res_ctrl.SetupDefaultHMILevel(app_mock);
+ res_ctrl->SetupDefaultHMILevel(app_mock);
}
/**
* @brief group of tests which check correct SetAppHMIState
*/
-TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_NotMedia_WithoutCheckPolicy) {
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(true));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_WithoutCheckPolicy) {
+ GetInfoFromApp();
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr, SetState(test_app_id, default_testType,
- test_audio_state)).Times(2);
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- bool res = res_ctrl.SetAppHMIState(app_mock, default_testType, false);
+ EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ .Times(AtLeast(1));
+ bool res = res_ctrl->SetAppHMIState(app_mock, kDefaultTestLevel_, false);
EXPECT_TRUE(res);
}
-// TODO(VVeremjova) APPLINK-16718
-TEST_F(ResumeCtrlTest,
- DISABLED_SetAppHMIState_HMILimited_NotMedia_WithoutCheckPolicy) {
- mobile_apis::HMILevel::eType testType = eType::HMI_LIMITED;
-
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice(""))
- .WillRepeatedly(Return(policy::DeviceConsent::kDeviceAllowed));
- EXPECT_CALL(*app_mngr, SetState(test_app_id, testType, test_audio_state));
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMILimited_WithoutCheckPolicy) {
+ mobile_apis::HMILevel::eType test_type = eType::HMI_LIMITED;
+ GetInfoFromApp();
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
+ EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ .Times(AtLeast(1));
+ bool res = res_ctrl->SetAppHMIState(app_mock, test_type, false);
EXPECT_TRUE(res);
}
-TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_NotMedia_WithoutCheckPolicy) {
- mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
- ::testing::InSequence seq;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(false));
-
- // Only mocked application is exist
- utils::SharedPtr<application_manager::Application> null_app;
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(null_app));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
-
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithoutCheckPolicy) {
+ mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
+ GetInfoFromApp();
// GetDefaultHmiLevel should not be called
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_)).Times(0);
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_)).Times(0);
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mngr, SetState(test_app_id, testType, test_audio_state));
+ EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ .Times(AtLeast(1));
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
+ bool res = res_ctrl->SetAppHMIState(app_mock, test_type, false);
EXPECT_TRUE(res);
}
-TEST_F(ResumeCtrlTest,
- SetAppHMIState_HMIFull_NotMedia_WithoutPolicy_AnotherFullActiveExists) {
- mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
- ::testing::InSequence seq;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(false));
-
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
-
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
- // Expect set default HMI state
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
-
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
- EXPECT_TRUE(res);
-}
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevAllowed) {
+ mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
-TEST_F(ResumeCtrlTest,
- SetAppHMIState_HMIFull_MediaAudio_WithoutPolicy_AnotherActiveAppExists) {
- mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
-
- // In case application is media, audio state will be AUDIBLE
- test_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
- // Only our app in FULL
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(false));
-
- // Active app exists
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
-
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_)).Times(0);
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
- mobile_apis::HMILevel::eType expected_testType = eType::HMI_LIMITED;
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, expected_testType, test_audio_state));
-
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
- EXPECT_TRUE(res);
-}
-
-TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_Media_WithoutPolicy_FullExists) {
- default_testType = eType::HMI_FULL;
-
- // In case application is media, audio state will be AUDIBLE
- test_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
- ::testing::InSequence seq;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(true));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
-
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
-
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
- bool res = res_ctrl.SetAppHMIState(app_mock, default_testType, false);
- EXPECT_TRUE(res);
-}
-
-TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_NotMedia_WithPolicy_DevAllowed) {
- mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
-
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ GetInfoFromApp();
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
.WillOnce(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(true));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
-
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
-
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
-
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, true);
- EXPECT_TRUE(res);
-}
-
-TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_Media_WithCheckPolicy) {
- mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
-
- // In case application is media, audio state will be AUDIBLE
- test_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
- ::testing::InSequence seq;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
- // App is allowed
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
- .WillOnce(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
- .WillOnce(Return(false));
- EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_)).Times(0);
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ .Times(AtLeast(1));
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
-
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
-
- mobile_apis::HMILevel::eType expected_testType = eType::HMI_LIMITED;
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, expected_testType, test_audio_state));
-
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, true);
+ bool res = res_ctrl->SetAppHMIState(app_mock, test_type, true);
EXPECT_TRUE(res);
}
-TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_Media_WithPolicy_DevDisallowed) {
- mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) {
+ mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
- ::testing::InSequence seq;
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ GetInfoFromApp();
+ EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
.WillOnce(Return(policy::kDeviceDisallowed));
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
-
- bool res = res_ctrl.SetAppHMIState(app_mock, testType, true);
+ EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillOnce(Return(kDefaultTestLevel_));
+ EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ .Times(AtLeast(1));
+ bool res = res_ctrl->SetAppHMIState(app_mock, test_type, true);
EXPECT_FALSE(res);
}
TEST_F(ResumeCtrlTest, SaveApplication) {
utils::SharedPtr<application_manager::Application> app_sh_mock =
- new ApplicationMock();
+ ::utils::MakeShared<application_manager_test::MockApplication>();
EXPECT_CALL(*mock_storage, SaveApplication(app_sh_mock));
- res_ctrl.SaveApplication(app_sh_mock);
+ res_ctrl->SaveApplication(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) {
- ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
-
smart_objects::SmartObject saved_app;
- EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
- .WillOnce(Return(default_testType));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
- EXPECT_CALL(*app_mngr,
- SetState(test_app_id, default_testType, test_audio_state));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ GetInfoFromApp();
+
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
+ .WillOnce(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
.WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(kTestAppId_));
- bool res = res_ctrl.StartResumptionOnlyHMILevel(app_mock);
+ bool res = res_ctrl->StartResumptionOnlyHMILevel(app_mock);
EXPECT_TRUE(res);
- utils::SharedPtr<ApplicationMock> app_sh_mock = new ApplicationMock();
+ utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
+ ::utils::MakeShared<application_manager_test::MockApplication>();
- EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(test_app_id));
- res_ctrl.OnAppActivated(app_sh_mock);
+ EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_));
+ res_ctrl->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) {
- utils::SharedPtr<ApplicationMock> app_sh_mock = new ApplicationMock();
+ utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
+ ::utils::MakeShared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).Times(0);
- res_ctrl.OnAppActivated(app_sh_mock);
+ res_ctrl->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, IsHMIApplicationIdExist) {
@@ -823,17 +681,17 @@ TEST_F(ResumeCtrlTest, IsHMIApplicationIdExist) {
EXPECT_CALL(*mock_storage, IsHMIApplicationIdExist(hmi_app_id))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl.IsHMIApplicationIdExist(hmi_app_id));
+ EXPECT_TRUE(res_ctrl->IsHMIApplicationIdExist(hmi_app_id));
}
TEST_F(ResumeCtrlTest, GetHMIApplicationID) {
uint32_t hmi_app_id = 10;
std::string device_id = "test_device_id";
- EXPECT_CALL(*mock_storage, GetHMIApplicationID(test_policy_app_id, device_id))
+ EXPECT_CALL(*mock_storage, GetHMIApplicationID(kTestPolicyAppId_, device_id))
.WillOnce(Return(hmi_app_id));
EXPECT_EQ(hmi_app_id,
- res_ctrl.GetHMIApplicationID(test_policy_app_id, device_id));
+ res_ctrl->GetHMIApplicationID(kTestPolicyAppId_, device_id));
}
TEST_F(ResumeCtrlTest, IsApplicationSaved) {
@@ -842,7 +700,7 @@ TEST_F(ResumeCtrlTest, IsApplicationSaved) {
EXPECT_CALL(*mock_storage, IsApplicationSaved(policy_app_id, device_id))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl.IsApplicationSaved(policy_app_id, device_id));
+ EXPECT_TRUE(res_ctrl->IsApplicationSaved(policy_app_id, device_id));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
@@ -851,13 +709,11 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = HMI_FULL;
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
.WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl.CheckPersistenceFilesForResumption(app_mock));
+ EXPECT_TRUE(res_ctrl->CheckPersistenceFilesForResumption(app_mock));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
@@ -869,17 +725,15 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
saved_app[application_manager::strings::application_commands] =
test_application_commands;
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
.WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- VerifyImageFiles(_, _))
+ VerifyImageFiles(_, _, _))
.WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
- EXPECT_TRUE(res_ctrl.CheckPersistenceFilesForResumption(app_mock));
+ EXPECT_TRUE(res_ctrl->CheckPersistenceFilesForResumption(app_mock));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
@@ -891,45 +745,43 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
saved_app[application_manager::strings::application_choice_sets] =
test_choice_sets;
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
-
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
.WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl.CheckPersistenceFilesForResumption(app_mock));
+ EXPECT_TRUE(res_ctrl->CheckPersistenceFilesForResumption(app_mock));
}
// TODO (VVeremjova) APPLINK-16718
TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
EXPECT_CALL(*mock_storage, OnSuspend());
- res_ctrl.OnSuspend();
+ res_ctrl->OnSuspend();
}
TEST_F(ResumeCtrlTest, OnAwake) {
+ uint32_t timeout = 10u;
+ EXPECT_CALL(mock_application_manager_settings_,
+ app_resumption_save_persistent_data_timeout())
+ .WillOnce(ReturnRef(timeout));
EXPECT_CALL(*mock_storage, OnAwake());
- res_ctrl.OnAwake();
+ res_ctrl->OnAwake();
}
TEST_F(ResumeCtrlTest, RemoveApplicationFromSaved) {
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ GetInfoFromApp();
EXPECT_CALL(*mock_storage, RemoveApplicationFromSaved(_, _))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl.RemoveApplicationFromSaved(app_mock));
+ EXPECT_TRUE(res_ctrl->RemoveApplicationFromSaved(app_mock));
}
-TEST_F(ResumeCtrlTest, CheckApplicationHash) {
+TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = kHash_;
- std::string test_hash = "saved_hash";
- saved_app[application_manager::strings::hash_id] = test_hash;
-
- ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
- ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
- EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ GetInfoFromApp();
+ EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
.WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl.CheckApplicationHash(app_mock, test_hash));
+ EXPECT_TRUE(res_ctrl->CheckApplicationHash(app_mock, kHash_));
}
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index a6ced14349..2fc1e5e5ec 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,15 +33,15 @@
#include <string>
#include <algorithm>
#include "gtest/gtest.h"
-#include "include/application_mock.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager_settings.h"
#include "interfaces/MOBILE_API.h"
#include "sql_database.h"
#include "sql_query.h"
-
-#include "application_manager/application_manager_impl.h"
-#include "config_profile/profile.h"
+#include "utils/make_shared.h"
#include "utils/file_system.h"
-#include "include/resumption_data_test.h"
+#include "application_manager/resumption_data_test.h"
+#include "application_manager/test_resumption_data_db.h"
#include "application_manager/resumption/resumption_sql_queries.h"
#include "application_manager/resumption/resumption_data_db.h"
@@ -51,6 +51,8 @@ namespace components {
namespace resumption_test {
using ::testing::NiceMock;
+using ::testing::ReturnRef;
+using application_manager_test::MockApplication;
namespace am = application_manager;
using namespace file_system;
@@ -58,17 +60,14 @@ using namespace file_system;
using namespace resumption;
using namespace mobile_apis;
-class TestResumptionDataDB : public ResumptionDataDB {
- public:
- utils::dbms::SQLDatabase* get_db_handle() { return db(); }
-
- TestResumptionDataDB(DbStorage db_storage) : ResumptionDataDB(db_storage) {}
-};
-
+namespace {
+const std::string kPath =
+ file_system::CurrentWorkingDirectory() + "/" + "test_storage";
+}
class ResumptionDataDBTest : public ResumptionDataTest {
protected:
- virtual void SetUp() {
- app_mock = new NiceMock<ApplicationMock>();
+ void SetUp() OVERRIDE {
+ app_mock = utils::MakeShared<NiceMock<MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
is_audio_ = true;
@@ -78,7 +77,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
ign_off_count_ = 0;
grammar_id_ = 16;
}
- virtual void TearDown() {
+ void TearDown() OVERRIDE {
utils::dbms::SQLQuery query(test_db());
EXPECT_TRUE(query.Prepare(remove_all_tables));
EXPECT_TRUE(query.Exec());
@@ -87,12 +86,11 @@ class ResumptionDataDBTest : public ResumptionDataTest {
static void SetUpTestCase() {
kDatabaseName = "resumption";
if (is_in_file) {
- ::profile::Profile::instance()->config_file_name(
- "smartDeviceLink_test.ini");
- path_ = profile::Profile::instance()->app_storage_folder();
- CreateDirectory("./" + path_);
+ path_ = "test_storage";
+ CreateDirectory(file_system::CurrentWorkingDirectory() + "/" + path_);
+ CreateDirectory(kPath);
test_db_ = new utils::dbms::SQLDatabase(kDatabaseName);
- test_db_->set_path(path_ + "/");
+ test_db_->set_path(kPath + "/");
res_db_ = new TestResumptionDataDB(In_File_Storage);
} else {
res_db_ = new TestResumptionDataDB(In_Memory_Storage);
@@ -110,14 +108,17 @@ class ResumptionDataDBTest : public ResumptionDataTest {
static void TearDownTestCase() {
test_db_->Close();
if (is_in_file) {
- ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
RemoveDirectory("./" + path_, true);
}
delete res_db_;
}
- utils::dbms::SQLDatabase* test_db() { return test_db_; }
- std::string path() { return path_; }
+ utils::dbms::SQLDatabase* test_db() {
+ return test_db_;
+ }
+ std::string path() {
+ return path_;
+ }
void SetZeroIgnOffTime() {
utils::dbms::SQLQuery query(test_db());
@@ -128,11 +129,12 @@ class ResumptionDataDBTest : public ResumptionDataTest {
static TestResumptionDataDB* res_db_;
- TestResumptionDataDB* res_db() { return res_db_; }
+ TestResumptionDataDB* res_db() {
+ return res_db_;
+ }
// Check that db includes tables with given elements
void CheckSavedDB();
-
static const bool is_in_file = false;
const std::string tables_exist =
"SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table';";
@@ -142,6 +144,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
const std::string remove_all_tables =
"DELETE FROM `resumption`; "
+ "DELETE FROM `subscribedForWayPoints`; "
"DELETE FROM `image`; "
"DELETE FROM `applicationChoiceSet`; "
"DELETE FROM `file`; "
@@ -205,7 +208,7 @@ void ResumptionDataDBTest::CheckSavedDB() {
void ResumptionDataDBTest::CheckExistenceApplication() {
utils::dbms::SQLQuery query(test_db());
EXPECT_TRUE(query.Prepare(kCheckApplication));
- query.Bind(0, device_id_);
+ query.Bind(0, kMacAddress_);
query.Bind(1, policy_app_id_);
EXPECT_TRUE(query.Exec());
EXPECT_EQ(1, query.GetInteger(0));
@@ -225,7 +228,7 @@ void ResumptionDataDBTest::CheckAppData() {
EXPECT_EQ(ign_off_count_, query.GetUInteger(6));
- EXPECT_EQ(device_id_, query.GetString(8));
+ EXPECT_EQ(kMacAddress_, query.GetString(8));
EXPECT_EQ(is_audio_, query.GetBoolean(9));
}
@@ -348,7 +351,7 @@ void ResumptionDataDBTest::CheckSubmenuData() {
EXPECT_TRUE(select_submenu.Prepare(kSelectCountSubMenu));
BindId(select_submenu);
EXPECT_TRUE(select_submenu.Exec());
- EXPECT_EQ(count_of_submenues, select_submenu.GetUInteger(0));
+ EXPECT_EQ(kCountOfSubmenues_, select_submenu.GetUInteger(0));
EXPECT_TRUE(select_submenu.Prepare(kSelectSubMenu));
BindId(select_submenu);
@@ -371,7 +374,7 @@ void ResumptionDataDBTest::CheckCommandsData() {
EXPECT_TRUE(select_commands.Prepare(kSelectCountCommands));
BindId(select_commands);
EXPECT_TRUE(select_commands.Exec());
- EXPECT_EQ(count_of_commands, select_commands.GetUInteger(0));
+ EXPECT_EQ(kCountOfCommands_, select_commands.GetUInteger(0));
EXPECT_TRUE(select_commands.Prepare(kSelectCommands));
BindId(select_commands);
@@ -419,7 +422,7 @@ void ResumptionDataDBTest::CheckChoiceSetData() {
EXPECT_TRUE(select_choice_set.Prepare(kSelectCountChoiceSet));
BindId(select_choice_set);
EXPECT_TRUE(select_choice_set.Exec());
- EXPECT_EQ(count_of_choice_sets, select_choice_set.GetUInteger(0));
+ EXPECT_EQ(kCountOfChoiceSets_, select_choice_set.GetUInteger(0));
EXPECT_TRUE(select_choice_set.Prepare(kSelectChoiceSets));
int64_t app_set_key = 0;
@@ -507,7 +510,7 @@ void ResumptionDataDBTest::CheckAppFilesData() {
EXPECT_TRUE(query.Prepare(kSelectCountFiles));
BindId(query);
EXPECT_TRUE(query.Exec());
- EXPECT_EQ(count_of_files, query.GetUInteger(0));
+ EXPECT_EQ(kCountOfFiles_, query.GetUInteger(0));
EXPECT_TRUE(query.Prepare(kSelectFiles));
BindId(query);
@@ -528,7 +531,7 @@ void ResumptionDataDBTest::CheckAppFilesData() {
void ResumptionDataDBTest::BindId(utils::dbms::SQLQuery& query) {
query.Bind(0, policy_app_id_);
- query.Bind(1, device_id_);
+ query.Bind(1, kMacAddress_);
}
TEST_F(ResumptionDataDBTest, Init) {
@@ -565,11 +568,12 @@ TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved) {
EXPECT_TRUE(res_db()->Init());
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- EXPECT_TRUE(res_db()->RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ EXPECT_TRUE(
+ res_db()->RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
sm::SmartObject remove_app;
EXPECT_FALSE(
- res_db()->GetSavedApplication(policy_app_id_, device_id_, remove_app));
+ res_db()->GetSavedApplication(policy_app_id_, kMacAddress_, remove_app));
EXPECT_TRUE(remove_app.empty());
}
@@ -608,7 +612,7 @@ TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
res_db()->SaveApplication(app_mock);
- ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, device_id_);
+ ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(0, result);
}
@@ -616,8 +620,9 @@ TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationRemoved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
res_db()->SaveApplication(app_mock);
- EXPECT_TRUE(res_db()->RemoveApplicationFromSaved(policy_app_id_, device_id_));
- ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_TRUE(
+ res_db()->RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
+ ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(-1, result);
}
@@ -629,7 +634,7 @@ TEST_F(ResumptionDataDBTest, GetSavedApplication) {
sm::SmartObject saved_app;
EXPECT_TRUE(
- res_db()->GetSavedApplication(policy_app_id_, device_id_, saved_app));
+ res_db()->GetSavedApplication(policy_app_id_, kMacAddress_, saved_app));
CheckSavedApp(saved_app);
}
@@ -651,9 +656,10 @@ TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData) {
res_db()->GetDataForLoadResumeData(saved_app);
EXPECT_EQ(policy_app_id_, saved_app[0][am::strings::app_id].asString());
- EXPECT_EQ(device_id_, saved_app[0][am::strings::device_id].asString());
- EXPECT_EQ(hmi_level_, static_cast<HMILevel::eType>(
- saved_app[0][am::strings::hmi_level].asInt()));
+ EXPECT_EQ(kMacAddress_, saved_app[0][am::strings::device_id].asString());
+ EXPECT_EQ(hmi_level_,
+ static_cast<HMILevel::eType>(
+ saved_app[0][am::strings::hmi_level].asInt()));
EXPECT_EQ(ign_off_count_, saved_app[0][am::strings::ign_off_count].asUInt());
}
@@ -664,7 +670,8 @@ TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData_AppRemove) {
EXPECT_TRUE(res_db()->Init());
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- EXPECT_TRUE(res_db()->RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ EXPECT_TRUE(
+ res_db()->RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
res_db()->GetDataForLoadResumeData(saved_app);
EXPECT_TRUE(saved_app.empty());
}
@@ -675,7 +682,7 @@ TEST_F(ResumptionDataDBTest, UpdateHmiLevel) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
- res_db()->UpdateHmiLevel(policy_app_id_, device_id_, new_hmi_level);
+ res_db()->UpdateHmiLevel(policy_app_id_, kMacAddress_, new_hmi_level);
hmi_level_ = new_hmi_level;
CheckSavedDB();
}
@@ -703,7 +710,7 @@ TEST_F(ResumptionDataDBTest, GetHMIApplicationID) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_EQ(hmi_app_id_,
- res_db()->GetHMIApplicationID(policy_app_id_, device_id_));
+ res_db()->GetHMIApplicationID(policy_app_id_, kMacAddress_));
}
TEST_F(ResumptionDataDBTest, GetHMIApplicationID_AppNotSaved) {
@@ -746,7 +753,7 @@ TEST_F(ResumptionDataDBTest, OnSuspendFourTimes) {
res_db()->OnSuspend();
- ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, device_id_);
+ ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(-1, result);
}
@@ -804,7 +811,7 @@ TEST_F(ResumptionDataDBTest, GetHashId) {
res_db()->SaveApplication(app_mock);
std::string test_hash;
- EXPECT_TRUE(res_db()->GetHashId(policy_app_id_, device_id_, test_hash));
+ EXPECT_TRUE(res_db()->GetHashId(policy_app_id_, kMacAddress_, test_hash));
EXPECT_EQ(hash_, test_hash);
}
@@ -832,6 +839,39 @@ TEST_F(ResumptionDataDBTest, GetIgnOffTime_AfterSuspendAndAwake) {
EXPECT_LE(after_suspend, after_awake);
}
+TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+
+ res_db()->SaveApplication(app_mock);
+
+ EXPECT_TRUE(res_db()->DropAppDataResumption(kMacAddress_, policy_app_id_));
+
+ am::smart_objects::SmartObject app;
+ EXPECT_TRUE(res_db()->GetSavedApplication(policy_app_id_, kMacAddress_, app));
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_commands) &&
+ app[am::strings::application_commands].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_submenus) &&
+ app[am::strings::application_submenus].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_choice_sets) &&
+ app[am::strings::application_choice_sets].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
+ app[am::strings::application_global_properties].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
+ app[am::strings::application_subscribtions].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
+ app[am::strings::application_files].empty());
+
+ EXPECT_FALSE(app.keyExists(am::strings::grammar_id));
+}
+
} // namespace resumption_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
index 24a16596eb..0f51d29e0e 100644
--- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,14 +35,14 @@
#include "gtest/gtest.h"
#include "application_manager/usage_statistics.h"
-#include "include/application_mock.h"
-#include "include/resumption_data_mock.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_resumption_data.h"
#include "interfaces/MOBILE_API.h"
#include "resumption/last_state.h"
-#include "include/resumption_data_test.h"
-#include "formatters/CFormatterJsonBase.hpp"
-#include "config_profile/profile.h"
+#include "application_manager/resumption_data_test.h"
+#include "formatters/CFormatterJsonBase.h"
+
#include "utils/file_system.h"
#include "application_manager/resumption/resumption_data_json.h"
@@ -64,8 +64,11 @@ namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
class ResumptionDataJsonTest : public ResumptionDataTest {
protected:
+ ResumptionDataJsonTest()
+ : last_state_("app_storage_folder", "app_info_storage")
+ , res_json(last_state_, mock_application_manager_) {}
virtual void SetUp() {
- app_mock = new NiceMock<ApplicationMock>();
+ app_mock = new NiceMock<application_manager_test::MockApplication>();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
@@ -78,7 +81,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
}
void CheckSavedJson() {
- Value& dictionary = LastState::instance()->dictionary;
+ Value& dictionary = last_state_.dictionary;
ASSERT_TRUE(dictionary[am::strings::resumption].isObject());
ASSERT_TRUE(
dictionary[am::strings::resumption][am::strings::resume_app_list]
@@ -94,22 +97,23 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
}
void SetZeroIgnOff() {
- Value& dictionary = LastState::instance()->dictionary;
+ Value& dictionary = last_state_.dictionary;
Value& res = dictionary[am::strings::resumption];
res[am::strings::last_ign_off_time] = 0;
- LastState::instance()->SaveToFileSystem();
+ last_state_.SaveToFileSystem();
}
+
+ resumption::LastState last_state_;
+ ResumptionDataJson res_json;
};
TEST_F(ResumptionDataJsonTest, SaveApplication) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
}
TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -118,7 +122,6 @@ TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
}
TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -129,54 +132,50 @@ TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
}
TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
- EXPECT_TRUE(res_json.RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ EXPECT_TRUE(
+ res_json.RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
// Check that application was deleted
smart_objects::SmartObject remove_app;
EXPECT_FALSE(
- res_json.GetSavedApplication(policy_app_id_, device_id_, remove_app));
+ res_json.GetSavedApplication(policy_app_id_, kMacAddress_, remove_app));
EXPECT_TRUE(remove_app.empty());
}
TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved_AppNotSaved) {
- ResumptionDataJson res_json;
EXPECT_FALSE(res_json.RemoveApplicationFromSaved(policy_app_id_, "54321"));
}
TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationSaved) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
- ssize_t result = res_json.IsApplicationSaved(policy_app_id_, device_id_);
+ ssize_t result = res_json.IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(0, result);
}
TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationRemoved) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
- EXPECT_TRUE(res_json.RemoveApplicationFromSaved(policy_app_id_, device_id_));
- ssize_t result = res_json.IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_TRUE(
+ res_json.RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
+ ssize_t result = res_json.IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(-1, result);
}
TEST_F(ResumptionDataJsonTest, GetSavedApplication) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
smart_objects::SmartObject saved_app;
EXPECT_TRUE(
- res_json.GetSavedApplication(policy_app_id_, device_id_, saved_app));
+ res_json.GetSavedApplication(policy_app_id_, kMacAddress_, saved_app));
CheckSavedApp(saved_app);
}
TEST_F(ResumptionDataJsonTest, GetSavedApplication_AppNotSaved) {
- ResumptionDataJson res_json;
smart_objects::SmartObject saved_app;
EXPECT_FALSE(
res_json.GetSavedApplication(policy_app_id_, "54321", saved_app));
@@ -184,7 +183,6 @@ TEST_F(ResumptionDataJsonTest, GetSavedApplication_AppNotSaved) {
}
TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -192,38 +190,37 @@ TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData) {
res_json.GetDataForLoadResumeData(saved_app);
EXPECT_EQ(policy_app_id_, saved_app[0][am::strings::app_id].asString());
- EXPECT_EQ(device_id_, saved_app[0][am::strings::device_id].asString());
- EXPECT_EQ(hmi_level_, static_cast<HMILevel::eType>(
- saved_app[0][am::strings::hmi_level].asInt()));
+ EXPECT_EQ(kMacAddress_, saved_app[0][am::strings::device_id].asString());
+ EXPECT_EQ(hmi_level_,
+ static_cast<HMILevel::eType>(
+ saved_app[0][am::strings::hmi_level].asInt()));
EXPECT_EQ(ign_off_count_, saved_app[0][am::strings::ign_off_count].asUInt());
}
TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData_AppRemove) {
- ResumptionDataJson res_json;
smart_objects::SmartObject saved_app;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
- EXPECT_TRUE(res_json.RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ EXPECT_TRUE(
+ res_json.RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
res_json.GetDataForLoadResumeData(saved_app);
EXPECT_TRUE(saved_app.empty());
}
TEST_F(ResumptionDataJsonTest, UpdateHmiLevel) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
- res_json.UpdateHmiLevel(policy_app_id_, device_id_, new_hmi_level);
+ res_json.UpdateHmiLevel(policy_app_id_, kMacAddress_, new_hmi_level);
hmi_level_ = new_hmi_level;
CheckSavedJson();
}
TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -231,7 +228,6 @@ TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
}
TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
@@ -241,24 +237,20 @@ TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
}
TEST_F(ResumptionDataJsonTest, GetHMIApplicationID) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_EQ(hmi_app_id_,
- res_json.GetHMIApplicationID(policy_app_id_, device_id_));
+ res_json.GetHMIApplicationID(policy_app_id_, kMacAddress_));
}
TEST_F(ResumptionDataJsonTest, GetHMIApplicationID_AppNotSaved) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
EXPECT_EQ(0u, res_json.GetHMIApplicationID(policy_app_id_, "other_dev_id"));
}
TEST_F(ResumptionDataJsonTest, OnSuspend) {
- ResumptionDataJson res_json;
- ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
SetZeroIgnOff();
PrepareData();
@@ -268,18 +260,10 @@ TEST_F(ResumptionDataJsonTest, OnSuspend) {
res_json.OnSuspend();
ign_off_count_++;
CheckSavedJson();
-
- EXPECT_TRUE(FileExists("./test_app_info.dat"));
- EXPECT_TRUE(DirectoryExists("./test_storage"));
- EXPECT_TRUE(RemoveDirectory("./test_storage", true));
- EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
- ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
}
TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
- ResumptionDataJson res_json;
PrepareData();
- ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
SetZeroIgnOff();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -292,20 +276,11 @@ TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
res_json.OnSuspend();
res_json.OnSuspend();
- ssize_t result = res_json.IsApplicationSaved(policy_app_id_, device_id_);
- EXPECT_EQ(-1, result);
-
- EXPECT_TRUE(FileExists("./test_app_info.dat"));
- EXPECT_TRUE(DirectoryExists("./test_storage"));
- EXPECT_TRUE(RemoveDirectory("./test_storage", true));
- EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
- ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_TRUE(-1 != res_json.IsApplicationSaved(policy_app_id_, kMacAddress_));
}
TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
- ResumptionDataJson res_json;
PrepareData();
- ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
SetZeroIgnOff();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -317,13 +292,9 @@ TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
res_json.OnAwake();
ign_off_count_ = 0;
CheckSavedJson();
- EXPECT_TRUE(RemoveDirectory("./test_storage", true));
- EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
- ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
}
TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
- ResumptionDataJson res_json;
SetZeroIgnOff();
PrepareData();
res_json.SaveApplication(app_mock);
@@ -335,7 +306,6 @@ TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
}
TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
- ResumptionDataJson res_json;
SetZeroIgnOff();
PrepareData();
res_json.SaveApplication(app_mock);
@@ -351,21 +321,18 @@ TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
}
TEST_F(ResumptionDataJsonTest, GetHashId) {
- ResumptionDataJson res_json;
PrepareData();
res_json.SaveApplication(app_mock);
CheckSavedJson();
std::string test_hash;
- EXPECT_TRUE(res_json.GetHashId(policy_app_id_, device_id_, test_hash));
+ EXPECT_TRUE(res_json.GetHashId(policy_app_id_, kMacAddress_, test_hash));
EXPECT_EQ(hash_, test_hash);
}
TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
- ResumptionDataJson res_json;
uint32_t last_ign_off_time;
PrepareData();
- ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
SetZeroIgnOff();
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -383,10 +350,38 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
after_awake = res_json.GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);
+}
+
+TEST_F(ResumptionDataJsonTest, DropAppDataResumption) {
+ PrepareData();
+ SetZeroIgnOff();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ EXPECT_TRUE(res_json.DropAppDataResumption(kMacAddress_, policy_app_id_));
+
+ smart_objects::SmartObject app;
+ EXPECT_TRUE(res_json.GetSavedApplication(policy_app_id_, kMacAddress_, app));
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_commands) &&
+ app[am::strings::application_commands].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_submenus) &&
+ app[am::strings::application_submenus].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_choice_sets) &&
+ app[am::strings::application_choice_sets].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
+ app[am::strings::application_global_properties].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
+ app[am::strings::application_subscribtions].empty());
+
+ EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
+ app[am::strings::application_files].empty());
- EXPECT_TRUE(RemoveDirectory("./test_storage", true));
- EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
- ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_FALSE(app.keyExists(am::strings::grammar_id));
}
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index b8054b0d85..8070244bf2 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -35,26 +35,18 @@
#include "gtest/gtest.h"
#include "application_manager/usage_statistics.h"
-#include "include/application_mock.h"
-#include "include/resumption_data_mock.h"
-
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/resumption_data_mock.h"
+#include "utils/custom_string.h"
#include "application_manager/application.h"
#include "utils/data_accessor.h"
#include "application_manager/message_helper.h"
-#include "include/resumption_data_test.h"
-
-std::string application_manager::MessageHelper::GetDeviceMacAddressForHandle(
- const uint32_t device_handle) {
- std::string device_mac_address = "12345";
- return device_mac_address;
-}
+#include "application_manager/resumption_data_test.h"
namespace test {
namespace components {
namespace resumption_test {
-
+namespace custom_str = utils::custom_string;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ReturnPointee;
@@ -66,8 +58,9 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
EXPECT_EQ(hmi_app_id_, resume_app_list[am::strings::hmi_app_id].asUInt());
EXPECT_EQ(ign_off_count_,
resume_app_list[am::strings::ign_off_count].asUInt());
- EXPECT_EQ(hmi_level_, static_cast<HMILevel::eType>(
- resume_app_list[am::strings::hmi_level].asInt()));
+ EXPECT_EQ(hmi_level_,
+ static_cast<HMILevel::eType>(
+ resume_app_list[am::strings::hmi_level].asInt()));
EXPECT_EQ(is_audio_,
resume_app_list[am::strings::is_media_application].asBool());
EXPECT_EQ("12345", resume_app_list[am::strings::device_id].asString());
@@ -83,7 +76,7 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
}
void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
- for (uint32_t i = 0; i < count_of_commands; ++i) {
+ for (uint32_t i = 0; i < kCountOfCommands_; ++i) {
EXPECT_EQ(i, res_list[i][am::strings::cmd_id].asUInt());
std::string name =
(*test_commands_map[i])[am::strings::menu_params]
@@ -118,7 +111,7 @@ void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
icon_type,
res_list[i][am::strings::cmd_icon][am::strings::image_type].asInt());
- for (uint32_t j = 0; j < count_of_choice; ++j) {
+ for (uint32_t j = 0; j < kCountOfChoice_; ++j) {
std::string vr =
(*test_commands_map[i])[am::strings::vr_commands][j].asString();
EXPECT_EQ(vr, res_list[i][am::strings::vr_commands][j].asString());
@@ -127,7 +120,7 @@ void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckSubmenues(sm::SmartObject& res_list) {
- for (uint32_t i = 0; i < count_of_submenues; ++i) {
+ for (uint32_t i = 0; i < kCountOfSubmenues_; ++i) {
uint32_t test_id =
(*test_submenu_map[i + 10])[am::strings::menu_id].asUInt();
std::string name =
@@ -215,7 +208,7 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) {
void ResumptionDataTest::CheckAppFiles(sm::SmartObject& res_list) {
am::AppFile check_file;
- for (uint i = 0; i < count_of_files; ++i) {
+ for (uint i = 0; i < kCountOfFiles_; ++i) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
check_file = app_files_map_["test_file " + std::string(numb)];
@@ -261,13 +254,15 @@ void ResumptionDataTest::CheckKeyboardProperties(sm::SmartObject& res_list) {
res_list[am::strings::limited_character_list][i].asString());
}
- EXPECT_EQ(testlanguage, static_cast<Language::eType>(
- res_list[am::strings::language].asInt()));
+ EXPECT_EQ(
+ testlanguage,
+ static_cast<Language::eType>(res_list[am::strings::language].asInt()));
EXPECT_EQ(testlayout,
static_cast<KeyboardLayout::eType>(
res_list[am::hmi_request::keyboard_layout].asInt()));
- EXPECT_EQ(testmode, static_cast<KeypressMode::eType>(
- res_list[am::strings::key_press_mode].asInt()));
+ EXPECT_EQ(testmode,
+ static_cast<KeypressMode::eType>(
+ res_list[am::strings::key_press_mode].asInt()));
EXPECT_EQ(auto_complete_text,
res_list[am::strings::auto_complete_text].asString());
}
@@ -283,8 +278,9 @@ void ResumptionDataTest::CheckMenuIcon(sm::SmartObject& res_list) {
(*menu_icon_)[am::strings::image_type].asInt());
EXPECT_EQ(value, res_list[am::strings::value].asString());
- EXPECT_EQ(type, static_cast<ImageType::eType>(
- res_list[am::strings::image_type].asInt()));
+ EXPECT_EQ(
+ type,
+ static_cast<ImageType::eType>(res_list[am::strings::image_type].asInt()));
}
void ResumptionDataTest::CheckHelpPrompt(sm::SmartObject& res_list) {
@@ -302,15 +298,16 @@ void ResumptionDataTest::CheckTimeoutPrompt(
SpeechCapabilities::eType speech = static_cast<SpeechCapabilities::eType>(
(*timeout_prompt_)[i][am::strings::type].asInt());
EXPECT_EQ(text, res_list[i][am::strings::text].asString());
- EXPECT_EQ(speech, static_cast<SpeechCapabilities::eType>(
- res_list[i][am::strings::type].asInt()));
+ EXPECT_EQ(speech,
+ static_cast<SpeechCapabilities::eType>(
+ res_list[i][am::strings::type].asInt()));
}
}
void ResumptionDataTest::CheckVRHelp(sm::SmartObject& res_list) {
std::string text;
int position;
- for (uint i = 0; i < count_of_vrhelptitle; ++i) {
+ for (uint i = 0; i < kCountOfVrhelptitle_; ++i) {
text = (*vr_help_)[i][am::strings::text].asString();
EXPECT_EQ(text, res_list[i][am::strings::text].asString());
position = (*vr_help_)[i][am::strings::position].asInt();
@@ -342,6 +339,7 @@ void ResumptionDataTest::PrepareData() {
ON_CALL(*app_mock, is_application_data_changed()).WillByDefault(Return(true));
ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(policy_app_id_));
+ ON_CALL(*app_mock, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
ON_CALL(*app_mock, curHash()).WillByDefault(ReturnRef(hash_));
ON_CALL(*app_mock, get_grammar_id()).WillByDefault(Return(grammar_id_));
ON_CALL(*app_mock, device()).WillByDefault(Return(device_handle_));
@@ -379,6 +377,7 @@ void ResumptionDataTest::SetGlobalProporties() {
}
void ResumptionDataTest::SetMenuTitleAndIcon() {
+ custom_str::CustomString icon_name("test icon");
sm::SmartObject sm_icon;
sm_icon[am::strings::value] = "test icon";
sm_icon[am::strings::image_type] = ImageType::STATIC;
@@ -415,7 +414,7 @@ void ResumptionDataTest::SetVRHelpTitle() {
vr_help_title = "vr help title";
sm::SmartObject vr_help;
- for (uint i = 0; i < count_of_vrhelptitle; ++i) {
+ for (uint i = 0; i < kCountOfVrhelptitle_; ++i) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
vr_help[i][am::strings::text] = "vr help " + std::string(numb);
@@ -431,7 +430,7 @@ void ResumptionDataTest::SetCommands() {
sm::SmartObject vr_commandsvector;
sm::SmartObject sm_icon;
- for (uint32_t i = 0; i < count_of_commands; ++i) {
+ for (uint32_t i = 0; i < kCountOfCommands_; ++i) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
sm_comm[am::strings::cmd_id] = i;
@@ -440,7 +439,7 @@ void ResumptionDataTest::SetCommands() {
sm_comm[am::strings::menu_params][am::strings::menu_name] =
"Command" + std::string(numb);
- for (uint32_t j = 0; j < count_of_choice; ++j) {
+ for (uint32_t j = 0; j < kCountOfChoice_; ++j) {
char vr[12];
std::snprintf(vr, 12, "%d", i + j);
vr_commandsvector[j] = "VrCommand " + std::string(vr);
@@ -458,7 +457,7 @@ void ResumptionDataTest::SetCommands() {
void ResumptionDataTest::SetSubmenues() {
sm::SmartObject sm_comm;
- for (uint32_t i = 10; i < count_of_submenues + 10; ++i) {
+ for (uint32_t i = 10; i < kCountOfSubmenues_ + 10; ++i) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
sm_comm[am::strings::menu_id] = i;
@@ -476,8 +475,8 @@ void ResumptionDataTest::SetChoiceSet() {
sm::SmartObject sec_icon;
sm::SmartObject app_choice_set;
sm::SmartObject application_choice_sets;
- for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
- for (uint32_t j = 0; j < count_of_choice; ++j) {
+ for (uint32_t i = 0; i < kCountOfChoiceSets_; ++i) {
+ for (uint32_t j = 0; j < kCountOfChoice_; ++j) {
char numb[12];
std::snprintf(numb, 12, "%d", i + j);
@@ -513,7 +512,7 @@ void ResumptionDataTest::SetChoiceSet() {
void ResumptionDataTest::SetAppFiles() {
am::AppFile test_file;
int file_types;
- for (uint i = 0; i < count_of_files; ++i) {
+ for (uint i = 0; i < kCountOfFiles_; ++i) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
file_types = i;
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc
new file mode 100644
index 0000000000..08fa0a3eb5
--- /dev/null
+++ b/src/components/application_manager/test/resumption_sql_queries_test.cc
@@ -0,0 +1,3090 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include <vector>
+#include <string>
+#include <sstream>
+#include <utility>
+#include "gtest/gtest.h"
+
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
+#include "utils/file_system.h"
+#include "application_manager/resumption/resumption_sql_queries.h"
+#include "policy/sql_pt_queries.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+using namespace ::resumption;
+
+using std::string;
+using std::pair;
+using utils::dbms::SQLDatabase;
+using utils::dbms::SQLQuery;
+
+enum AccessoryVRCommand { kVRCommandFromChoice = 0, kVRCommandFromCommand };
+
+const string kDeleteData =
+ "BEGIN; "
+ "DELETE FROM `resumption`; "
+ "DELETE FROM `image`; "
+ "DELETE FROM `applicationChoiceSet`; "
+ "DELETE FROM `file`; "
+ "DELETE FROM `subMenu`; "
+ "DELETE FROM `TTSChunk`; "
+ "DELETE FROM `vrHelpItem`; "
+ "DELETE FROM `tableLimitedCharacterList`; "
+ "DELETE FROM `characterArray`; "
+ "DELETE FROM `choice`; "
+ "DELETE FROM `command`; "
+ "DELETE FROM `globalProperties`; "
+ "DELETE FROM `choiceArray`; "
+ "DELETE FROM `vrCommandsArray`; "
+ "DELETE FROM `helpTimeoutPromptArray`; "
+ "DELETE FROM `vrHelpItemArray`; "
+ "DELETE FROM `application`; "
+ "DELETE FROM `applicationChoiceSetArray`; "
+ "DELETE FROM `applicationCommandsArray`; "
+ "DELETE FROM `applicationFilesArray`; "
+ "DELETE FROM `applicationSubMenuArray`; "
+ "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `_internal_data`; "
+ "COMMIT; "
+ "VACUUM;";
+
+const std::string kJournalOff = "PRAGMA journal_mode = OFF;";
+
+class ResumptionSqlQueriesTest : public ::testing::Test {
+ public:
+ typedef pair<int, string> ValToPosPair;
+
+ protected:
+ std::vector<string> db_schema;
+ static const string kDatabaseName;
+ static SQLDatabase* db_;
+ static const string app_id1;
+ static const string app_id2;
+ static const string device_id;
+ static const string device_id2;
+ static const string test_hash;
+ static const string test_hash2;
+ static const string test_image;
+ static const int connection_key;
+ static const int grammarID;
+ static const int hmiAppID;
+ static const int hmiAppID2;
+ static const int hmiLevel;
+ static const int hmiLevel2;
+ static const int ign_off_count;
+ static const int ign_off_count2;
+ static const int timeStamp;
+ static const int timeStamp2;
+
+ static void SetUpTestCase() {
+ db_ = new SQLDatabase();
+ ASSERT_TRUE(db_->Open());
+ ASSERT_TRUE(db_->IsReadWrite());
+ SQLQuery query(db_);
+ ASSERT_TRUE(query.Exec(kCreateSchema));
+ SQLQuery query_logging_off(db_);
+ ASSERT_TRUE(query_logging_off.Exec(kJournalOff));
+ }
+
+ static void TearDownTestCase() {
+ db_->Close();
+ delete db_;
+ string file_to_delete = kDatabaseName + ".sqlite";
+ file_system::DeleteFile(file_to_delete);
+ }
+ void TearDown() OVERRIDE {
+ DeleteTablesData();
+ }
+
+ void CheckDeleteQuery(const string& count_query,
+ const string& query_to_check,
+ pair<int, string> app_info,
+ pair<int, string> dev_info,
+ const int value_before,
+ const int value_after,
+ const int position_in_result);
+
+ void CheckSelectQuery(const string& query_to_check,
+ const int control_value,
+ const int position_in_result);
+
+ void CheckSelectQuery(const string& query_to_check,
+ const char* control_value,
+ const int position_in_result);
+
+ void CheckSelectQuery(const string& query_to_check,
+ const bool control_value,
+ const int position_in_result);
+
+ void CheckSelectQuery(const string& query_to_check,
+ const string& control_value,
+ const int position_in_result);
+
+ void CheckSelectQuery(const string& query_to_check,
+ pair<int, string> app_info,
+ pair<int, string> dev_info,
+ const int control_value,
+ const int position_in_result);
+
+ void CheckSelectQuery(const string& query_to_check,
+ pair<int, string> app_info,
+ pair<int, string> dev_info,
+ const string& control_value,
+ const int position_in_result);
+
+ string IntToString(const int64_t key) const {
+ std::stringstream ss;
+ ss << key;
+ return ss.str();
+ }
+
+ SQLQuery& FillGlobalPropertiesTable(SQLQuery& query,
+ const string& vrHelpTitle,
+ const string& menuTitle,
+ const int language,
+ const int keyboardLayout,
+ const int keypressMode,
+ const string& autoCompleteText,
+ const int64_t image_key);
+
+ SQLQuery& FillApplicationTable(SQLQuery& query,
+ const int connection_key,
+ const int grammarID,
+ const string& hashID,
+ const int hmiAppID,
+ const int hmiLevel,
+ const int ign_off_count,
+ const int timeStamp,
+ bool isMediaApplication,
+ const string& appID,
+ const string& deviceID,
+ const int64_t glob_prop_key);
+
+ SQLQuery& FillImageTable(SQLQuery& query,
+ const int imageType,
+ const string& value);
+
+ SQLQuery& FillTableLimitedCharacterListTable(
+ SQLQuery& query, const string& limitedCharacterList);
+
+ SQLQuery& FillCharacterArrayTable(SQLQuery& query,
+ const int64_t glob_prop_key,
+ const int64_t lim_char_list_key);
+
+ SQLQuery& FillTTSChunkTable(SQLQuery& query,
+ const int type,
+ const string& text);
+
+ SQLQuery& FillHelpTimeoutPromptArrayTable(SQLQuery& query,
+ const int64_t glob_prop_key,
+ const int64_t tts_chunk_key,
+ const int idhelpPrompt);
+
+ SQLQuery& FillFileTable(SQLQuery& query,
+ const int fileType,
+ bool is_download_complete,
+ bool persistentFile,
+ const string& syncFileName);
+
+ SQLQuery& FillApplicationFilesArrayTable(SQLQuery& query,
+ const int64_t app_key,
+ const int64_t file_key);
+
+ SQLQuery& FillSubMenuTable(SQLQuery& query,
+ const int menuID,
+ const string& menuName,
+ const int position);
+
+ SQLQuery& FillApplicationSubMenuArrayTable(SQLQuery& query,
+ const int app_key,
+ const int sub_menu_key);
+
+ SQLQuery& FillAppSubscriptionsArrayTable(SQLQuery& query,
+ const int vehicleValue,
+ const int ButtonNameValue,
+ const int app_key);
+
+ SQLQuery& FillCommandTable(SQLQuery& query,
+ const int cmdID,
+ const string& menuName,
+ const int parentID,
+ const int position,
+ const int64_t image_key);
+
+ SQLQuery& FillApplicationCommandsArrayTable(SQLQuery& query,
+ const int64_t application_key,
+ const int64_t command_key);
+
+ SQLQuery& FillChoiceTable(SQLQuery& query,
+ const int choiceID,
+ const string& menuName,
+ const string& secondaryText,
+ const string& tertiaryText,
+ const int64_t image_key);
+
+ SQLQuery& FillChoiceArrayTable(SQLQuery& query,
+ const int64_t app_choice_set_key,
+ const int64_t choice_key);
+
+ SQLQuery& FillApplicationChoiceSetTable(SQLQuery& query,
+ const int grammarID,
+ const int interactionChoiceSetID);
+
+ SQLQuery& FillApplicationChoiceSetArrayTable(SQLQuery& query,
+ const int64_t app_choice_set_key,
+ const int64_t app_key);
+
+ SQLQuery& FillVRCommandsArrayTable(SQLQuery& query,
+ const string& vrCommand,
+ AccessoryVRCommand value,
+ const int64_t foreing_key);
+
+ SQLQuery& FillVRHelpItemTable(SQLQuery& query,
+ const string& text,
+ const int position,
+ const int64_t image_key);
+
+ SQLQuery& FillVRHelpItemArrayTable(SQLQuery& query,
+ const int64_t global_prop_key,
+ const int64_t vr_help_item_key);
+
+ void CreateSchema() {
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Exec(kCreateSchema));
+ }
+
+ void DestroySchema() {
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Exec(kDropSchema));
+ }
+
+ void DeleteTablesData() {
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Exec(kDeleteData));
+ }
+
+ SQLDatabase* db() const {
+ return db_;
+ }
+
+ void db_schema_fill() {
+ db_schema.push_back("resumption");
+ db_schema.push_back("image");
+ db_schema.push_back("applicationChoiceSet");
+ db_schema.push_back("file");
+ db_schema.push_back("subMenu");
+ db_schema.push_back("TTSChunk");
+ db_schema.push_back("vrHelpItem");
+ db_schema.push_back("subscribedForWayPoints");
+ db_schema.push_back("tableLimitedCharacterList");
+ db_schema.push_back("characterArray");
+ db_schema.push_back("choice");
+ db_schema.push_back("command");
+ db_schema.push_back("globalProperties");
+ db_schema.push_back("choiceArray");
+ db_schema.push_back("vrCommandsArray");
+ db_schema.push_back("helpTimeoutPromptArray");
+ db_schema.push_back("vrHelpItemArray");
+ db_schema.push_back("application");
+ db_schema.push_back("applicationChoiceSetArray");
+ db_schema.push_back("applicationCommandsArray");
+ db_schema.push_back("applicationFilesArray");
+ db_schema.push_back("applicationSubMenuArray");
+ db_schema.push_back("applicationSubscribtionsArray");
+ db_schema.push_back("_internal_data");
+ std::sort(db_schema.begin(), db_schema.end());
+ }
+};
+
+SQLDatabase* ResumptionSqlQueriesTest::db_ = NULL;
+const string ResumptionSqlQueriesTest::kDatabaseName = "test_database";
+const string ResumptionSqlQueriesTest::app_id1 = "baax";
+const string ResumptionSqlQueriesTest::app_id2 = "caax";
+const string ResumptionSqlQueriesTest::device_id = "ZZZ";
+const string ResumptionSqlQueriesTest::device_id2 = "XXX";
+const string ResumptionSqlQueriesTest::test_hash = "test_hash";
+const string ResumptionSqlQueriesTest::test_hash2 = "test_hash2";
+const string ResumptionSqlQueriesTest::test_image = "test_image";
+const int ResumptionSqlQueriesTest::connection_key = 1;
+const int ResumptionSqlQueriesTest::grammarID = 2;
+const int ResumptionSqlQueriesTest::hmiAppID = 111;
+const int ResumptionSqlQueriesTest::hmiAppID2 = 112;
+const int ResumptionSqlQueriesTest::hmiLevel = 2;
+const int ResumptionSqlQueriesTest::hmiLevel2 = 3;
+const int ResumptionSqlQueriesTest::ign_off_count = 3;
+const int ResumptionSqlQueriesTest::ign_off_count2 = 4;
+const int ResumptionSqlQueriesTest::timeStamp = 2015;
+const int ResumptionSqlQueriesTest::timeStamp2 = 2016;
+
+void ResumptionSqlQueriesTest::CheckDeleteQuery(const string& count_query,
+ const string& query_to_check,
+ pair<int, string> app_info,
+ pair<int, string> dev_info,
+ const int value_before,
+ const int value_after,
+ const int position_in_result) {
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Prepare(count_query));
+ EXPECT_TRUE(query.Exec());
+ EXPECT_EQ(value_before, query.GetInteger(position_in_result));
+ EXPECT_TRUE(query.Reset());
+ // Act
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ if (!app_info.second.empty()) {
+ query_to_check_request.Bind(app_info.first, app_info.second);
+ }
+ if (!dev_info.second.empty()) {
+ query_to_check_request.Bind(dev_info.first, dev_info.second);
+ }
+ EXPECT_TRUE(query_to_check_request.Exec());
+ // Check after action
+ EXPECT_TRUE(query.Exec());
+ EXPECT_EQ(value_after, query.GetInteger(position_in_result));
+}
+
+void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
+ pair<int, string> app_info,
+ pair<int, string> dev_info,
+ const int control_value,
+ const int position_in_result) {
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ if (!app_info.second.empty()) {
+ query_to_check_request.Bind(app_info.first, app_info.second);
+ }
+ if (!dev_info.second.empty()) {
+ query_to_check_request.Bind(dev_info.first, dev_info.second);
+ }
+ EXPECT_TRUE(query_to_check_request.Exec());
+ EXPECT_EQ(control_value,
+ query_to_check_request.GetInteger(position_in_result));
+}
+
+void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
+ const int control_value,
+ const int position_in_result) {
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ EXPECT_TRUE(query_to_check_request.Exec());
+ EXPECT_EQ(control_value,
+ query_to_check_request.GetInteger(position_in_result));
+}
+
+void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
+ const bool control_value,
+ const int position_in_result) {
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ EXPECT_TRUE(query_to_check_request.Exec());
+ EXPECT_EQ(control_value,
+ query_to_check_request.GetBoolean(position_in_result));
+}
+
+void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
+ const string& control_value,
+ const int position_in_result) {
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ EXPECT_TRUE(query_to_check_request.Exec());
+ EXPECT_EQ(control_value,
+ query_to_check_request.GetString(position_in_result));
+}
+
+void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
+ const char* control_value,
+ const int position_in_result) {
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ EXPECT_TRUE(query_to_check_request.Exec());
+ EXPECT_EQ(string(control_value),
+ query_to_check_request.GetString(position_in_result));
+}
+
+void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
+ pair<int, string> app_info,
+ pair<int, string> dev_info,
+ const string& control_value,
+ const int position_in_result) {
+ SQLQuery query_to_check_request(db());
+ EXPECT_TRUE(query_to_check_request.Prepare(query_to_check));
+ if (!app_info.second.empty()) {
+ query_to_check_request.Bind(app_info.first, app_info.second);
+ }
+ if (!dev_info.second.empty()) {
+ query_to_check_request.Bind(dev_info.first, dev_info.second);
+ }
+ EXPECT_TRUE(query_to_check_request.Exec());
+ EXPECT_EQ(control_value,
+ query_to_check_request.GetString(position_in_result));
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillImageTable(SQLQuery& query,
+ const int imageType,
+ const string& value) {
+ EXPECT_TRUE(query.Prepare(kInsertImage));
+ query.Bind(0, imageType);
+ query.Bind(1, value);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillTableLimitedCharacterListTable(
+ SQLQuery& query, const string& limitedCharacterList) {
+ EXPECT_TRUE(query.Prepare(kInsertTableLimitedCharacter));
+ query.Bind(0, limitedCharacterList);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillCharacterArrayTable(
+ SQLQuery& query,
+ const int64_t glob_prop_key,
+ const int64_t lim_char_list_key) {
+ EXPECT_TRUE(query.Prepare(kInsertCharacterArray));
+ query.Bind(0, glob_prop_key);
+ query.Bind(1, lim_char_list_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillTTSChunkTable(SQLQuery& query,
+ const int type,
+ const string& text) {
+ EXPECT_TRUE(query.Prepare(kInsertTTSChunk));
+ query.Bind(0, type);
+ query.Bind(1, text);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillHelpTimeoutPromptArrayTable(
+ SQLQuery& query,
+ int64_t glob_prop_key,
+ int64_t tts_chunk_key,
+ const int idhelpPrompt) {
+ EXPECT_TRUE(query.Prepare(kInsertHelpTimeoutPromptArray));
+ query.Bind(0, glob_prop_key);
+ query.Bind(1, tts_chunk_key);
+ query.Bind(2, idhelpPrompt);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillApplicationTable(
+ SQLQuery& query,
+ const int connection_key,
+ const int grammarID,
+ const string& hashID,
+ const int hmiAppID,
+ const int hmiLevel,
+ const int ign_off_count,
+ const int timeStamp,
+ bool isMediaApplication,
+ const string& appID,
+ const string& deviceID,
+ const int64_t glob_prop_key) {
+ EXPECT_TRUE(query.Prepare(kInsertApplication));
+ query.Bind(0, connection_key);
+ query.Bind(1, grammarID);
+ query.Bind(2, hashID);
+ query.Bind(3, hmiAppID);
+ query.Bind(4, hmiLevel);
+ query.Bind(5, ign_off_count);
+ query.Bind(6, timeStamp);
+ query.Bind(7, glob_prop_key);
+ query.Bind(8, isMediaApplication);
+ query.Bind(9, appID);
+ query.Bind(10, deviceID);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillGlobalPropertiesTable(
+ SQLQuery& query,
+ const string& vrHelpTitle,
+ const string& menuTitle,
+ const int language,
+ const int keyboardLayout,
+ const int keypressMode,
+ const string& autoCompleteText,
+ const int64_t image_key) {
+ EXPECT_TRUE(query.Prepare(kInsertGlobalProperties));
+ query.Bind(0, vrHelpTitle);
+ query.Bind(1, menuTitle);
+ query.Bind(2, image_key);
+ query.Bind(3, language);
+ query.Bind(4, keyboardLayout);
+ query.Bind(5, keypressMode);
+ query.Bind(6, autoCompleteText);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillApplicationCommandsArrayTable(
+ SQLQuery& query, const int64_t application_key, const int64_t command_key) {
+ EXPECT_TRUE(query.Prepare(kInsertApplicationCommandArray));
+ query.Bind(0, application_key);
+ query.Bind(1, command_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillCommandTable(SQLQuery& query,
+ const int cmdID,
+ const string& menuName,
+ const int parentID,
+ const int position,
+ const int64_t image_key) {
+ EXPECT_TRUE(query.Prepare(kInsertToCommand));
+ query.Bind(0, cmdID);
+ query.Bind(1, image_key);
+ query.Bind(2, menuName);
+ query.Bind(3, parentID);
+ query.Bind(4, position);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillChoiceTable(SQLQuery& query,
+ const int choiceID,
+ const string& menuName,
+ const string& secondaryText,
+ const string& tertiaryText,
+ const int64_t image_key) {
+ EXPECT_TRUE(query.Prepare(kInsertChoice));
+ query.Bind(0, choiceID);
+ query.Bind(1, menuName);
+ query.Bind(2, secondaryText);
+ query.Bind(3, tertiaryText);
+ query.Bind(4, image_key);
+ query.Bind(5, image_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillChoiceArrayTable(
+ SQLQuery& query,
+ const int64_t app_choice_set_key,
+ const int64_t choice_key) {
+ EXPECT_TRUE(query.Prepare(kInsertChoiceArray));
+ query.Bind(0, app_choice_set_key);
+ query.Bind(1, choice_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillApplicationChoiceSetTable(
+ SQLQuery& query, const int grammarID, const int interactionChoiceSetID) {
+ EXPECT_TRUE(query.Prepare(kInsertApplicationChoiceSet));
+ query.Bind(0, grammarID);
+ query.Bind(1, interactionChoiceSetID);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillApplicationChoiceSetArrayTable(
+ SQLQuery& query, const int64_t app_choice_set_key, const int64_t app_key) {
+ EXPECT_TRUE(query.Prepare(kInsertApplicationChoiceSetArray));
+ query.Bind(0, app_choice_set_key);
+ query.Bind(1, app_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillVRCommandsArrayTable(
+ SQLQuery& query,
+ const string& vrCommand,
+ AccessoryVRCommand value,
+ const int64_t foreing_key) {
+ EXPECT_TRUE(query.Prepare(kInsertVrCommand));
+ query.Bind(0, vrCommand);
+ if (AccessoryVRCommand::kVRCommandFromCommand == value) {
+ query.Bind(1, foreing_key);
+ query.Bind(2);
+ } else if (AccessoryVRCommand::kVRCommandFromChoice == value) {
+ query.Bind(1);
+ query.Bind(2, foreing_key);
+ }
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillVRHelpItemTable(
+ SQLQuery& query,
+ const string& text,
+ const int position,
+ const int64_t image_key) {
+ EXPECT_TRUE(query.Prepare(kInsertVRHelpItem));
+ query.Bind(0, text);
+ query.Bind(1, position);
+ query.Bind(2, image_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillVRHelpItemArrayTable(
+ SQLQuery& query,
+ const int64_t global_prop_key,
+ const int64_t vr_help_item_key) {
+ EXPECT_TRUE(query.Prepare(kInsertVRHelpItemArray));
+ query.Bind(0, global_prop_key);
+ query.Bind(1, vr_help_item_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillApplicationSubMenuArrayTable(
+ SQLQuery& query, const int app_key, const int sub_menu_key) {
+ EXPECT_TRUE(query.Prepare(kInsertToApplicationSubMenuArray));
+ query.Bind(0, app_key);
+ query.Bind(1, sub_menu_key);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillAppSubscriptionsArrayTable(
+ SQLQuery& query,
+ const int vehicleValue,
+ const int ButtonNameValue,
+ const int app_key) {
+ EXPECT_TRUE(query.Prepare(kInsertSubscriptions));
+ query.Bind(0, app_key);
+ query.Bind(1, vehicleValue);
+ query.Bind(2, ButtonNameValue);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillFileTable(SQLQuery& query,
+ const int fileType,
+ bool is_download_complete,
+ bool persistentFile,
+ const string& syncFileName) {
+ EXPECT_TRUE(query.Prepare(kInsertToFile));
+ query.Bind(0, fileType);
+ query.Bind(1, is_download_complete);
+ query.Bind(2, persistentFile);
+ query.Bind(3, syncFileName);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillSubMenuTable(SQLQuery& query,
+ const int menuID,
+ const string& menuName,
+ const int position) {
+ EXPECT_TRUE(query.Prepare(kInsertToSubMenu));
+ query.Bind(0, menuID);
+ query.Bind(1, menuName);
+ query.Bind(2, position);
+ EXPECT_TRUE(query.Exec());
+ return query;
+}
+
+SQLQuery& ResumptionSqlQueriesTest::FillApplicationFilesArrayTable(
+ SQLQuery& query, const int64_t app_key, const int64_t file_key) {
+ SQLQuery query_insert_application_files_array(db());
+ EXPECT_TRUE(query_insert_application_files_array.Prepare(
+ kInsertToApplicationFilesArray));
+ query_insert_application_files_array.Bind(0, app_key);
+ query_insert_application_files_array.Bind(1, file_key);
+ EXPECT_TRUE(query_insert_application_files_array.Exec());
+ return query;
+}
+
+TEST_F(ResumptionSqlQueriesTest, kCreateSchemaTest_ExpectSchemaCreated) {
+ // Arrange
+ SQLQuery query(db());
+ DestroySchema();
+ const std::string kCheckTablesNumber =
+ "SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table'";
+ // Check schema is not yet created
+ CheckSelectQuery(kCheckTablesNumber, 0, 0);
+ // Act
+ CreateSchema();
+ // Check schema created successfully
+ EXPECT_TRUE(query.Prepare(kCheckTablesNumber) && query.Exec());
+ EXPECT_GT(query.GetInteger(0), 0);
+ ASSERT_TRUE(query.Reset());
+ const std::string query_select_all_tbl_names =
+ "SELECT `tbl_name` FROM sqlite_master WHERE `type` = 'table'";
+ EXPECT_TRUE(query.Prepare(query_select_all_tbl_names));
+ std::vector<std::string> result;
+ db_schema_fill();
+ while (query.Next()) {
+ result.push_back(query.GetString(0));
+ }
+ std::sort(result.begin(), result.end());
+ EXPECT_TRUE(db_schema == result);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDropSchemaTest_ExpectSchemaDestroyed) {
+ // Arrange
+ const std::string kCheckTablesNumber =
+ "SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table'";
+ // Act
+ DestroySchema();
+ // Check schema is already destroyed
+ CheckSelectQuery(kCheckTablesNumber, 0, 0);
+ // Restore Created database schema as used as shared source
+ CreateSchema();
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertInitData_ExpectInitDataInserted) {
+ // Arrange
+ SQLQuery query_insert_resumption(db());
+ const std::string kCheckInitData = "SELECT COUNT(*) FROM `resumption`";
+ CheckSelectQuery(kCheckInitData, 0, 0);
+ const std::string kCheckInitData2 = "SELECT COUNT(*) FROM `_internal_data`";
+ CheckSelectQuery(kCheckInitData2, 0, 0);
+ // Act
+ EXPECT_TRUE(query_insert_resumption.Exec(kInsertInitData));
+
+ // Checks
+ CheckSelectQuery(kCheckInitData, 1, 0);
+ CheckSelectQuery(kCheckInitData2, 1, 0);
+
+ const std::string kCheckResumptionInitValue =
+ "SELECT last_ign_off_time FROM `resumption`";
+ CheckSelectQuery(kCheckResumptionInitValue, 0, 0);
+ const std::string kCheckInternalDataInitValue =
+ "SELECT db_version_hash FROM `_internal_data`";
+ CheckSelectQuery(kCheckInternalDataInitValue, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kChecksResumptionData_ExpectDataCorrect) {
+ // Arrange
+ CheckSelectQuery(kChecksResumptionData, 0, 0);
+ // Act
+ SQLQuery query_insert_resumption(db());
+ EXPECT_TRUE(query_insert_resumption.Exec(kInsertInitData));
+ // Check
+ CheckSelectQuery(kChecksResumptionData, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kSelectCountHMILevel, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kSelectHMILevel, p1, p2, hmiLevel, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ ValToPosPair p1(0, IntToString(hmiAppID));
+ ValToPosPair p2(1, "");
+ // Check
+ CheckSelectQuery(kCheckHMIId, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kSelectHMIId, p1, p2, hmiAppID, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kSelectCountHMIId, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kCountHashId, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kSelectHashId, p1, p2, test_hash, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectIgnOffTime_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery query_insert_init_data(db());
+ // Act
+ EXPECT_TRUE(query_insert_init_data.Exec(kInsertInitData));
+ // Check
+ CheckSelectQuery(kSelectIgnOffTime, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kCheckApplication, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ key = FillImageTable(temp_query, 1, "tst_img2").LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash2,
+ hmiAppID2,
+ hmiLevel2,
+ ign_off_count,
+ timeStamp2,
+ false,
+ app_id2,
+ device_id,
+ key);
+ // Check
+ CheckSelectQuery(kCountApplications, 2, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kSelectDataForLoadResumeData_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ // Checks
+ CheckSelectQuery(kSelectDataForLoadResumeData, hmiLevel, 0);
+ CheckSelectQuery(kSelectDataForLoadResumeData, ign_off_count, 1);
+ CheckSelectQuery(kSelectDataForLoadResumeData, timeStamp, 2);
+ CheckSelectQuery(kSelectDataForLoadResumeData, app_id1, 3);
+ CheckSelectQuery(kSelectDataForLoadResumeData, device_id, 4);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+ // Act
+ SQLQuery query_update_hmi_level(db());
+ EXPECT_TRUE(query_update_hmi_level.Prepare(kUpdateHMILevel));
+ query_update_hmi_level.Bind(0, hmiLevel2);
+ query_update_hmi_level.Bind(1, device_id);
+ query_update_hmi_level.Bind(2, app_id1);
+ EXPECT_TRUE(query_update_hmi_level.Exec());
+ ValToPosPair p1(0, device_id);
+ ValToPosPair p2(1, app_id1);
+ // Check
+ CheckSelectQuery(kSelectHMILevel, p1, p2, hmiLevel2, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ const std::string kSelectIgnOffCount =
+ "SELECT ign_off_count FROM application;";
+ // Check before action
+ CheckSelectQuery(kSelectIgnOffCount, ign_off_count, 0);
+ SQLQuery query(db());
+ // Act
+ EXPECT_TRUE(query.Exec(kUpdateIgnOffCount));
+ // Check after action
+ CheckSelectQuery(kSelectIgnOffCount, ign_off_count - 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash2,
+ hmiAppID2,
+ hmiLevel2,
+ ign_off_count2,
+ timeStamp2,
+ false,
+ app_id2,
+ device_id,
+ key);
+
+ ValToPosPair p1(0, IntToString(4));
+ ValToPosPair p2(1, "");
+ // Check
+ CheckSelectQuery(kCountApplicationsIgnOff, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kSelectApplicationsIgnOffCount_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash2,
+ hmiAppID2,
+ hmiLevel2,
+ ign_off_count2,
+ timeStamp2,
+ false,
+ app_id2,
+ device_id,
+ key);
+
+ ValToPosPair p1(0, IntToString(4));
+ ValToPosPair p2(1, "");
+
+ CheckSelectQuery(kSelectApplicationsIgnOffCount, p1, p2, device_id, 0);
+ CheckSelectQuery(kSelectApplicationsIgnOffCount, p1, p2, app_id2, 1);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ 1,
+ 1,
+ test_hash,
+ 111,
+ 1,
+ 3,
+ 45127,
+ false,
+ app_id1,
+ device_id,
+ key);
+
+ // Act
+ SQLQuery query_update_suspend_data(db());
+ EXPECT_TRUE(query_update_suspend_data.Exec(kUpdateSuspendData));
+ // Check
+ const std::string kSelectIgnOffCount =
+ "SELECT ign_off_count FROM `application`;";
+ CheckSelectQuery(kSelectIgnOffCount, 4, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+ int64_t key2 =
+ FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
+ FillApplicationFilesArrayTable(temp_query, key1, key2);
+ // Check before action
+ const std::string select_count_file = "SELECT COUNT(*) from `file` ";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_file, kDeleteFile, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteApplicationFilesArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+ int64_t key2 =
+ FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
+ FillApplicationFilesArrayTable(temp_query, key1, key2);
+ // Check
+ const std::string select_count_applicationsFilesArray =
+ "SELECT COUNT(*) from `applicationFilesArray` ";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_applicationsFilesArray,
+ kDeleteApplicationFilesArray,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key).LastInsertId();
+ int64_t submenu_key =
+ FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId();
+
+ FillApplicationSubMenuArrayTable(temp_query, key, submenu_key);
+ // Check
+ const std::string select_count_subMenu = "SELECT COUNT(*) FROM subMenu;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_subMenu, kDeleteSubMenu, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteApplicationSubMenuArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
+ .LastInsertId();
+ key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key).LastInsertId();
+
+ int64_t submenu_key =
+ FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId();
+
+ FillApplicationSubMenuArrayTable(temp_query, key, submenu_key);
+ // Check
+ const std::string select_count_subMenu =
+ "SELECT COUNT(*) FROM applicationSubMenuArray;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_subMenu, kDeleteApplicationSubMenuArray, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteApplicationSubscribtionsArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+ int64_t key2 =
+ FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
+ key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId();
+ FillAppSubscriptionsArrayTable(temp_query, 7, 2, key1);
+ // Check
+ const std::string select_count_applicationSubscribtionsArray =
+ "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_applicationSubscribtionsArray,
+ kDeleteApplicationSubscribtionsArray,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
+ .LastInsertId();
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+ FillApplicationCommandsArrayTable(temp_query, key1, key2);
+ // Check before action
+ const std::string select_count_image = "SELECT COUNT(*) FROM image;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_image, kDeleteImageFromCommands, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
+ .LastInsertId();
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+
+ FillVRCommandsArrayTable(
+ temp_query, "tst_vr_command", kVRCommandFromCommand, key2);
+ FillApplicationCommandsArrayTable(temp_query, key1, key2);
+ // Check
+ const std::string select_count_vrCommandsArray =
+ "SELECT COUNT(*) FROM vrCommandsArray;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_vrCommandsArray, kDeleteVrCommands, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
+ .LastInsertId();
+
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+
+ FillApplicationCommandsArrayTable(temp_query, key1, key2);
+ // Check
+ const std::string select_count_command = "SELECT COUNT(*) FROM command;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_command, kDeleteCommands, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteApplicationCommandsArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
+ .LastInsertId();
+
+ key1 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+
+ FillApplicationCommandsArrayTable(temp_query, key1, key2);
+ // Check
+ const std::string select_count_applicationCommandsArray =
+ "SELECT COUNT(*) FROM applicationCommandsArray;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_applicationCommandsArray,
+ kDeleteApplicationCommandsArray,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillChoiceTable(temp_query,
+ 2,
+ "tst_menu_name",
+ "secondary_txt",
+ "tst_tert_text",
+ key1).LastInsertId();
+ int64_t key3 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+ int64_t key4 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
+ FillChoiceArrayTable(temp_query, key4, key2);
+ FillApplicationChoiceSetArrayTable(temp_query, key4, key3);
+
+ // Check
+ const std::string select_count_image = "SELECT COUNT(*) FROM image;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_image, kDeleteImageFromChoiceSet, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteVrCommandsFromChoiceSet_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 =
+ FillChoiceTable(
+ temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+
+ FillVRCommandsArrayTable(
+ temp_query, "tst_vr_command", kVRCommandFromChoice, key2);
+
+ int64_t key3 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
+
+ FillChoiceArrayTable(temp_query, key3, key2);
+ FillApplicationChoiceSetArrayTable(temp_query, key3, key1);
+ // Check before action
+ const std::string select_count_vrCommandsArray =
+ "SELECT COUNT(*) FROM vrCommandsArray;";
+ // Check
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_vrCommandsArray,
+ kDeleteVrCommandsFromChoiceSet,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 =
+ FillChoiceTable(
+ temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
+ .LastInsertId();
+ key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key1).LastInsertId();
+ int64_t key3 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
+ FillChoiceArrayTable(temp_query, key3, key2);
+ FillApplicationChoiceSetArrayTable(temp_query, key3, key1);
+
+ // Check before action
+ const std::string select_count_choice = "SELECT COUNT(*) FROM choice;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_choice, kDeleteChoice, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteChoiceArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t choice_table_key =
+ FillChoiceTable(
+ temp_query, 1, "tst_menu_name", "second_text", "tert_txt", 0)
+ .LastInsertId();
+
+ int64_t application_choiceset_table_key =
+ FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
+ int64_t application_table_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ 1).LastInsertId();
+ FillApplicationChoiceSetArrayTable(
+ temp_query, application_choiceset_table_key, application_table_key);
+ FillChoiceArrayTable(
+ temp_query, application_choiceset_table_key, choice_table_key);
+ // Check
+ const std::string select_count_choice_array =
+ "SELECT COUNT(*) FROM choiceArray;";
+
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_choice_array, kDeleteChoiceArray, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteApplicationChoiceSet_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ 1).LastInsertId();
+
+ int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
+ FillApplicationChoiceSetArrayTable(temp_query, key2, key1);
+
+ // Check before action
+ const std::string select_count_applicationChoiceSet =
+ "SELECT COUNT(*) FROM applicationChoiceSet;";
+
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_applicationChoiceSet,
+ kDeleteApplicationChoiceSet,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteApplicationChoiceSetArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ 1).LastInsertId();
+
+ int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
+ FillApplicationChoiceSetArrayTable(temp_query, key2, key1);
+
+ // Check
+ const std::string select_count_applicationChoiceSetArray =
+ "SELECT COUNT(*) FROM applicationChoiceSetArray;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_applicationChoiceSetArray,
+ kDeleteApplicationChoiceSetArray,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteImageFromGlobalProperties_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillVRHelpItemTable(temp_query, "tst_text", 1, key1).LastInsertId();
+ FillVRHelpItemArrayTable(temp_query, key2, key1);
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key2);
+ // Check
+ const std::string select_count_image = "SELECT COUNT(*) FROM image;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_image, kDeleteImageFromGlobalProperties, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillVRHelpItemTable(temp_query, "tst_text", 1, key1).LastInsertId();
+ FillVRHelpItemArrayTable(temp_query, key2, key1);
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key2);
+ // Check
+ const std::string select_count_vrhelp_item =
+ "SELECT COUNT(*) FROM vrHelpItem;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_vrhelp_item, kDeletevrHelpItem, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key2 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
+ .LastInsertId();
+ key1 = FillVRHelpItemTable(temp_query, "tst_text", 1, key1).LastInsertId();
+ FillVRHelpItemArrayTable(temp_query, key2, key1);
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id,
+ key2);
+ // Check
+ const std::string select_count_vrhelp_item_array =
+ "SELECT COUNT(*) FROM vrHelpItemArray;";
+ ValToPosPair p1(0, app_id2);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_vrhelp_item_array, kDeletevrHelpItemArray, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteTableLimitedCharacterList_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ string character_list = "abcdefghij";
+ int64_t key1 = FillTableLimitedCharacterListTable(temp_query, character_list)
+ .LastInsertId();
+ int64_t key2 =
+ FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key2);
+ FillCharacterArrayTable(temp_query, key2, key1);
+ // Check
+ const std::string select_count_tableLimitedCharacterList =
+ "SELECT COUNT(*) FROM tableLimitedCharacterList;";
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_tableLimitedCharacterList,
+ kDeleteTableLimitedCharacterList,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteCharacterArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ string character_list = "abcdefghij";
+ int64_t key1 = FillTableLimitedCharacterListTable(temp_query, character_list)
+ .LastInsertId();
+ int64_t key2 =
+ FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ key2);
+ FillCharacterArrayTable(temp_query, key2, key1);
+ // Check
+ const std::string select_count_characterArray =
+ "SELECT COUNT(*) FROM characterArray;";
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_characterArray, kDeleteCharacterArray, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteTTSChunk_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t tts_chunk_key =
+ FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId();
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ glob_prop_key);
+
+ FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, tts_chunk_key, 1);
+ // Check
+ const std::string select_count_tts_chunk = "SELECT COUNT(*) FROM TTSChunk;";
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_tts_chunk, kDeleteTTSChunk, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteFromApplicationTable_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 1);
+ // Check
+ const std::string select_count_application =
+ "SELECT COUNT(*) FROM application;";
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_application, kDeleteFromApplicationTable, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kDeleteHelpTimeoutPromptArray_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t tts_chunk_key =
+ FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId();
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ glob_prop_key);
+
+ FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, tts_chunk_key, 1);
+ // Check
+ const std::string select_count_helpTimeoutPromptArray =
+ "SELECT COUNT(*) FROM helpTimeoutPromptArray;";
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(select_count_helpTimeoutPromptArray,
+ kDeleteHelpTimeoutPromptArray,
+ p1,
+ p2,
+ 1,
+ 0,
+ 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ glob_prop_key);
+ // Check
+ const std::string select_count_globalProperties =
+ "SELECT COUNT(*) FROM globalProperties;";
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckDeleteQuery(
+ select_count_globalProperties, kDeleteGlobalProperties, p1, p2, 1, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillImageTable(temp_query, 2, "tst_image");
+ ValToPosPair p1(0, "tst_image");
+ ValToPosPair p2(1, "");
+ // Check
+ CheckSelectQuery(kSelectCountImage, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ ValToPosPair p1(0, "tst_image");
+ ValToPosPair p2(1, "");
+ // Check
+ CheckSelectQuery(kSelectPrimaryKeyImage, p1, p2, image_key, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertImage_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillImageTable(temp_query, 2, "tst_image");
+ const std::string select_count_image = "SELECT COUNT(*) FROM image;";
+ // Check
+ CheckSelectQuery(select_count_image, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertToFile_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillFileTable(temp_query, 1, true, true, "tst_file_name");
+ // Check
+ const std::string select_count_file = "SELECT COUNT(*) FROM file;";
+ CheckSelectQuery(select_count_file, 1, 0);
+ const std::string select_file_name = "SELECT syncFileName FROM file;";
+ CheckSelectQuery(select_file_name, "tst_file_name", 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertToApplicationFilesArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationFilesArrayTable(temp_query, 1, 2);
+ // Checks
+ const std::string select_count_applicationFilesArray =
+ "SELECT COUNT(*) FROM applicationFilesArray;";
+ CheckSelectQuery(select_count_applicationFilesArray, 1, 0);
+ const std::string select_idApplication =
+ "SELECT idApplication FROM applicationFilesArray;";
+ CheckSelectQuery(select_idApplication, 1, 0);
+ const std::string select_idfile = "SELECT idfile FROM applicationFilesArray;";
+ CheckSelectQuery(select_idfile, 2, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertToSubMenu_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillSubMenuTable(temp_query, 1, "tst_menu", 3);
+ // Checks
+ const std::string select_count_subMenu = "SELECT COUNT(*) FROM subMenu;";
+ CheckSelectQuery(select_count_subMenu, 1, 0);
+ const std::string select_menuID = "SELECT menuID FROM subMenu;";
+ CheckSelectQuery(select_menuID, 1, 0);
+ const std::string select_menuName = "SELECT menuName FROM subMenu;";
+ CheckSelectQuery(select_menuName, "tst_menu", 0);
+ const std::string select_position = "SELECT position FROM subMenu;";
+ CheckSelectQuery(select_position, 3, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertToApplicationSubMenuArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationSubMenuArrayTable(temp_query, 2, 5);
+ // Checks
+ const std::string select_count_applicationFilesArray =
+ "SELECT COUNT(*) FROM applicationSubMenuArray;";
+ CheckSelectQuery(select_count_applicationFilesArray, 1, 0);
+ const std::string select_idApplication =
+ "SELECT idApplication FROM applicationSubMenuArray;";
+ CheckSelectQuery(select_idApplication, 2, 0);
+ const std::string select_idsubMenu =
+ "SELECT idsubMenu FROM applicationSubMenuArray;";
+ CheckSelectQuery(select_idsubMenu, 5, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertToCommand_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillCommandTable(temp_query, 1, "tst_menu", 1, 2, 5);
+ // Checks
+ const std::string select_count_command = "SELECT COUNT(*) FROM command;";
+ CheckSelectQuery(select_count_command, 1, 0);
+ const std::string select_cmdID = "SELECT cmdID FROM command;";
+ CheckSelectQuery(select_cmdID, 1, 0);
+ const std::string select_menuName = "SELECT menuName FROM command;";
+ CheckSelectQuery(select_menuName, "tst_menu", 0);
+ const std::string select_parentID = "SELECT parentID FROM command;";
+ CheckSelectQuery(select_parentID, 1, 0);
+ const std::string select_position = "SELECT position FROM command;";
+ CheckSelectQuery(select_position, 2, 0);
+ const std::string select_idimage = "SELECT idimage FROM command;";
+ CheckSelectQuery(select_idimage, 5, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertApplicationCommandArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationCommandsArrayTable(temp_query, 3, 7);
+ // Checks
+ const std::string select_count_applicationCommandsArray =
+ "SELECT COUNT(*) FROM applicationCommandsArray;";
+ CheckSelectQuery(select_count_applicationCommandsArray, 1, 0);
+ const std::string select_idApplication =
+ "SELECT idApplication FROM applicationCommandsArray;";
+ CheckSelectQuery(select_idApplication, 3, 0);
+ const std::string select_idcommand =
+ "SELECT idcommand FROM applicationCommandsArray;";
+ CheckSelectQuery(select_idcommand, 7, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertVrCommandFromChoice_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillVRCommandsArrayTable(temp_query, "vr_cmd", kVRCommandFromChoice, 8);
+ // Checks
+ const std::string select_count_vrCommandsArray =
+ "SELECT COUNT(*) FROM vrCommandsArray;";
+ CheckSelectQuery(select_count_vrCommandsArray, 1, 0);
+ const std::string select_vrCommand = "SELECT vrCommand FROM vrCommandsArray;";
+ CheckSelectQuery(select_vrCommand, "vr_cmd", 0);
+ const std::string select_idcommand = "SELECT idcommand FROM vrCommandsArray;";
+ CheckSelectQuery(select_idcommand, 0, 0);
+ const std::string select_idchoice = "SELECT idchoice FROM vrCommandsArray;";
+ CheckSelectQuery(select_idchoice, 8, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertVrCommandFromCommand_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillVRCommandsArrayTable(temp_query, "vr_cmd", kVRCommandFromCommand, 9);
+ // Checks
+ const std::string select_count_vrCommandsArray =
+ "SELECT COUNT(*) FROM vrCommandsArray;";
+ CheckSelectQuery(select_count_vrCommandsArray, 1, 0);
+ const std::string select_vrCommand = "SELECT vrCommand FROM vrCommandsArray;";
+ CheckSelectQuery(select_vrCommand, "vr_cmd", 0);
+ const std::string select_idcommand = "SELECT idcommand FROM vrCommandsArray;";
+ CheckSelectQuery(select_idcommand, 9, 0);
+ const std::string select_idchoice = "SELECT idchoice FROM vrCommandsArray;";
+ CheckSelectQuery(select_idchoice, 0, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertSubscriptions_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillAppSubscriptionsArrayTable(temp_query, 2, 3, 4);
+ // Checks
+ const std::string select_count_applicationSubscribtionsArray =
+ "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
+ CheckSelectQuery(select_count_applicationSubscribtionsArray, 1, 0);
+ const std::string select_idApplication =
+ "SELECT idApplication FROM applicationSubscribtionsArray;";
+ CheckSelectQuery(select_idApplication, 4, 0);
+ const std::string select_vehicleValue =
+ "SELECT vehicleValue FROM applicationSubscribtionsArray;";
+ CheckSelectQuery(select_vehicleValue, 2, 0);
+ const std::string select_ButtonNameValue =
+ "SELECT ButtonNameValue FROM applicationSubscribtionsArray;";
+ CheckSelectQuery(select_ButtonNameValue, 3, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertChoice_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillChoiceTable(temp_query, 1, "tst_menu", "second_text", "tert_txt", 5);
+ // Checks
+ const std::string select_count_choice = "SELECT COUNT(*) FROM choice;";
+ CheckSelectQuery(select_count_choice, 1, 0);
+
+ const std::string select_choiceID = "SELECT choiceID FROM choice;";
+ CheckSelectQuery(select_choiceID, 1, 0);
+ const std::string select_menuName = "SELECT menuName FROM choice;";
+ CheckSelectQuery(select_menuName, "tst_menu", 0);
+ const std::string select_secondaryText = "SELECT secondaryText FROM choice;";
+ CheckSelectQuery(select_secondaryText, "second_text", 0);
+ const std::string select_tertiaryText = "SELECT tertiaryText FROM choice;";
+ CheckSelectQuery(select_tertiaryText, "tert_txt", 0);
+ const std::string select_idimage = "SELECT idimage FROM choice;";
+ CheckSelectQuery(select_idimage, 5, 0);
+ const std::string select_idsecondaryImage =
+ "SELECT idsecondaryImage FROM choice;";
+ CheckSelectQuery(select_idsecondaryImage, 5, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertApplicationChoiceSet_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationChoiceSetTable(temp_query, 7, 12);
+ // Checks
+ const std::string select_count_applicationChoiceSet =
+ "SELECT COUNT(*) FROM applicationChoiceSet;";
+ CheckSelectQuery(select_count_applicationChoiceSet, 1, 0);
+
+ const std::string select_grammarID =
+ "SELECT grammarID FROM applicationChoiceSet;";
+ CheckSelectQuery(select_grammarID, 7, 0);
+ const std::string select_interactionChoiceSetID =
+ "SELECT interactionChoiceSetID FROM applicationChoiceSet;";
+ CheckSelectQuery(select_interactionChoiceSetID, 12, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertChoiceArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillChoiceArrayTable(temp_query, 3, 5);
+ // Checks
+ const std::string select_count_choiceArray =
+ "SELECT COUNT(*) FROM choiceArray;";
+ CheckSelectQuery(select_count_choiceArray, 1, 0);
+ const std::string select_idapplicationChoiceSet =
+ "SELECT idapplicationChoiceSet FROM choiceArray;";
+ CheckSelectQuery(select_idapplicationChoiceSet, 3, 0);
+ const std::string select_idchoice = "SELECT idchoice FROM choiceArray;";
+ CheckSelectQuery(select_idchoice, 5, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertApplicationChoiceSetArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationChoiceSetArrayTable(temp_query, 3, 5);
+ // Checks
+ const std::string select_count_applicationChoiceSetArray =
+ "SELECT COUNT(*) FROM applicationChoiceSetArray;";
+ CheckSelectQuery(select_count_applicationChoiceSetArray, 1, 0);
+ const std::string select_idapplicationChoiceSet =
+ "SELECT idapplicationChoiceSet FROM applicationChoiceSetArray;";
+ CheckSelectQuery(select_idapplicationChoiceSet, 3, 0);
+ const std::string select_idApplication =
+ "SELECT idApplication FROM applicationChoiceSetArray;";
+ CheckSelectQuery(select_idApplication, 5, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertGlobalProperties_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillGlobalPropertiesTable(
+ temp_query, "vr_title", "menu_title", 2, 1, 3, "auto", 7);
+ // Checks
+ const std::string select_count_globalProperties =
+ "SELECT COUNT(*) FROM globalProperties;";
+ CheckSelectQuery(select_count_globalProperties, 1, 0);
+ const std::string select_vrHelpTitle =
+ "SELECT vrHelpTitle FROM globalProperties;";
+ CheckSelectQuery(select_vrHelpTitle, "vr_title", 0);
+ const std::string select_menuTitle =
+ "SELECT menuTitle FROM globalProperties;";
+ CheckSelectQuery(select_menuTitle, "menu_title", 0);
+ const std::string select_idmenuIcon =
+ "SELECT idmenuIcon FROM globalProperties;";
+ CheckSelectQuery(select_idmenuIcon, 7, 0);
+ const std::string select_language = "SELECT language FROM globalProperties;";
+ CheckSelectQuery(select_language, 2, 0);
+ const std::string select_keyboardLayout =
+ "SELECT keyboardLayout FROM globalProperties;";
+ CheckSelectQuery(select_keyboardLayout, 1, 0);
+ const std::string select_keypressMode =
+ "SELECT keypressMode FROM globalProperties;";
+ CheckSelectQuery(select_keypressMode, 3, 0);
+ const std::string select_autoCompleteText =
+ "SELECT autoCompleteText FROM globalProperties;";
+ CheckSelectQuery(select_autoCompleteText, "auto", 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertTableLimitedCharacter_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ string character_list = "abcdefghijkl";
+ FillTableLimitedCharacterListTable(temp_query, character_list);
+ // Checks
+ const std::string select_count_tableLimitedCharacterList =
+ "SELECT COUNT(*) FROM tableLimitedCharacterList;";
+ CheckSelectQuery(select_count_tableLimitedCharacterList, 1, 0);
+ const std::string select_limitedCharacterList =
+ "SELECT limitedCharacterList FROM tableLimitedCharacterList;";
+ CheckSelectQuery(select_limitedCharacterList, character_list, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertCharacterArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillCharacterArrayTable(temp_query, 2, 4);
+ // Checks
+ const std::string select_count_characterArray =
+ "SELECT COUNT(*) FROM characterArray;";
+ CheckSelectQuery(select_count_characterArray, 1, 0);
+ const std::string select_idglobalProperties =
+ "SELECT idglobalProperties FROM characterArray;";
+ CheckSelectQuery(select_idglobalProperties, 2, 0);
+ const std::string select_idtableLimitedCharacterList =
+ "SELECT idtableLimitedCharacterList FROM characterArray;";
+ CheckSelectQuery(select_idtableLimitedCharacterList, 4, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertVRHelpItem_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillVRHelpItemTable(temp_query, "tst_txt", 1, 3);
+ // Checks
+ const std::string select_count_vrHelpItem =
+ "SELECT COUNT(*) FROM vrHelpItem;";
+ CheckSelectQuery(select_count_vrHelpItem, 1, 0);
+ const std::string select_text = "SELECT text FROM vrHelpItem;";
+ CheckSelectQuery(select_text, "tst_txt", 0);
+ const std::string select_position = "SELECT position FROM vrHelpItem;";
+ CheckSelectQuery(select_position, 1, 0);
+ const std::string select_idimage = "SELECT idimage FROM vrHelpItem;";
+ CheckSelectQuery(select_idimage, 3, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertVRHelpItemArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillVRHelpItemArrayTable(temp_query, 4, 5);
+ // Checks
+ const std::string select_count_vrHelpItemArray =
+ "SELECT COUNT(*) FROM vrHelpItemArray;";
+ CheckSelectQuery(select_count_vrHelpItemArray, 1, 0);
+ const std::string select_idglobalProperties =
+ "SELECT idglobalProperties FROM vrHelpItemArray;";
+ CheckSelectQuery(select_idglobalProperties, 4, 0);
+ const std::string select_idvrHelpItem =
+ "SELECT idvrHelpItem FROM vrHelpItemArray;";
+ CheckSelectQuery(select_idvrHelpItem, 5, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kInsertHelpTimeoutPromptArray_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillHelpTimeoutPromptArrayTable(temp_query, 1, 2, 3);
+ // Checks
+ const std::string select_count_helpTimeoutPromptArray =
+ "SELECT COUNT(*) FROM helpTimeoutPromptArray;";
+ CheckSelectQuery(select_count_helpTimeoutPromptArray, 1, 0);
+ const std::string select_idglobalProperties =
+ "SELECT idglobalProperties FROM helpTimeoutPromptArray;";
+ CheckSelectQuery(select_idglobalProperties, 1, 0);
+ const std::string select_idtimeoutPrompt =
+ "SELECT idtimeoutPrompt FROM helpTimeoutPromptArray;";
+ CheckSelectQuery(select_idtimeoutPrompt, 2, 0);
+ const std::string select_idhelpPrompt =
+ "SELECT idhelpPrompt FROM helpTimeoutPromptArray;";
+ CheckSelectQuery(select_idhelpPrompt, 3, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertTTSChunk_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillTTSChunkTable(temp_query, 2, "text");
+ // Checks
+ const std::string select_count_kInsertTTSChunk =
+ "SELECT COUNT(*) FROM TTSChunk;";
+ CheckSelectQuery(select_count_kInsertTTSChunk, 1, 0);
+ const std::string select_type = "SELECT type FROM TTSChunk;";
+ CheckSelectQuery(select_type, 2, 0);
+ const std::string select_text = "SELECT text FROM TTSChunk;";
+ CheckSelectQuery(select_text, "text", 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kInsertApplication_ExpectDataInserted) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9);
+ // Checks
+ const std::string select_count_application =
+ "SELECT COUNT(*) FROM application;";
+ CheckSelectQuery(select_count_application, 1, 0);
+
+ const std::string select_connection_key =
+ "SELECT connection_key FROM application;";
+ CheckSelectQuery(select_connection_key, connection_key, 0);
+ const std::string select_grammarID = "SELECT grammarID FROM application;";
+ CheckSelectQuery(select_grammarID, grammarID, 0);
+ const std::string select_hashID = "SELECT hashID FROM application;";
+ CheckSelectQuery(select_hashID, test_hash, 0);
+ const std::string select_hmiAppID = "SELECT hmiAppID FROM application;";
+ CheckSelectQuery(select_hmiAppID, hmiAppID, 0);
+ const std::string select_hmiLevel = "SELECT hmiLevel FROM application;";
+ CheckSelectQuery(select_hmiLevel, hmiLevel, 0);
+ const std::string select_ign_off_count =
+ "SELECT ign_off_count FROM application;";
+ CheckSelectQuery(select_ign_off_count, ign_off_count, 0);
+ const std::string select_timeStamp = "SELECT timeStamp FROM application;";
+ CheckSelectQuery(select_timeStamp, timeStamp, 0);
+ const std::string select_idglobalProperties =
+ "SELECT idglobalProperties FROM application;";
+ CheckSelectQuery(select_idglobalProperties, 9, 0);
+ const std::string select_isMediaApplication =
+ "SELECT isMediaApplication FROM application;";
+ CheckSelectQuery(select_isMediaApplication, false, 0);
+ const std::string select_appID = "SELECT appID FROM application;";
+ CheckSelectQuery(select_appID, app_id1, 0);
+ const std::string select_deviceID = "SELECT deviceID FROM application;";
+ CheckSelectQuery(select_deviceID, device_id, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountFiles_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t file_key =
+ FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
+ FillApplicationFilesArrayTable(temp_query, app_key, file_key);
+
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectCountFiles, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectFiles_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t file_key =
+ FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
+ FillApplicationFilesArrayTable(temp_query, app_key, file_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectFiles, p1, p2, 1, 0);
+ CheckSelectQuery(kSelectFiles, p1, p2, true, 1);
+ CheckSelectQuery(kSelectFiles, p1, p2, true, 2);
+ CheckSelectQuery(kSelectFiles, p1, p2, "tst_name", 3);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountSubMenu_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t submenu_key =
+ FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId();
+ FillApplicationSubMenuArrayTable(temp_query, app_key, submenu_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectCountSubMenu, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectSubMenu_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t submenu_key =
+ FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId();
+
+ FillApplicationSubMenuArrayTable(temp_query, app_key, submenu_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectSubMenu, p1, p2, 1, 0);
+ CheckSelectQuery(kSelectSubMenu, p1, p2, "menu_name", 1);
+ CheckSelectQuery(kSelectSubMenu, p1, p2, 1, 2);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountCommands_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t command_key =
+ FillCommandTable(temp_query, 1, "menu_name", 1, 2, 5).LastInsertId();
+ FillApplicationCommandsArrayTable(temp_query, app_key, command_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectCountCommands, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+
+ FillChoiceTable(
+ temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
+ .LastInsertId();
+ int64_t command_key =
+ FillCommandTable(temp_query, 1, "menu_name", 1, 2, image_key)
+ .LastInsertId();
+
+ FillApplicationCommandsArrayTable(temp_query, app_key, command_key);
+ FillVRCommandsArrayTable(
+ temp_query, "best", kVRCommandFromCommand, command_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectCommands, p1, p2, 1, 0);
+ CheckSelectQuery(kSelectCommands, p1, p2, 1, 1);
+ CheckSelectQuery(kSelectCommands, p1, p2, "menu_name", 2);
+ CheckSelectQuery(kSelectCommands, p1, p2, 1, 3);
+ CheckSelectQuery(kSelectCommands, p1, p2, 2, 4);
+ CheckSelectQuery(kSelectCommands, p1, p2, "tst_image", 5);
+ CheckSelectQuery(kSelectCommands, p1, p2, 2, 6);
+ CheckSelectQuery(kSelectCommands, p1, p2, "best", 7);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+
+ int64_t choice_key =
+ FillChoiceTable(
+ temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
+ .LastInsertId();
+ int64_t command_key =
+ FillCommandTable(temp_query, 1, "menu_name", 1, 2, image_key)
+ .LastInsertId();
+
+ FillApplicationCommandsArrayTable(temp_query, app_key, command_key);
+ FillVRCommandsArrayTable(
+ temp_query, "best", kVRCommandFromChoice, choice_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ const std::string kChecksVrCommandFromSelectCommand =
+ "SELECT COUNT(*) FROM (SELECT `command`.`idcommand`, `cmdID`, "
+ "`menuName`, `parentID`, `position`, `value`, `imageType`, `vrCommand` "
+ "FROM `command` LEFT OUTER JOIN `image` on `command`.`idimage` = "
+ "`image`.`idimage` "
+ "LEFT OUTER JOIN `vrcommandsarray` on `command`.`idcommand` = "
+ "`vrcommandsarray`.`idcommand` "
+ "WHERE `command`.`idcommand` IN (SELECT `idcommand` "
+ "FROM `applicationCommandsArray` "
+ "WHERE `idApplication` = (SELECT `idApplication` "
+ "FROM `application` WHERE `appID` = ? AND `deviceID` = ?))) "
+ "WHERE vrCommand IS NULL";
+ // Check
+ CheckSelectQuery(kSelectCommands, p1, p2, 1, 0);
+ CheckSelectQuery(kSelectCommands, p1, p2, 1, 1);
+ CheckSelectQuery(kSelectCommands, p1, p2, "menu_name", 2);
+ CheckSelectQuery(kSelectCommands, p1, p2, 1, 3);
+ CheckSelectQuery(kSelectCommands, p1, p2, 2, 4);
+ CheckSelectQuery(kSelectCommands, p1, p2, "tst_image", 5);
+ CheckSelectQuery(kSelectCommands, p1, p2, 2, 6);
+ CheckSelectQuery(kChecksVrCommandFromSelectCommand, p1, p2, true, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountSubscriptions_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectCountSubscriptions, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectSubscriptions_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectSubscriptions, p1, p2, 2, 0);
+ CheckSelectQuery(kSelectSubscriptions, p1, p2, 3, 1);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCountChoiceSet_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ FillApplicationChoiceSetArrayTable(temp_query, 2, app_key);
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectCountChoiceSet, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t app_key = FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 9).LastInsertId();
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t choice_key =
+ FillChoiceTable(
+ temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
+ .LastInsertId();
+ int64_t app_choice_set_key =
+ FillApplicationChoiceSetTable(temp_query, 23, 2).LastInsertId();
+
+ FillChoiceArrayTable(temp_query, app_choice_set_key, choice_key);
+ FillApplicationChoiceSetArrayTable(temp_query, app_choice_set_key, app_key);
+ FillVRCommandsArrayTable(
+ temp_query, "best", kVRCommandFromChoice, choice_key);
+
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Check
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 1, 0);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 23, 1);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 2, 2);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 1, 3);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 1, 4);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, "menu_name", 5);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, "sec_text", 6);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, "tert_text", 7);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 1, 8);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, 1, 9);
+ CheckSelectQuery(kSelectChoiceSets, p1, p2, "best", 10);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ // Check
+ ValToPosPair p1(0, IntToString(image_key));
+ ValToPosPair p2(1, "");
+ CheckSelectQuery(kSelectImage, p1, p2, 2, 0);
+ CheckSelectQuery(kSelectImage, p1, p2, "tst_image", 1);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kSelectCountGlobalProperties_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 5)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ glob_prop_key).LastInsertId();
+
+ // Check
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckSelectQuery(kSelectCountGlobalProperties, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
+ .LastInsertId();
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ glob_prop_key).LastInsertId();
+ FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, 3, 7);
+
+ // Check
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, glob_prop_key, 0);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, "tst_vr_title", 1);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, "tst_menu", 2);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, 1, 3);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, 2, 4);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, 3, 5);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, 3, 6);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, "auto", 7);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, 7, 8);
+ CheckSelectQuery(kSelectGlobalProperties, p1, p2, 3, 9);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
+ .LastInsertId();
+ int64_t vr_help_item_key =
+ FillVRHelpItemTable(temp_query, "tst_text", 2, image_key).LastInsertId();
+ FillVRHelpItemArrayTable(temp_query, glob_prop_key, vr_help_item_key);
+ // Check
+ ValToPosPair p1(0, IntToString(glob_prop_key));
+ ValToPosPair p2(1, "");
+ CheckSelectQuery(kChecksVrHelpItem, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
+ .LastInsertId();
+ int64_t vr_help_item_key =
+ FillVRHelpItemTable(temp_query, "tst_text", 2, image_key).LastInsertId();
+ FillVRHelpItemArrayTable(temp_query, glob_prop_key, vr_help_item_key);
+ // Check
+ ValToPosPair p1(0, IntToString(glob_prop_key));
+ ValToPosPair p2(1, "");
+ CheckSelectQuery(kSelectVrHelpItem, p1, p2, "tst_text", 0);
+ CheckSelectQuery(kSelectVrHelpItem, p1, p2, 2, 1);
+ CheckSelectQuery(kSelectVrHelpItem, p1, p2, 2, 2);
+ CheckSelectQuery(kSelectVrHelpItem, p1, p2, "tst_image", 3);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kChecksCharacter_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 2)
+ .LastInsertId();
+ string character_list = "abcdefghijkl";
+ int64_t lim_char_list_key = FillTableLimitedCharacterListTable(
+ temp_query, character_list).LastInsertId();
+ FillCharacterArrayTable(temp_query, glob_prop_key, lim_char_list_key);
+ // Check
+ ValToPosPair p1(0, IntToString(glob_prop_key));
+ ValToPosPair p2(1, "");
+ CheckSelectQuery(kChecksCharacter, p1, p2, 1, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectCharacter_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t glob_prop_key =
+ FillGlobalPropertiesTable(
+ temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 2)
+ .LastInsertId();
+ string character_list = "abcdefghijkl";
+ int64_t lim_char_list_key = FillTableLimitedCharacterListTable(
+ temp_query, character_list).LastInsertId();
+ FillCharacterArrayTable(temp_query, glob_prop_key, lim_char_list_key);
+ // Check
+ ValToPosPair p1(0, IntToString(glob_prop_key));
+ ValToPosPair p2(1, "");
+ CheckSelectQuery(kSelectCharacter, p1, p2, character_list, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectAllApps_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 1);
+
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id2,
+ device_id2,
+ 2);
+ // Checks
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Prepare(kSelectAllApps) && query.Exec());
+ EXPECT_EQ(app_id1, query.GetString(0));
+ EXPECT_EQ(device_id, query.GetString(1));
+ EXPECT_TRUE(query.Next());
+ EXPECT_EQ(app_id2, query.GetString(0));
+ EXPECT_EQ(device_id2, query.GetString(1));
+}
+
+TEST_F(ResumptionSqlQueriesTest, kUpdateApplicationData_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ false,
+ app_id1,
+ device_id,
+ 1);
+ string select_hmi_level_and_time_stamp =
+ "SELECT `hmiLevel`, `timeStamp`FROM `application` "
+ "WHERE `appID` = ? AND `deviceID` = ?;";
+
+ // Checks before action
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ CheckSelectQuery(select_hmi_level_and_time_stamp, p1, p2, hmiLevel, 0);
+ CheckSelectQuery(select_hmi_level_and_time_stamp, p1, p2, timeStamp, 1);
+ // Act
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Prepare(kUpdateApplicationData));
+ query.Bind(0, 2);
+ query.Bind(1, 2016);
+ query.Bind(2, app_id1);
+ query.Bind(3, device_id);
+ EXPECT_TRUE(query.Exec());
+ // Checks after action
+ CheckSelectQuery(select_hmi_level_and_time_stamp, p1, p2, 2, 0);
+ CheckSelectQuery(select_hmi_level_and_time_stamp, p1, p2, 2016, 1);
+}
+
+TEST_F(ResumptionSqlQueriesTest,
+ kUpdateDBVersion_kSelectDBVersion_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ EXPECT_TRUE(temp_query.Exec(kInsertInitData));
+ // Checks before action
+ CheckSelectQuery(kSelectDBVersion, 0, 0);
+ // Act
+ SQLQuery query(db());
+ EXPECT_TRUE(query.Prepare(kUpdateDBVersion));
+ query.Bind(0, 2);
+ EXPECT_TRUE(query.Exec());
+ // Checks after action
+ CheckSelectQuery(kSelectDBVersion, 2, 0);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectTTSChunk_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ int64_t tts_chunk_key =
+ FillTTSChunkTable(temp_query, 2, "tst_txt").LastInsertId();
+ ValToPosPair p1(0, IntToString(tts_chunk_key));
+ ValToPosPair p2(1, "");
+ // Checks
+ CheckSelectQuery(kSelectTTSChunk, p1, p2, "tst_txt", 0);
+ CheckSelectQuery(kSelectTTSChunk, p1, p2, 2, 1);
+}
+
+TEST_F(ResumptionSqlQueriesTest, kSelectAppTable_ExpectDataCorrect) {
+ // Arrange
+ SQLQuery temp_query(db());
+ FillApplicationTable(temp_query,
+ connection_key,
+ grammarID,
+ test_hash,
+ hmiAppID,
+ hmiLevel,
+ ign_off_count,
+ timeStamp,
+ true,
+ app_id1,
+ device_id,
+ 1);
+
+ ValToPosPair p1(0, app_id1);
+ ValToPosPair p2(1, device_id);
+ // Checks
+ CheckSelectQuery(kSelectAppTable, p1, p2, app_id1, 0);
+ CheckSelectQuery(kSelectAppTable, p1, p2, connection_key, 1);
+ CheckSelectQuery(kSelectAppTable, p1, p2, grammarID, 2);
+ CheckSelectQuery(kSelectAppTable, p1, p2, test_hash, 3);
+ CheckSelectQuery(kSelectAppTable, p1, p2, hmiAppID, 4);
+ CheckSelectQuery(kSelectAppTable, p1, p2, hmiLevel, 5);
+ CheckSelectQuery(kSelectAppTable, p1, p2, ign_off_count, 6);
+ CheckSelectQuery(kSelectAppTable, p1, p2, timeStamp, 7);
+ CheckSelectQuery(kSelectAppTable, p1, p2, device_id, 8);
+ CheckSelectQuery(kSelectAppTable, p1, p2, true, 9);
+}
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
new file mode 100644
index 0000000000..d6f34c12fc
--- /dev/null
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -0,0 +1,1944 @@
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-02-12",
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 70,
+ "seconds_between_retries": [1,
+ 5,
+ 25,
+ 125,
+ 625],
+ "endpoints": {
+ "0x07": {
+ "default": ["http://policies.telematics.ford.com/api/policies"]
+ }
+ },
+ "notifications_per_minute_by_priority": {
+ "EMERGENCY": 60,
+ "NAVIGATION": 15,
+ "COMMUNICATION": 6,
+ "NORMAL": 4,
+ "NONE": 0
+ }
+ },
+ "functional_groupings": {
+ "Base-4": {
+ "rpcs": {
+ "AddCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "AddSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Alert": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "CreateInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EndAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GenericResponse": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnButtonEvent": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnButtonPress": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHashChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PerformInteraction": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ScrollableMessage": {
+ "hmi_levels": ["FULL"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SetMediaClockTimer": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "Show": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Slider": {
+ "hmi_levels": ["FULL"]
+ },
+ "Speak": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "SubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "Location-1": {
+ "user_consent_prompt": "Location",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ }
+ }
+ },
+ "Notifications": {
+ "user_consent_prompt": "Notifications",
+ "rpcs": {
+ "Alert": {
+ "hmi_levels": ["BACKGROUND"]
+ }
+ }
+ },
+ "DrivingCharacteristics-3": {
+ "user_consent_prompt": "DrivingCharacteristics",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ }
+ }
+ },
+ "VehicleInfo-3": {
+ "user_consent_prompt": "VehicleInfo",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"]
+ }
+ }
+ },
+ "PropriataryData-1": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetDTCs": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ReadDID": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "Emergency-1": {
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ }
+ }
+ },
+ "Navigation-1": {
+ "rpcs": {
+ "AlertManeuver": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ShowConstantTBT": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "UpdateTurnList": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "DataConsent-2": {
+ "user_consent_prompt": "DataConsent",
+ "rpcs": null
+ },
+ "BaseBeforeDataConsent": {
+ "rpcs": {
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHashChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ }
+ }
+ }
+ },
+ "consumer_friendly_messages": {
+ "version": "001.001.019",
+ "messages": {
+ "AppPermissions": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
+ "line1": "Zugriffsanfrage(n)",
+ "line2": "erlauben?"
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.",
+ "line1": "Grant Requested",
+ "line2": "Permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "es-en": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?",
+ "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
+ "line1": "¿Conceder permisos",
+ "line2": "solicitados?"
+ },
+ "es-mx": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?"
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)",
+ "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)"
+ },
+ "it-it": {
+ "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
+ "line1": "Concedi autorizzaz.",
+ "line2": "richiesta(e)?"
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
+ "line1": "Aangevraagde",
+ "line2": "permissie(s) verlenen?"
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
+ "line1": "Udzielić żądanych",
+ "line2": "pozwoleń?"
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
+ "line1": "Conceder permissão",
+ "line2": "solicitada?"
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
+ "line1": "Conceder permiss.",
+ "line2": "solicitada(s)?"
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
+ "line1": "Предост. заправш.",
+ "line2": "разрешения?"
+ },
+ "sv-se": {
+ "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
+ "line1": "Vill du ge",
+ "line2": "tillstånd?"
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
+ "line1": "İstenen izinler",
+ "line2": "verilsin mi?"
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
+ "line1": "是否允许请求的",
+ "line2": "权限?"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
+ "line1": "允許",
+ "line2": "授權請求?"
+ }
+ }
+ },
+ "AppPermissionsHelp": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
+ },
+ "es-en": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
+ },
+ "es-mx": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "it-it": {
+ "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
+ },
+ "sv-se": {
+ "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "AppPermissionsRevoked": {
+ "languages": {
+ "de-de": {
+ "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
+ },
+ "en-au": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-gb": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-ie": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-us": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "es-en": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "es-es": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
+ },
+ "es-mx": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "fr-ca": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "fr-fr": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "it-it": {
+ "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
+ },
+ "nl-nl": {
+ "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
+ },
+ "pl-pl": {
+ "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
+ },
+ "pt-br": {
+ "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
+ },
+ "pt-pt": {
+ "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
+ },
+ "ru-ru": {
+ "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
+ },
+ "sv-se": {
+ "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
+ },
+ "tr-tr": {
+ "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
+ },
+ "zh-cn": {
+ "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
+ },
+ "zh-tw": {
+ "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
+ }
+ }
+ },
+ "AppUnauthorized": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
+ "line1": "nicht autorisiert"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized",
+ "textBody": "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "Not Authorized",
+ "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada",
+ "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
+ "line1": "No autorizada"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada"
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée",
+ "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
+ "line1": "non autorizzata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
+ "line1": "niet geautoriseerd"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
+ "line1": "brak autoryzacji"
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
+ "line1": "não autorizado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
+ "line1": "não autorizada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
+ "line1": "не авторизировано"
+ },
+ "sv-se": {
+ "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
+ "line1": "är ej godkänd"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
+ "line1": "için izin yok"
+ },
+ "zh-cn": {
+ "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
+ "line1": "未得到授权"
+ },
+ "zh-tw": {
+ "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
+ "line1": "無授權"
+ }
+ }
+ },
+ "AppUnsupported": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
+ "line1": "nicht unterstützt"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported",
+ "textBody": "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "Not Supported",
+ "textBody": "Your version of %appName% is not supported by SYNC."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible",
+ "textBody": "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "No compatible"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible"
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible",
+ "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è supportata dal SYNC.",
+ "line1": "non supportata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
+ "line1": "niet ondersteund"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
+ "line1": "aplikacja nie obsług."
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
+ "line1": "não suportado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
+ "line1": "não suportada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не поддерживается SYNC.",
+ "line1": "не поддерживается"
+ },
+ "sv-se": {
+ "tts": "SYNC har inte stöd för den här versionen av %appName%.",
+ "line1": "stöds ej"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
+ "line1": "desteklenmiyor"
+ },
+ "zh-cn": {
+ "tts": "SYNC不支持此版本的%appName%。",
+ "line1": "不受支持"
+ },
+ "zh-tw": {
+ "tts": "SYNC 不支援此版本的%appName% 。",
+ "line1": "不支援"
+ }
+ }
+ },
+ "DataConsent": {
+ "languages": {
+ "en-gb": {
+ "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "en-us": {
+ "line1": "Enable Mobile Apps",
+ "line2": "on SYNC? (Uses Data)",
+ "textBody": "Would you like to enable Mobile Apps on SYNC?\n\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\n\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "es-en": {
+ "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. /r Presione Sí para permitir y No para denegar."
+ },
+ "fr-ca": {
+ "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements. /r Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ }
+ }
+ },
+ "DataConsentHelp": {
+ "languages": {
+ "en-us": {
+ "textBody": "Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. See your Owner Guide for more information."
+ },
+ "es-en": {
+ "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
+ },
+ "fr-ca": {
+ "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
+ }
+ }
+ },
+ "DisableApps": {
+ "languages": {
+ "de-de": {
+ "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
+ "line1": "Auto-Update",
+ "line2": "und Mobile Apps deaktivieren"
+ },
+ "en-au": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-gb": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-ie": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-us": {
+ "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
+ "line1": "Disable Auto-Updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel."
+ },
+ "es-en": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?",
+ "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "es-es": {
+ "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
+ "line1": "¿Desact. actual. auto",
+ "line2": "y apl. móviles?"
+ },
+ "es-mx": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?"
+ },
+ "fr-ca": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?",
+ "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
+ },
+ "fr-fr": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?"
+ },
+ "it-it": {
+ "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
+ "line1": "Disabilitare agg. aut.",
+ "line2": "e app mobili?"
+ },
+ "nl-nl": {
+ "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
+ "line1": "Auto-updates en mob.",
+ "line2": "apps uitschakelen?"
+ },
+ "pl-pl": {
+ "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
+ "line1": "Wył. automat. aktual.",
+ "line2": "i aplikacje mobilne?"
+ },
+ "pt-br": {
+ "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
+ "line1": "Desativar atualizações",
+ "line2": "autom. e aplicativos?"
+ },
+ "pt-pt": {
+ "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
+ "line1": "Desact. actual. autom.",
+ "line2": "e aplicações móveis?"
+ },
+ "ru-ru": {
+ "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
+ "line1": "Откл. автообновления",
+ "line2": "и мобил. прилож.?"
+ },
+ "sv-se": {
+ "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
+ "line1": "Avaktiverar autouppdat.",
+ "line2": "och mobilappar?"
+ },
+ "tr-tr": {
+ "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
+ "line1": "Oto. güncelleme ve",
+ "line2": "mobil uygul. kapat?"
+ },
+ "zh-cn": {
+ "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
+ "line1": "是否禁用自动更新和",
+ "line2": "移动应用程序?"
+ },
+ "zh-tw": {
+ "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
+ "line1": "停用自動更新",
+ "line2": "和行動應用程式?"
+ }
+ }
+ },
+ "DrivingCharacteristics": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
+ "label": "Fahreigenschaften"
+ },
+ "en-au": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-gb": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-us": {
+ "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.",
+ "label": "Driving Characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
+ "label": "Características de conducción"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo"
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite",
+ "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
+ "label": "Caratteristiche di guida"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
+ "label": "Rijkenmerken"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
+ "label": "Informacje dotyczące stylu jazdy"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
+ "label": "Características de condução"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
+ "label": "Características de condução"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
+ "label": "Характеристики движения"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
+ "label": "Köregenskaper"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
+ "label": "Sürüş karakteristikleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
+ "label": "行驶特性"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
+ "label": "駕駛特性"
+ }
+ }
+ },
+ "Location": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
+ "label": "GPS und Geschwindigkeit"
+ },
+ "en-au": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-gb": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "en-ie": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-us": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad",
+ "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
+ "label": "GPS y velocidad"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad"
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse",
+ "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
+ "label": "GPS e velocità"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
+ "label": "Gps en snelheid"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
+ "label": "GPS i prędkość"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
+ "label": "GPS и скорость"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
+ "label": "GPS och hastighet"
+ },
+ "tr-tr": {
+ "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
+ "label": "GPS ve hız"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
+ "label": "GPS 和车速"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取車輛的GPS和速度。",
+ "label": "GPS和車速"
+ }
+ }
+ },
+ "Notifications": {
+ "languages": {
+ "de-de": {
+ "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
+ "label": "Push-Benachrichtigungen"
+ },
+ "en-au": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-gb": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "en-ie": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-us": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push",
+ "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
+ "label": "Notificaciones push"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push"
+ },
+ "fr-ca": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications instantanées",
+ "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications push"
+ },
+ "it-it": {
+ "tts": "Un'app può inviare notifiche se eseguita in background.",
+ "label": "Notifiche push"
+ },
+ "nl-nl": {
+ "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
+ "label": "Push-meldingen"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
+ "label": "Powiadomienia Push"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
+ "label": "Notificações Push"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
+ "label": "Notificações push"
+ },
+ "ru-ru": {
+ "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
+ "label": "Оповещения о пересылке"
+ },
+ "sv-se": {
+ "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
+ "label": "Push-notiser"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
+ "label": "Anlık bildirimleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序在后台运行时可推送通知。",
+ "label": "推送通知"
+ },
+ "zh-tw": {
+ "tts": "車輛行進時,應用程式可在背景中傳送通知。",
+ "label": "傳送通知"
+ }
+ }
+ },
+ "SettingDisableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Updates deakt."
+ },
+ "en-au": {
+ "line1": "Disable updates"
+ },
+ "en-gb": {
+ "line1": "Disable updates"
+ },
+ "en-ie": {
+ "line1": "Disable updates"
+ },
+ "en-us": {
+ "line1": "Disable Updates",
+ "textBody": "Disable Updates"
+ },
+ "es-en": {
+ "line1": "Deshab. actual.",
+ "textBody": "Deshab. actual."
+ },
+ "es-es": {
+ "line1": "Desact. actual."
+ },
+ "es-mx": {
+ "line1": "Deshab. actual."
+ },
+ "fr-ca": {
+ "line1": "Désactiver MAJ",
+ "textBody": "Désactiver MAJ"
+ },
+ "fr-fr": {
+ "line1": "Désactiver màj"
+ },
+ "it-it": {
+ "line1": "Disabilita agg."
+ },
+ "nl-nl": {
+ "line1": "Upd. uitschak."
+ },
+ "pl-pl": {
+ "line1": "Wyłącz aktual."
+ },
+ "pt-br": {
+ "line1": "Desat. atualiz."
+ },
+ "pt-pt": {
+ "line1": "Desact. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Откл. обновл."
+ },
+ "sv-se": {
+ "line1": "Inaktivera uppd."
+ },
+ "tr-tr": {
+ "line1": "Güncell. Kapat"
+ },
+ "zh-cn": {
+ "line1": "禁用更新"
+ },
+ "zh-tw": {
+ "line1": "停用更新"
+ }
+ }
+ },
+ "SettingEnableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Apps aktivieren"
+ },
+ "en-au": {
+ "line1": "Enable Apps"
+ },
+ "en-gb": {
+ "line1": "Enable Apps"
+ },
+ "en-ie": {
+ "line1": "Enable Apps"
+ },
+ "en-us": {
+ "line1": "Enable Apps"
+ },
+ "es-en": {
+ "line1": "Hab. aplic."
+ },
+ "es-es": {
+ "line1": "Activar apl."
+ },
+ "es-mx": {
+ "line1": "Hab. aplic."
+ },
+ "fr-ca": {
+ "line1": "Activer app.",
+ "textBody": "Activer app."
+ },
+ "fr-fr": {
+ "line1": "Activer app."
+ },
+ "it-it": {
+ "line1": "Abilita app"
+ },
+ "nl-nl": {
+ "line1": "Apps inschak."
+ },
+ "pl-pl": {
+ "line1": "Włącz aplikacje"
+ },
+ "pt-br": {
+ "line1": "Ativar aplic."
+ },
+ "pt-pt": {
+ "line1": "Activar actualiz."
+ },
+ "ru-ru": {
+ "line1": "Вкл. прилож."
+ },
+ "sv-se": {
+ "line1": "Aktivera appar"
+ },
+ "tr-tr": {
+ "line1": "Uygulamaları aç"
+ },
+ "zh-cn": {
+ "line1": "启用应用程序"
+ },
+ "zh-tw": {
+ "line1": "啟用應用程式"
+ }
+ }
+ },
+ "SettingUpdateAuto": {
+ "languages": {
+ "de-de": {
+ "line1": "Update anford."
+ },
+ "en-au": {
+ "line1": "Request update"
+ },
+ "en-gb": {
+ "line1": "Request update"
+ },
+ "en-ie": {
+ "line1": "Request update"
+ },
+ "en-us": {
+ "line1": "Request Update",
+ "textBody": "Select `Update now` to receive app authorization information for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
+ },
+ "es-en": {
+ "line1": "Solicit. actualiz.",
+ "textBody": "Solicit. actualiz."
+ },
+ "es-es": {
+ "line1": "Solicitar actual."
+ },
+ "es-mx": {
+ "line1": "Solicit. actualiz."
+ },
+ "fr-ca": {
+ "line1": "Demander MAJ",
+ "textBody": "Demander MAJ"
+ },
+ "fr-fr": {
+ "line1": "Demander màj"
+ },
+ "it-it": {
+ "line1": "Rich. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Upd. aanvragen"
+ },
+ "pl-pl": {
+ "line1": "Zażądaj aktual."
+ },
+ "pt-br": {
+ "line1": "Solicitar atualiz."
+ },
+ "pt-pt": {
+ "line1": "Solicit. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Запрос на обн."
+ },
+ "sv-se": {
+ "line1": "Begär uppdat."
+ },
+ "tr-tr": {
+ "line1": "Güncelleme iste"
+ },
+ "zh-cn": {
+ "line1": "请求更新"
+ },
+ "zh-tw": {
+ "line1": "請求更新"
+ }
+ }
+ },
+ "StatusNeeded": {
+ "languages": {
+ "de-de": {
+ "line1": "Update benötigt"
+ },
+ "en-au": {
+ "line1": "Update needed"
+ },
+ "en-gb": {
+ "line1": "Update needed",
+ "textBody": "Update needed"
+ },
+ "en-ie": {
+ "line1": "Update needed"
+ },
+ "en-us": {
+ "line1": "Update Needed",
+ "textBody": "Update Needed"
+ },
+ "es-en": {
+ "line1": "Actualiz. neces.",
+ "textBody": "Actualiz. neces."
+ },
+ "es-es": {
+ "line1": "Actu. necesaria"
+ },
+ "es-mx": {
+ "line1": "Actualiz. neces."
+ },
+ "fr-ca": {
+ "line1": "Màj requise",
+ "textBody": "Màj requise"
+ },
+ "fr-fr": {
+ "line1": "Mise à jour requise"
+ },
+ "it-it": {
+ "line1": "Necess. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Update nodig"
+ },
+ "pl-pl": {
+ "line1": "Potrzeba aktual."
+ },
+ "pt-br": {
+ "line1": "Atualiz. necess."
+ },
+ "pt-pt": {
+ "line1": "Actual. necess."
+ },
+ "ru-ru": {
+ "line1": "Необх. обновл."
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs"
+ },
+ "tr-tr": {
+ "line1": "Güncellenmeli"
+ },
+ "zh-cn": {
+ "line1": "需要进行更新"
+ },
+ "zh-tw": {
+ "line1": "需更新"
+ }
+ }
+ },
+ "StatusPending": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktualisieren..."
+ },
+ "en-au": {
+ "line1": "Updating..."
+ },
+ "en-gb": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "en-ie": {
+ "line1": "Updating..."
+ },
+ "en-us": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "es-en": {
+ "line1": "Actualizando...",
+ "textBody": "Actualizando..."
+ },
+ "es-es": {
+ "line1": "Actualizando..."
+ },
+ "es-mx": {
+ "line1": "Actualizando..."
+ },
+ "fr-ca": {
+ "line1": "MAJ en cours...",
+ "textBody": "MAJ en cours..."
+ },
+ "fr-fr": {
+ "line1": "Màj en cours..."
+ },
+ "it-it": {
+ "line1": "Aggiornamento"
+ },
+ "nl-nl": {
+ "line1": "Updaten..."
+ },
+ "pl-pl": {
+ "line1": "Aktualizowanie"
+ },
+ "pt-br": {
+ "line1": "Atualizando..."
+ },
+ "pt-pt": {
+ "line1": "A actualizar..."
+ },
+ "ru-ru": {
+ "line1": "Обновление..."
+ },
+ "sv-se": {
+ "line1": "Uppdaterar..."
+ },
+ "tr-tr": {
+ "line1": "Güncelleniyor..."
+ },
+ "zh-cn": {
+ "line1": "正在更新......"
+ },
+ "zh-tw": {
+ "line1": "更新中..."
+ }
+ }
+ },
+ "StatusUpToDate": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktuelle Version"
+ },
+ "en-au": {
+ "line1": "Up-to-date"
+ },
+ "en-gb": {
+ "line1": "Up-to-date",
+ "textBody": "Up-to-date"
+ },
+ "en-ie": {
+ "line1": "Up-to-date"
+ },
+ "en-us": {
+ "line1": "Up-To-Date",
+ "textBody": "Up-To-Date"
+ },
+ "es-en": {
+ "line1": "Actualizado",
+ "textBody": "Actualizado"
+ },
+ "es-es": {
+ "line1": "Actualizada"
+ },
+ "es-mx": {
+ "line1": "Actualizado"
+ },
+ "fr-ca": {
+ "line1": "Déjà à jour",
+ "textBody": "Déjà à jour"
+ },
+ "fr-fr": {
+ "line1": "Déjà à jour"
+ },
+ "it-it": {
+ "line1": "più recente"
+ },
+ "nl-nl": {
+ "line1": "Up-to-date"
+ },
+ "pl-pl": {
+ "line1": "Aktualne"
+ },
+ "pt-br": {
+ "line1": "Atualizado"
+ },
+ "pt-pt": {
+ "line1": "Actualizado"
+ },
+ "ru-ru": {
+ "line1": "Обновлено"
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs ej"
+ },
+ "tr-tr": {
+ "line1": "Güncel"
+ },
+ "zh-cn": {
+ "line1": "最新更新"
+ },
+ "zh-tw": {
+ "line1": "更新最新"
+ }
+ }
+ },
+ "VehicleInfo": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
+ "label": "Fahrzeuginformationen"
+ },
+ "en-au": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-gb": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
+ },
+ "en-ie": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-us": {
+ "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo",
+ "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
+ "label": "Información del vehículo"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo"
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.",
+ "label": "Renseignements du véhicule",
+ "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
+ "label": "Renseignements du véhicule"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
+ "label": "Informazioni sul veicolo"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
+ "label": "Voertuiginformatie"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
+ "label": "Informacje o pojeździe"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
+ "label": "Informações sobre o veículo"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
+ "label": "Informações do veículo"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
+ "label": "Информация об автомобиле"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
+ "label": "Fordonsinformation"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
+ "label": "Araç bilgisi"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
+ "label": "车辆信息"
+ },
+ "zh-tw": {
+ "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
+ "label": "車輛資訊"
+ }
+ }
+ }
+ }
+ },
+ "app_policies": {
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["Base-4"],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "device": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["DataConsent-2"]
+ },
+ "pre_DataConsent": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["BaseBeforeDataConsent"],
+ "RequestType": ["HTTP"]
+ }
+ }
+ }
+ }
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
new file mode 100644
index 0000000000..a332f92382
--- /dev/null
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -0,0 +1,1722 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "watchdog_timer_ms" : 20000
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "watchdog_timer_ms" : 20000
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "watchdog_timer_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "watchdog_timer_ms" : 20000
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "tts" : "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "tts" : "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "tts" : "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "tts" : "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "tts" : "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press yes to allow or no to deny."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "tts" : "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "tts" : "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "tts" : "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "tts" : "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "tts" : "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "tts" : "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "tts" : "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "tts" : "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "tts" : "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "tts" : "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "tts" : "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "tts" : "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "AppPermissionsHelp" : {
+ "languages" : {
+ "de-de" : {
+ "tts" : "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
+ },
+ "en-au" : {
+ "tts" : "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-gb" : {
+ "tts" : "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-ie" : {
+ "tts" : "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-us" : {
+ "tts" : "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
+ },
+ "es-en" : {
+ "tts" : "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "es-es" : {
+ "tts" : "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
+ },
+ "es-mx" : {
+ "tts" : "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "fr-ca" : {
+ "tts" : "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "fr-fr" : {
+ "tts" : "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "it-it" : {
+ "tts" : "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
+ },
+ "nl-nl" : {
+ "tts" : "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
+ },
+ "pl-pl" : {
+ "tts" : "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
+ },
+ "pt-br" : {
+ "tts" : "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
+ },
+ "pt-pt" : {
+ "tts" : "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
+ },
+ "ru-ru" : {
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
+ },
+ "sv-se" : {
+ "tts" : "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
+ },
+ "tr-tr" : {
+ "tts" : "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
+ },
+ "zh-cn" : {
+ "tts" : "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "AppPermissionsRevoked" : {
+ "languages" : {
+ "de-de" : {
+ "tts" : "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
+ },
+ "en-au" : {
+ "tts" : "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-gb" : {
+ "tts" : "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-ie" : {
+ "tts" : "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-us" : {
+ "tts" : "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "es-en" : {
+ "tts" : "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "es-es" : {
+ "tts" : "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
+ },
+ "es-mx" : {
+ "tts" : "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "fr-ca" : {
+ "tts" : "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "fr-fr" : {
+ "tts" : "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "it-it" : {
+ "tts" : "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
+ },
+ "nl-nl" : {
+ "tts" : "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
+ },
+ "pl-pl" : {
+ "tts" : "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
+ },
+ "pt-br" : {
+ "tts" : "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
+ },
+ "pt-pt" : {
+ "tts" : "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
+ },
+ "ru-ru" : {
+ "tts" : "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
+ },
+ "sv-se" : {
+ "tts" : "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
+ },
+ "tr-tr" : {
+ "tts" : "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
+ },
+ "zh-cn" : {
+ "tts" : "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
+ },
+ "zh-tw" : {
+ "tts" : "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
+ }
+ }
+ },
+ "AppUnauthorized" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "To use mobile apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device's data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "tts" : "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "tts" : "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "tts" : "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "tts" : "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "tts" : "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "tts" : "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "tts" : "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "tts" : "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "tts" : "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "tts" : "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "tts" : "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "tts" : "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "tts" : "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "tts" : "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "tts" : "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "tts" : "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "tts" : "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "SettingDisableUpdates" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Updates deakt."
+ },
+ "en-au" : {
+ "line1" : "Disable updates"
+ },
+ "en-gb" : {
+ "line1" : "Disable updates"
+ },
+ "en-ie" : {
+ "line1" : "Disable updates"
+ },
+ "en-us" : {
+ "line1" : "Disable Updates"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver MAJ"
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj"
+ },
+ "it-it" : {
+ "line1" : "Disabilita agg."
+ },
+ "nl-nl" : {
+ "line1" : "Upd. uitschak."
+ },
+ "pl-pl" : {
+ "line1" : "Wyłącz aktual."
+ },
+ "pt-br" : {
+ "line1" : "Desat. atualiz."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actualiz."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. обновл."
+ },
+ "sv-se" : {
+ "line1" : "Inaktivera uppd."
+ },
+ "tr-tr" : {
+ "line1" : "Güncell. Kapat"
+ },
+ "zh-cn" : {
+ "line1" : "禁用更新"
+ },
+ "zh-tw" : {
+ "line1" : "停用更新"
+ }
+ }
+ },
+ "SettingEnableUpdates" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Apps aktivieren"
+ },
+ "en-au" : {
+ "line1" : "Enable Apps"
+ },
+ "en-gb" : {
+ "line1" : "Enable Apps"
+ },
+ "en-ie" : {
+ "line1" : "Enable Apps"
+ },
+ "en-us" : {
+ "line1" : "Enable Apps"
+ },
+ "es-en" : {
+ "line1" : "Hab. aplic."
+ },
+ "es-es" : {
+ "line1" : "Activar apl."
+ },
+ "es-mx" : {
+ "line1" : "Hab. aplic."
+ },
+ "fr-ca" : {
+ "line1" : "Activer app."
+ },
+ "fr-fr" : {
+ "line1" : "Activer app."
+ },
+ "it-it" : {
+ "line1" : "Abilita app"
+ },
+ "nl-nl" : {
+ "line1" : "Apps inschak."
+ },
+ "pl-pl" : {
+ "line1" : "Włącz aplikacje"
+ },
+ "pt-br" : {
+ "line1" : "Ativar aplic."
+ },
+ "pt-pt" : {
+ "line1" : "Activar actualiz."
+ },
+ "ru-ru" : {
+ "line1" : "Вкл. прилож."
+ },
+ "sv-se" : {
+ "line1" : "Aktivera appar"
+ },
+ "tr-tr" : {
+ "line1" : "Uygulamaları aç"
+ },
+ "zh-cn" : {
+ "line1" : "启用应用程序"
+ },
+ "zh-tw" : {
+ "line1" : "啟用應用程式"
+ }
+ }
+ },
+ "SettingUpdateAuto" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Update anford."
+ },
+ "en-au" : {
+ "line1" : "Request update"
+ },
+ "en-gb" : {
+ "line1" : "Request update"
+ },
+ "en-ie" : {
+ "line1" : "Request update"
+ },
+ "en-us" : {
+ "line1" : "Request Update"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "Demander MAJ"
+ },
+ "fr-fr" : {
+ "line1" : "Demander màj"
+ },
+ "it-it" : {
+ "line1" : "Rich. aggiorn."
+ },
+ "nl-nl" : {
+ "line1" : "Upd. aanvragen"
+ },
+ "pl-pl" : {
+ "line1" : "Zażądaj aktual."
+ },
+ "pt-br" : {
+ "line1" : "Solicitar atualiz."
+ },
+ "pt-pt" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "ru-ru" : {
+ "line1" : "Запрос на обн."
+ },
+ "sv-se" : {
+ "line1" : "Begär uppdat."
+ },
+ "tr-tr" : {
+ "line1" : "Güncelleme iste"
+ },
+ "zh-cn" : {
+ "line1" : "请求更新"
+ },
+ "zh-tw" : {
+ "line1" : "請求更新"
+ }
+ }
+ },
+ "StatusNeeded" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Update benötigt"
+ },
+ "en-au" : {
+ "line1" : "Update needed"
+ },
+ "en-gb" : {
+ "line1" : "Update needed"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "Màj requise"
+ },
+ "fr-fr" : {
+ "line1" : "Mise à jour requise"
+ },
+ "it-it" : {
+ "line1" : "Necess. aggiorn."
+ },
+ "nl-nl" : {
+ "line1" : "Update nodig"
+ },
+ "pl-pl" : {
+ "line1" : "Potrzeba aktual."
+ },
+ "pt-br" : {
+ "line1" : "Atualiz. necess."
+ },
+ "pt-pt" : {
+ "line1" : "Actual. necess."
+ },
+ "ru-ru" : {
+ "line1" : "Необх. обновл."
+ },
+ "sv-se" : {
+ "line1" : "Uppdat. krävs"
+ },
+ "tr-tr" : {
+ "line1" : "Güncellenmeli"
+ },
+ "zh-cn" : {
+ "line1" : "需要进行更新"
+ },
+ "zh-tw" : {
+ "line1" : "需更新"
+ }
+ }
+ },
+ "StatusPending" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Aktualisieren..."
+ },
+ "en-au" : {
+ "line1" : "Updating..."
+ },
+ "en-gb" : {
+ "line1" : "Updating..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "MAJ en cours..."
+ },
+ "fr-fr" : {
+ "line1" : "Màj en cours..."
+ },
+ "it-it" : {
+ "line1" : "Aggiornamento"
+ },
+ "nl-nl" : {
+ "line1" : "Updaten..."
+ },
+ "pl-pl" : {
+ "line1" : "Aktualizowanie"
+ },
+ "pt-br" : {
+ "line1" : "Atualizando..."
+ },
+ "pt-pt" : {
+ "line1" : "A actualizar..."
+ },
+ "ru-ru" : {
+ "line1" : "Обновление..."
+ },
+ "sv-se" : {
+ "line1" : "Uppdaterar..."
+ },
+ "tr-tr" : {
+ "line1" : "Güncelleniyor..."
+ },
+ "zh-cn" : {
+ "line1" : "正在更新......"
+ },
+ "zh-tw" : {
+ "line1" : "更新中..."
+ }
+ }
+ },
+ "StatusUpToDate" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Aktuelle Version"
+ },
+ "en-au" : {
+ "line1" : "Up-to-date"
+ },
+ "en-gb" : {
+ "line1" : "Up-to-date"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "Déjà à jour"
+ },
+ "fr-fr" : {
+ "line1" : "Déjà à jour"
+ },
+ "it-it" : {
+ "line1" : "più recente"
+ },
+ "nl-nl" : {
+ "line1" : "Up-to-date"
+ },
+ "pl-pl" : {
+ "line1" : "Aktualne"
+ },
+ "pt-br" : {
+ "line1" : "Atualizado"
+ },
+ "pt-pt" : {
+ "line1" : "Actualizado"
+ },
+ "ru-ru" : {
+ "line1" : "Обновлено"
+ },
+ "sv-se" : {
+ "line1" : "Uppdat. krävs ej"
+ },
+ "tr-tr" : {
+ "line1" : "Güncel"
+ },
+ "zh-cn" : {
+ "line1" : "最新更新"
+ },
+ "zh-tw" : {
+ "line1" : "更新最新"
+ }
+ }
+ },
+ "VehicleInfo" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "tts" : "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "tts" : "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "tts" : "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "tts" : "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "tts" : "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "tts" : "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "tts" : "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "tts" : "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "functional_groupings" : {
+ "Base-4" : {
+ "rpcs" : {
+ "AddCommand" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "AddSubMenu" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "Alert" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "CreateInteractionChoiceSet" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "DeleteCommand" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteInteractionChoiceSet" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "DeleteSubMenu" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "EncodedSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "EndAudioPassThru" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAudioPassThru" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnButtonEvent" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "OnButtonPress" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "OnCommand" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnHMIStatus" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "PerformAudioPassThru" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "PerformInteraction" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "PutFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "RegisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "ResetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ScrollableMessage" : {
+ "hmi_levels" : [ "FULL" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "SetMediaClockTimer" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "Show" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "Slider" : {
+ "hmi_levels" : [ "FULL" ]
+ },
+ "Speak" : {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ },
+ "SubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [ "gps", "speed" ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [ "gps", "speed" ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [ "gps", "speed" ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [ "gps", "speed" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "PutFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "RegisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "ResetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/application_manager/test/smartDeviceLink_test.ini b/src/components/application_manager/test/smartDeviceLink_test.ini
new file mode 100644
index 0000000000..c544a6e02d
--- /dev/null
+++ b/src/components/application_manager/test/smartDeviceLink_test.ini
@@ -0,0 +1,39 @@
+[MAIN]
+
+; For resume_ctrl tests
+LogsEnabled = false
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav. Changed for tests
+AppStorageFolder = test_storage
+; Limitation for a number of ReadDID requests (the 1st value) per (the 2nd value) seconds
+ReadDIDRequest = 5, 1
+
+[AppInfo]
+; The path for applications info storage. Changed for tests
+AppInfoStorage = test_app_info.dat
+
+[Resumption]
+
+# Timeout in milliseconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+# Time changed for test onAppActivated
+ApplicationResumingTimeout = 30000000
+
+# Timeout in milliseconds for periodical saving resumption persistent data
+AppSavePersistentDataTimeout = 10000
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
+
+# Resumption ctrl uses JSON if UseDBForResumption=false for store data otherwise uses DB
+UseDBForResumption = false
+
+# Number of attempts to open resumption DB
+AttemptsToOpenResumptionDB = 5
+
+# Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMsResumptionDB = 500
diff --git a/src/components/application_manager/test/smartDeviceLink_test2.ini b/src/components/application_manager/test/smartDeviceLink_test2.ini
new file mode 100644
index 0000000000..a5e09b9e6c
--- /dev/null
+++ b/src/components/application_manager/test/smartDeviceLink_test2.ini
@@ -0,0 +1,28 @@
+; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assigned value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is allowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[MAIN]
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
diff --git a/src/components/application_manager/test/state_controller/CMakeLists.txt b/src/components/application_manager/test/state_controller/CMakeLists.txt
index 243e6218ed..50dd931309 100644
--- a/src/components/application_manager/test/state_controller/CMakeLists.txt
+++ b/src/components/application_manager/test/state_controller/CMakeLists.txt
@@ -30,20 +30,20 @@
if(BUILD_TESTS)
-set(appMain_DIR ${CMAKE_SOURCE_DIR}/src/appMain)
-
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/application_manager/test/state_controller/include
+ ${COMPONENTS_DIR}/application_manager/test/include
)
set(LIBRARIES
gmock
ApplicationManager
+ connectionHandler
)
set(SOURCES
state_controller_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
)
create_test("state_controller_test" "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index 488d12b502..f19a0896d1 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -30,21 +30,35 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <gtest/gtest.h>
+#include "gtest/gtest.h"
#include "application_manager/hmi_state.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/state_controller_impl.h"
#include "application_manager/usage_statistics.h"
-#include "application_manager_mock.h"
-#include "application_mock.h"
-#include "statistics_manager_mock.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_application.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "transport_manager/mock_transport_manager.h"
+#include "application_manager/statistics_manager_mock.h"
#include "utils/lock.h"
#include "utils/data_accessor.h"
#include "utils/make_shared.h"
#include "application_manager/message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_message_helper.h"
+#include "policy/mock_policy_settings.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/mock_application_manager.h"
namespace am = application_manager;
+using am::HmiState;
+using am::HmiStatePtr;
+using am::UsageStatistics;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -53,30 +67,12 @@ using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::InSequence;
using ::testing::Truly;
+using ::testing::AtLeast;
-class MessageHelperMock {
- public:
- MOCK_METHOD3(SendActivateAppToHMI,
- uint32_t(uint32_t const app_id,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority));
- MOCK_METHOD1(SendOnResumeAudioSourceToHMI, void(const uint32_t app_id));
-};
-
-static MessageHelperMock* message_helper_mock_;
-
-uint32_t application_manager::MessageHelper::SendActivateAppToHMI(
- uint32_t const app_id, hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority) {
- return message_helper_mock_->SendActivateAppToHMI(app_id, level,
- send_policy_priority);
-}
-
-void application_manager::MessageHelper::SendOnResumeAudioSourceToHMI(
- const uint32_t app_id) {
- message_helper_mock_->SendOnResumeAudioSourceToHMI(app_id);
-}
+static application_manager::MockMessageHelper* message_helper_mock_;
+namespace test {
+namespace components {
namespace state_controller_test {
struct HmiStatesComparator {
@@ -88,14 +84,14 @@ struct HmiStatesComparator {
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_streaming_state,
mobile_apis::SystemContext::eType system_context)
- : hmi_level_(hmi_level),
- audio_streaming_state_(audio_streaming_state),
- system_context_(system_context) {}
+ : hmi_level_(hmi_level)
+ , audio_streaming_state_(audio_streaming_state)
+ , system_context_(system_context) {}
HmiStatesComparator(am::HmiStatePtr state_ptr)
- : hmi_level_(state_ptr->hmi_level()),
- audio_streaming_state_(state_ptr->audio_streaming_state()),
- system_context_(state_ptr->system_context()) {}
+ : hmi_level_(state_ptr->hmi_level())
+ , audio_streaming_state_(state_ptr->audio_streaming_state())
+ , system_context_(state_ptr->system_context()) {}
bool operator()(am::HmiStatePtr state_ptr) const {
return state_ptr->hmi_level() == hmi_level_ &&
@@ -107,8 +103,7 @@ struct HmiStatesComparator {
struct HmiStatesIDComparator {
am::HmiState::StateID state_id_;
- HmiStatesIDComparator(am::HmiState::StateID state_id)
- : state_id_(state_id) {}
+ HmiStatesIDComparator(am::HmiState::StateID state_id) : state_id_(state_id) {}
bool operator()(am::HmiStatePtr state_ptr) const {
return state_ptr->state_id() == state_id_;
@@ -122,53 +117,66 @@ struct HmiStatesIDComparator {
#define NAVI true
#define NOT_NAVI false
-class StateControllerTest : public ::testing::Test {
+enum ApplicationType {
+ APP_TYPE_NON_MEDIA,
+ APP_TYPE_NAVI,
+ APP_TYPE_MEDIA,
+ APP_TYPE_ATTENUATED
+};
+
+class StateControllerImplTest : public ::testing::Test {
public:
- StateControllerTest()
- : ::testing::Test(),
- usage_stat("0", utils::SharedPtr<us::StatisticsManager>(
- new StatisticsManagerMock)),
- applications_(application_set_, applications_lock_),
- state_ctrl_(&app_manager_mock_) {}
- NiceMock<ApplicationManagerMock> app_manager_mock_;
+ StateControllerImplTest()
+ : ::testing::Test()
+ , usage_stat("0",
+ utils::SharedPtr<usage_statistics::StatisticsManager>(
+
+ new state_controller_test::MockStatisticsManager))
+ , applications_(application_set_, applications_lock_) {}
+ NiceMock<application_manager_test::MockApplicationManager> app_manager_mock_;
+ NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
+ NiceMock<connection_handler_test::MockConnectionHandler>
+ mock_connection_handler_;
+ NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
am::UsageStatistics usage_stat;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
am::ApplicationSet application_set_;
mutable sync_primitives::Lock applications_lock_;
DataAccessor<am::ApplicationSet> applications_;
- am::StateController state_ctrl_;
+ utils::SharedPtr<am::StateControllerImpl> state_ctrl_;
am::ApplicationSharedPtr simple_app_;
- NiceMock<ApplicationMock>* simple_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* simple_app_ptr_;
uint32_t simple_app_id_ = 1721;
am::ApplicationSharedPtr navi_app_;
- NiceMock<ApplicationMock>* navi_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* navi_app_ptr_;
uint32_t navi_app_id_ = 1762;
am::ApplicationSharedPtr media_app_;
- NiceMock<ApplicationMock>* media_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* media_app_ptr_;
uint32_t media_app_id_ = 1801;
am::ApplicationSharedPtr vc_app_;
- NiceMock<ApplicationMock>* vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* vc_app_ptr_;
uint32_t vc_app_id_ = 1825;
am::ApplicationSharedPtr media_navi_app_;
- NiceMock<ApplicationMock>* media_navi_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* media_navi_app_ptr_;
uint32_t media_navi_app_id_ = 1855;
am::ApplicationSharedPtr media_vc_app_;
- NiceMock<ApplicationMock>* media_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* media_vc_app_ptr_;
uint32_t media_vc_app_id_ = 1881;
am::ApplicationSharedPtr navi_vc_app_;
- NiceMock<ApplicationMock>* navi_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* navi_vc_app_ptr_;
uint32_t navi_vc_app_id_ = 1894;
am::ApplicationSharedPtr media_navi_vc_app_;
- NiceMock<ApplicationMock>* media_navi_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* media_navi_vc_app_ptr_;
uint32_t media_navi_vc_app_id_ = 1922;
std::vector<am::HmiStatePtr> valid_states_for_audio_app_;
@@ -177,6 +185,12 @@ class StateControllerTest : public ::testing::Test {
std::vector<am::HmiStatePtr> invalid_states_for_not_audio_app;
std::vector<am::HmiStatePtr> invalid_states_for_audio_app;
std::vector<am::HmiState::StateID> valid_state_ids_;
+ std::vector<am::ApplicationSharedPtr> applications_list_;
+
+ connection_handler_test::MockConnectionHandlerSettings
+ mock_connection_handler__settings;
+ transport_manager_test::MockTransportManager mock_transport_manager;
+ connection_handler::ConnectionHandlerImpl* conn_handler;
am::HmiStatePtr createHmiState(
mobile_apis::HMILevel::eType hmi_level,
@@ -187,18 +201,382 @@ class StateControllerTest : public ::testing::Test {
namespace SystemContext = mobile_apis::SystemContext;
am::HmiStatePtr state =
- utils::MakeShared<am::HmiState>(simple_app_id_, &app_manager_mock_);
+ utils::MakeShared<am::HmiState>(simple_app_id_, app_manager_mock_);
state->set_hmi_level(hmi_level);
state->set_audio_streaming_state(aidio_ss);
state->set_system_context(system_context);
return state;
}
+ /**
+ * @brief Prepare list of resultant HMI states for testing HMIState
+ * @param result_hmi state will contain resultant HMI states.
+ */
+ void PrepareCommonStateResults(
+ std::vector<am::HmiStatePtr>& result_hmi_state) {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_VRSESSION));
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MENU));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_HMI_OBSCURED));
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_ALERT));
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ }
+
+ /**
+ * @brief Prepare list of resultant HMI states for testing HMIState, for
+ * case when SDL supports attenuated mode
+ * @param result_hmi state will contain resultant HMI states.
+ */
+ void PrepareStateResultsForAttenuated(
+ std::vector<am::HmiStatePtr>& result_hmi_state) {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ }
+
+ /**
+ * @brief Prepare list of resultant HMI states for testing HMIState, for
+ * case if phone call mode is active
+ * @param result_hmi state will contain resultant HMI states.
+ */
+ void PreparePhoneCallHMIStateResults(
+ std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ switch (app_t) {
+ case APP_TYPE_NON_MEDIA: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_MEDIA: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_NAVI: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ default: { break; }
+ }
+ }
+
+ /**
+ * @brief Prepare list of resultant HMI states for testing HMIState, for
+ * case if VR or TTS mode is active
+ * @param result_hmi state will contain resultant HMI states.
+ */
+ void PrepareVRTTSHMIStateResults(
+ std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ switch (app_t) {
+ case APP_TYPE_NON_MEDIA: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_MEDIA:
+ case APP_TYPE_NAVI: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_ATTENUATED: {
+ PrepareStateResultsForAttenuated(result_hmi_state);
+ break;
+ }
+ default: { break; }
+ }
+ }
+
+ /**
+ * @brief Prepare list of resultant HMI states for testing HMIState, for
+ * case if navi streaming mode is active
+ * @param result_hmi state will contain resultant HMI states.
+ */
+ void PrepareNaviStreamingHMIStateResults(
+ std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ switch (app_t) {
+ case APP_TYPE_NON_MEDIA: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_MEDIA: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_NAVI: {
+ result_hmi_state = valid_states_for_audio_app_;
+ break;
+ }
+ default: { break; }
+ }
+ }
+
+ /**
+ * @brief Prepare list of resultant HMI states for testing HMIState, for
+ * case if navi streaming mode and TTS mode are active and SDL supports
+ * attenuated mode
+ * @param result_hmi state will contain resultant HMI states.
+ */
+ void PrepareNaviStreamTTSStateResult(
+ std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ switch (app_t) {
+ case APP_TYPE_NON_MEDIA: {
+ PrepareCommonStateResults(result_hmi_state);
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ break;
+ }
+ case APP_TYPE_MEDIA:
+ case APP_TYPE_NAVI: {
+ PrepareStateResultsForAttenuated(result_hmi_state);
+ break;
+ }
+ default: { break; }
+ }
+ }
+
+ ApplicationType AppType(uint32_t app_id) {
+ // TODO(AOleynik): Currently there is ongoing discussion regarding mixed
+ // application properties, i.e. is_media_application flag from RAI and
+ // AppHMITypes (NAVIGATION, etc.). Most likely logic should be changed
+ // after conclusion on APPLINK-20231
+ std::vector<am::ApplicationSharedPtr>::iterator app = std::find_if(
+ applications_list_.begin(),
+ applications_list_.end(),
+ [app_id](am::ApplicationSharedPtr a) { return app_id == a->app_id(); });
+
+ if (app == applications_list_.end()) {
+ return APP_TYPE_NON_MEDIA;
+ }
+
+ if ((*app)->is_navi()) {
+ return APP_TYPE_NAVI;
+ }
+ if ((*app)->is_media_application()) {
+ return APP_TYPE_MEDIA;
+ }
+ return APP_TYPE_NON_MEDIA;
+ }
+
+ void TestSetState(am::ApplicationSharedPtr app,
+ am::HmiStatePtr hmi_state,
+ ApplicationType app_t,
+ void (StateControllerImplTest::*call_back)(
+ std::vector<am::HmiStatePtr>&, ApplicationType)) {
+ InsertApplication(app);
+ std::vector<am::HmiStatePtr> result_hmi_state;
+ (this->*call_back)(result_hmi_state, app_t);
+ std::vector<am::HmiStatePtr>::iterator it_begin;
+ std::vector<am::HmiStatePtr>::iterator it_end;
+ if (APP_TYPE_NON_MEDIA == app_t) {
+ it_begin = valid_states_for_not_audio_app_.begin();
+ it_end = valid_states_for_not_audio_app_.end();
+ ASSERT_TRUE(result_hmi_state.size() ==
+ valid_states_for_not_audio_app_.size());
+ } else {
+ it_begin = valid_states_for_audio_app_.begin();
+ it_end = valid_states_for_audio_app_.end();
+ ASSERT_TRUE(result_hmi_state.size() ==
+ valid_states_for_audio_app_.size());
+ }
+ std::vector<am::HmiStatePtr>::iterator it_result_begin =
+ result_hmi_state.begin();
+ for (; it_begin != it_end; ++it_begin, ++it_result_begin) {
+ hmi_state->set_parent(*it_begin);
+ HmiStatesComparator st_comp(hmi_state);
+ ASSERT_TRUE(st_comp(*it_result_begin));
+ }
+ }
+
+ void TestSetSeveralState(
+ am::ApplicationSharedPtr app,
+ am::HmiStatePtr first_hmi_state,
+ am::HmiStatePtr second_hmi_state,
+ ApplicationType app_t,
+ void (StateControllerImplTest::*call_back)(std::vector<am::HmiStatePtr>&,
+ ApplicationType)) {
+ InsertApplication(app);
+ std::vector<am::HmiStatePtr> result_hmi_state;
+ (this->*call_back)(result_hmi_state, app_t);
+ std::vector<am::HmiStatePtr>::iterator it_begin;
+ std::vector<am::HmiStatePtr>::iterator it_end;
+ if (APP_TYPE_NON_MEDIA == app_t) {
+ it_begin = valid_states_for_not_audio_app_.begin();
+ it_end = valid_states_for_not_audio_app_.end();
+ ASSERT_TRUE(result_hmi_state.size() ==
+ valid_states_for_not_audio_app_.size());
+ } else {
+ it_begin = valid_states_for_audio_app_.begin();
+ it_end = valid_states_for_audio_app_.end();
+ ASSERT_TRUE(result_hmi_state.size() ==
+ valid_states_for_audio_app_.size());
+ }
+ std::vector<am::HmiStatePtr>::iterator it_result_begin =
+ result_hmi_state.begin();
+ for (; it_begin != it_end; ++it_begin, ++it_result_begin) {
+ first_hmi_state->set_parent(*it_begin);
+ second_hmi_state->set_parent(first_hmi_state);
+ HmiStatesComparator st_comp(second_hmi_state);
+ ASSERT_TRUE(st_comp(*it_result_begin))
+ << second_hmi_state->audio_streaming_state() << "."
+ << second_hmi_state->hmi_level() << "."
+ << second_hmi_state->system_context() << "_"
+ << (*it_result_begin)->audio_streaming_state() << "."
+ << (*it_result_begin)->hmi_level() << "."
+ << (*it_result_begin)->system_context() << "_";
+ }
+ }
+
+ template <typename T, typename Q>
+ void TestMixState(void (StateControllerImplTest::*call_back_result)(
+ std::vector<am::HmiStatePtr>&, ApplicationType)) {
+ std::vector<am::ApplicationSharedPtr>::iterator it_begin =
+ applications_list_.begin();
+ std::vector<am::ApplicationSharedPtr>::iterator it_end =
+ applications_list_.end();
+ ApplicationType app_type;
+ uint32_t app_id;
+ am::ApplicationSharedPtr app;
+ for (; it_begin != it_end; ++it_begin) {
+ app_id = (*it_begin)->app_id();
+ app_type = AppType(app_id);
+ app = (*it_begin);
+ am::HmiStatePtr state_first =
+ utils::MakeShared<T>(app_id, app_manager_mock_);
+ am::HmiStatePtr state_second =
+ utils::MakeShared<Q>(app_id, app_manager_mock_);
+ TestSetSeveralState(
+ app, state_first, state_second, app_type, call_back_result);
+ TestSetSeveralState(
+ app, state_second, state_first, app_type, call_back_result);
+ }
+ }
+
protected:
- am::ApplicationSharedPtr ConfigureApp(NiceMock<ApplicationMock>** app_mock,
- uint32_t app_id, bool media, bool navi,
- bool vc) {
- *app_mock = new NiceMock<ApplicationMock>;
+ am::ApplicationSharedPtr ConfigureApp(
+ NiceMock<application_manager_test::MockApplication>** app_mock,
+ uint32_t app_id,
+ bool media,
+ bool navi,
+ bool vc) {
+ *app_mock = new NiceMock<application_manager_test::MockApplication>;
Mock::AllowLeak(*app_mock); // WorkAround for gogletest bug
am::ApplicationSharedPtr app(*app_mock);
@@ -222,114 +600,146 @@ class StateControllerTest : public ::testing::Test {
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
// Valid states for not audio app
- message_helper_mock_ = new MessageHelperMock;
+ message_helper_mock_ =
+ application_manager::MockMessageHelper::message_helper_mock();
valid_states_for_not_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_not_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_VRSESSION));
valid_states_for_not_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_MENU));
valid_states_for_not_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
valid_states_for_not_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_ALERT));
- valid_states_for_not_audio_app_.push_back(createHmiState(
- HMILevel::HMI_BACKGROUND, AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
valid_states_for_not_audio_app_.push_back(
- createHmiState(HMILevel::HMI_FULL, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_MAIN));
// Valid states audio app
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_VRSESSION));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_MENU));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_ALERT));
- valid_states_for_audio_app_.push_back(createHmiState(
- HMILevel::HMI_BACKGROUND, AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::AUDIBLE,
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::ATTENUATED,
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::AUDIBLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_FULL, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
- createHmiState(HMILevel::HMI_FULL, AudioStreamingState::AUDIBLE,
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::AUDIBLE,
SystemContext::SYSCTXT_MAIN));
// Common Invalid States
common_invalid_states_.push_back(
- createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::INVALID_ENUM,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ common_invalid_states_.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::INVALID_ENUM,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::INVALID_ENUM,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::INVALID_ENUM));
+ common_invalid_states_.push_back(
+ createHmiState(HMILevel::INVALID_ENUM,
+ AudioStreamingState::INVALID_ENUM,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM));
- common_invalid_states_.push_back(createHmiState(
- HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::INVALID_ENUM,
+ createHmiState(HMILevel::INVALID_ENUM,
+ AudioStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM));
- common_invalid_states_.push_back(createHmiState(
- HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::INVALID_ENUM));
- common_invalid_states_.push_back(createHmiState(
- HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::INVALID_ENUM));
+
// Invalid States for audio apps
invalid_states_for_audio_app.push_back(
- createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::NOT_AUDIBLE,
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_audio_app.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::AUDIBLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
- createHmiState(HMILevel::HMI_BACKGROUND, AudioStreamingState::AUDIBLE,
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::ATTENUATED,
SystemContext::SYSCTXT_MAIN));
- invalid_states_for_audio_app.push_back(createHmiState(
- HMILevel::HMI_BACKGROUND, AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::AUDIBLE,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::AUDIBLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::ATTENUATED,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::ATTENUATED,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::ATTENUATED,
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::ATTENUATED,
SystemContext::SYSCTXT_MAIN));
// Invalid States for not audio apps
invalid_states_for_not_audio_app.push_back(
- createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::ATTENUATED,
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
- createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::AUDIBLE,
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::AUDIBLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
- createHmiState(HMILevel::HMI_FULL, AudioStreamingState::ATTENUATED,
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::ATTENUATED,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
- createHmiState(HMILevel::HMI_FULL, AudioStreamingState::AUDIBLE,
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::AUDIBLE,
SystemContext::SYSCTXT_MAIN));
// Valid state ids
@@ -341,21 +751,29 @@ class StateControllerTest : public ::testing::Test {
}
void ConfigureApps() {
- simple_app_ = ConfigureApp(&simple_app_ptr_, simple_app_id_, NOT_MEDIA,
- NOT_NAVI, NOT_VC);
+ simple_app_ = ConfigureApp(
+ &simple_app_ptr_, simple_app_id_, NOT_MEDIA, NOT_NAVI, NOT_VC);
media_app_ =
ConfigureApp(&media_app_ptr_, media_app_id_, MEDIA, NOT_NAVI, NOT_VC);
navi_app_ =
ConfigureApp(&navi_app_ptr_, navi_app_id_, NOT_MEDIA, NAVI, NOT_VC);
vc_app_ = ConfigureApp(&vc_app_ptr_, vc_app_id_, NOT_MEDIA, NOT_NAVI, VC);
- media_navi_app_ = ConfigureApp(&media_navi_app_ptr_, media_navi_app_id_,
- MEDIA, NAVI, NOT_VC);
+ media_navi_app_ = ConfigureApp(
+ &media_navi_app_ptr_, media_navi_app_id_, MEDIA, NAVI, NOT_VC);
media_vc_app_ =
ConfigureApp(&media_vc_app_ptr_, media_vc_app_id_, MEDIA, NOT_NAVI, VC);
navi_vc_app_ =
ConfigureApp(&navi_vc_app_ptr_, navi_vc_app_id_, NOT_MEDIA, NAVI, VC);
- media_navi_vc_app_ = ConfigureApp(&media_navi_vc_app_ptr_,
- media_navi_vc_app_id_, MEDIA, NAVI, VC);
+ media_navi_vc_app_ = ConfigureApp(
+ &media_navi_vc_app_ptr_, media_navi_vc_app_id_, MEDIA, NAVI, VC);
+ applications_list_.push_back(simple_app_);
+ applications_list_.push_back(media_app_);
+ applications_list_.push_back(navi_app_);
+ applications_list_.push_back(vc_app_);
+ applications_list_.push_back(media_navi_app_);
+ applications_list_.push_back(media_vc_app_);
+ applications_list_.push_back(navi_vc_app_);
+ applications_list_.push_back(media_navi_vc_app_);
}
void CheckAppConfiguration() {
ASSERT_EQ(simple_app_.get(), simple_app_ptr_);
@@ -413,20 +831,55 @@ class StateControllerTest : public ::testing::Test {
ASSERT_TRUE(media_navi_vc_app_->is_voice_communication_supported());
}
- void SetUp() {
+ virtual void SetUp() OVERRIDE {
+ ON_CALL(app_manager_mock_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ state_ctrl_ = utils::MakeShared<am::StateControllerImpl>(app_manager_mock_);
+
ON_CALL(app_manager_mock_, applications())
.WillByDefault(Return(applications_));
ConfigureApps();
CheckAppConfiguration();
FillStatesLists();
+ SetConnection();
+ }
+
+ void TearDown() OVERRIDE {
+ delete conn_handler;
}
- void TearDown() { delete message_helper_mock_; }
+ void SetConnection() {
+ conn_handler = new connection_handler::ConnectionHandlerImpl(
+ mock_connection_handler__settings, mock_transport_manager);
+ ON_CALL(app_manager_mock_, connection_handler())
+ .WillByDefault(ReturnRef(*conn_handler));
+ }
+
+ void SetBCActivateAppRequestToHMI(
+ const hmi_apis::Common_HMILevel::eType hmi_lvl, uint32_t corr_id) {
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ ON_CALL(app_manager_mock_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(app_manager_mock_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(policy_interface_));
+ smart_objects::SmartObjectSPtr bc_activate_app_request =
+ new smart_objects::SmartObject();
+ (*bc_activate_app_request)[am::strings::params]
+ [am::strings::correlation_id] = corr_id;
+ ON_CALL(*message_helper_mock_,
+ GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
+ .WillByDefault(Return(bc_activate_app_request));
+
+ ON_CALL(app_manager_mock_, ManageHMICommand(bc_activate_app_request))
+ .WillByDefault(Return(true));
+ }
- void ExpectSuccesfullSetHmiState(am::ApplicationSharedPtr app,
- NiceMock<ApplicationMock>* app_mock,
- am::HmiStatePtr old_state,
- am::HmiStatePtr new_state) {
+ void ExpectSuccesfullSetHmiState(
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>* app_mock,
+ am::HmiStatePtr old_state,
+ am::HmiStatePtr new_state) {
EXPECT_CALL(*app_mock, CurrentHmiState())
.WillOnce(Return(old_state))
.WillOnce(Return(new_state));
@@ -434,15 +887,18 @@ class StateControllerTest : public ::testing::Test {
SetRegularState(Truly(HmiStatesComparator(new_state))));
if (!HmiStatesComparator(old_state)(new_state)) {
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app));
- EXPECT_CALL(app_manager_mock_,
- OnHMILevelChanged(app->app_id(), old_state->hmi_level(),
- new_state->hmi_level()));
+ EXPECT_CALL(
+ app_manager_mock_,
+ OnHMILevelChanged(
+ app->app_id(), old_state->hmi_level(), new_state->hmi_level()));
}
}
void ExpectAppChangeHmiStateDueToConflictResolving(
- am::ApplicationSharedPtr app, NiceMock<ApplicationMock>* app_mock,
- am::HmiStatePtr old_state, am::HmiStatePtr new_state) {
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>* app_mock,
+ am::HmiStatePtr old_state,
+ am::HmiStatePtr new_state) {
EXPECT_CALL(*app_mock, RegularHmiState())
.WillOnce(Return(old_state))
.WillOnce(Return(old_state));
@@ -450,7 +906,8 @@ class StateControllerTest : public ::testing::Test {
}
void ExpectAppWontChangeHmiStateDueToConflictResolving(
- am::ApplicationSharedPtr app, NiceMock<ApplicationMock>* app_mock,
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>* app_mock,
am::HmiStatePtr state) {
EXPECT_CALL(*app_mock, RegularHmiState()).WillOnce(Return(state));
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app)).Times(0);
@@ -495,7 +952,7 @@ class StateControllerTest : public ::testing::Test {
}
void CheckStateApplyingForApplication(
- NiceMock<ApplicationMock>& application,
+ NiceMock<application_manager_test::MockApplication>& application,
std::vector<am::HmiState::StateID>& state_ids) {
using smart_objects::SmartObject;
using am::event_engine::Event;
@@ -507,39 +964,43 @@ class StateControllerTest : public ::testing::Test {
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
EXPECT_CALL(application,
- AddHMIState(Truly(HmiStatesIDComparator(state_id)))).Times(1);
+ AddHMIState(Truly(HmiStatesIDComparator(state_id)))).Times(1);
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
Event vr_start_event(FunctionID::VR_Started);
- state_ctrl_.on_event(vr_start_event);
+ state_ctrl_->on_event(vr_start_event);
break;
}
case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
Event tts_start_event(FunctionID::TTS_Started);
- state_ctrl_.on_event(tts_start_event);
+ state_ctrl_->on_event(tts_start_event);
break;
}
case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
- Event phone_call_event(
- FunctionID::BasicCommunication_OnPhoneCall);
+ Event phone_call_event(FunctionID::BasicCommunication_OnEventChanged);
SmartObject message;
- message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::is_active] =
+ true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
phone_call_event.set_smart_object(message);
- state_ctrl_.on_event(phone_call_event);
+ state_ctrl_->on_event(phone_call_event);
break;
}
case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
- Event emergency_event(
- FunctionID::BasicCommunication_OnEmergencyEvent);
+ Event emergency_event(FunctionID::BasicCommunication_OnEventChanged);
SmartObject message;
- message[am::strings::msg_params][am::hmi_response::enabled] = true;
+ message[am::strings::msg_params][am::hmi_notification::is_active] =
+ true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::EMERGENCY_EVENT;
emergency_event.set_smart_object(message);
- state_ctrl_.on_event(emergency_event);
+ state_ctrl_->on_event(emergency_event);
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_.OnNaviStreamingStarted();
+ state_ctrl_->OnNaviStreamingStarted();
break;
}
default:
@@ -553,37 +1014,45 @@ class StateControllerTest : public ::testing::Test {
am::HmiState::StateID state_id = state_ids[i];
EXPECT_CALL(application, RemoveHMIState(state_id)).Times(1);
+ EXPECT_CALL(application, PostponedHmiState())
+ .WillOnce(Return(NoneNotAudibleState()));
+ EXPECT_CALL(application, RemovePostponedState());
+
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
Event vr_stop_event(FunctionID::VR_Stopped);
- state_ctrl_.on_event(vr_stop_event);
+ state_ctrl_->on_event(vr_stop_event);
break;
}
case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
Event tts_stop_event(FunctionID::TTS_Stopped);
- state_ctrl_.on_event(tts_stop_event);
+ state_ctrl_->on_event(tts_stop_event);
break;
}
case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
- Event phone_call_event(
- FunctionID::BasicCommunication_OnPhoneCall);
+ Event phone_call_event(FunctionID::BasicCommunication_OnEventChanged);
SmartObject message;
- message[am::strings::msg_params][am::hmi_notification::is_active] = false;
+ message[am::strings::msg_params][am::hmi_notification::is_active] =
+ false;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
phone_call_event.set_smart_object(message);
- state_ctrl_.on_event(phone_call_event);
+ state_ctrl_->on_event(phone_call_event);
break;
}
case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
- Event emergency_event(
- FunctionID::BasicCommunication_OnEmergencyEvent);
+ Event emergency_event(FunctionID::BasicCommunication_OnEventChanged);
SmartObject message;
- message[am::strings::msg_params][am::hmi_response::enabled] = false;
+ message[am::strings::msg_params][am::hmi_notification::is_active] =
+ false;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::EMERGENCY_EVENT;
emergency_event.set_smart_object(message);
- state_ctrl_.on_event(emergency_event);
+ state_ctrl_->on_event(emergency_event);
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_.OnNaviStreamingStopped();
+ state_ctrl_->OnNaviStreamingStopped();
break;
}
default:
@@ -595,37 +1064,38 @@ class StateControllerTest : public ::testing::Test {
}
};
-TEST_F(StateControllerTest, OnStateChangedWithEqualStates) {
+TEST_F(StateControllerImplTest, OnStateChangedWithEqualStates) {
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
for (uint32_t i = 0; i < valid_states_for_not_audio_app_.size(); ++i) {
- state_ctrl_.OnStateChanged(simple_app_,
- valid_states_for_not_audio_app_[i],
- valid_states_for_not_audio_app_[i]);
+ state_ctrl_->OnStateChanged(simple_app_,
+ valid_states_for_not_audio_app_[i],
+ valid_states_for_not_audio_app_[i]);
}
}
-TEST_F(StateControllerTest, OnStateChangedWithDifferentStates) {
+TEST_F(StateControllerImplTest, OnStateChangedWithDifferentStates) {
for (uint32_t i = 0; i < valid_states_for_not_audio_app_.size(); ++i) {
for (uint32_t j = 0; j < valid_states_for_not_audio_app_.size(); ++j) {
HmiStatesComparator comp(valid_states_for_not_audio_app_[i]);
if (!comp(valid_states_for_not_audio_app_[j])) {
- EXPECT_CALL(app_manager_mock_,
- SendHMIStatusNotification(simple_app_)).Times(1);
- EXPECT_CALL(app_manager_mock_,
- OnHMILevelChanged(
- simple_app_id_,
- valid_states_for_not_audio_app_[i]->hmi_level(),
- valid_states_for_not_audio_app_[j]->hmi_level())).Times(1);
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
+ .Times(1);
+ EXPECT_CALL(
+ app_manager_mock_,
+ OnHMILevelChanged(simple_app_id_,
+ valid_states_for_not_audio_app_[i]->hmi_level(),
+ valid_states_for_not_audio_app_[j]->hmi_level()))
+ .Times(1);
if (mobile_apis::HMILevel::HMI_NONE ==
valid_states_for_not_audio_app_[j]->hmi_level()) {
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1);
}
- state_ctrl_.OnStateChanged(simple_app_,
- valid_states_for_not_audio_app_[i],
- valid_states_for_not_audio_app_[j]);
+ state_ctrl_->OnStateChanged(simple_app_,
+ valid_states_for_not_audio_app_[i],
+ valid_states_for_not_audio_app_[j]);
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
@@ -635,7 +1105,7 @@ TEST_F(StateControllerTest, OnStateChangedWithDifferentStates) {
}
}
-TEST_F(StateControllerTest, OnStateChangedToNone) {
+TEST_F(StateControllerImplTest, OnStateChangedToNone) {
using namespace am;
using namespace mobile_apis;
@@ -647,249 +1117,168 @@ TEST_F(StateControllerTest, OnStateChangedToNone) {
SystemContext::SYSCTXT_MAIN);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
- state_ctrl_.OnStateChanged(simple_app_, none_state, not_none_state);
+ state_ctrl_->OnStateChanged(simple_app_, none_state, not_none_state);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1);
- state_ctrl_.OnStateChanged(simple_app_, not_none_state, none_state);
+ state_ctrl_->OnStateChanged(simple_app_, not_none_state, none_state);
}
-TEST_F(StateControllerTest, MoveSimpleAppToValidStates) {
- using am::HmiState;
- using am::HmiStatePtr;
- using am::UsageStatistics;
+TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- HmiStatePtr initial_state =
- createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::INVALID_ENUM);
+ HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
+ AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
for (std::vector<HmiStatePtr>::iterator it =
valid_states_for_not_audio_app_.begin();
- it != valid_states_for_not_audio_app_.end(); ++it) {
+ it != valid_states_for_not_audio_app_.end();
+ ++it) {
HmiStatePtr state_to_setup = *it;
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
.WillOnce(Return(initial_state))
.WillOnce(Return(state_to_setup));
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_));
EXPECT_CALL(app_manager_mock_,
- OnHMILevelChanged(simple_app_id_, initial_state->hmi_level(),
+ OnHMILevelChanged(simple_app_id_,
+ initial_state->hmi_level(),
state_to_setup->hmi_level()));
EXPECT_CALL(*simple_app_ptr_,
SetRegularState(Truly(HmiStatesComparator(state_to_setup))));
- state_ctrl_.SetRegularState<false>(simple_app_, state_to_setup);
+ state_ctrl_->SetRegularState(simple_app_, state_to_setup, false);
initial_state = state_to_setup;
}
}
-TEST_F(StateControllerTest, MoveAudioAppAppToValidStates) {
- using am::HmiState;
- using am::HmiStatePtr;
- using am::UsageStatistics;
+TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
- NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* audio_app_mock =
+ media_navi_vc_app_ptr_;
- HmiStatePtr initial_state =
- createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::INVALID_ENUM);
+ HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
+ AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
for (std::vector<HmiStatePtr>::iterator it =
valid_states_for_audio_app_.begin();
- it != valid_states_for_audio_app_.end(); ++it) {
+ it != valid_states_for_audio_app_.end();
+ ++it) {
HmiStatePtr state_to_setup = *it;
EXPECT_CALL(*audio_app_mock, CurrentHmiState())
.WillOnce(Return(initial_state))
.WillOnce(Return(state_to_setup));
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(audio_app));
- EXPECT_CALL(
- app_manager_mock_,
- OnHMILevelChanged(audio_app->app_id(), initial_state->hmi_level(),
- state_to_setup->hmi_level()));
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(audio_app->app_id(),
+ initial_state->hmi_level(),
+ state_to_setup->hmi_level()));
EXPECT_CALL(*audio_app_mock,
SetRegularState(Truly(HmiStatesComparator(state_to_setup))));
- state_ctrl_.SetRegularState<false>(media_navi_vc_app_, state_to_setup);
+ state_ctrl_->SetRegularState(media_navi_vc_app_, state_to_setup, false);
initial_state = state_to_setup;
}
}
-/*
-TEST_F(StateControllerTest, MoveAppFromValidStateToInvalid) {
- using am::HmiState;
- using am::HmiStatePtr;
- using am::UsageStatistics;
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
- namespace SystemContext = mobile_apis::SystemContext;
-
- for (std::vector<HmiStatePtr>::iterator valid_state_it =
- valid_states_for_not_audio_app_.begin();
- valid_state_it != valid_states_for_not_audio_app_.end();
- ++valid_state_it) {
- for (std::vector<HmiStatePtr>::iterator invalid_state_it =
- common_invalid_states_.begin();
- invalid_state_it != common_invalid_states_.end(); ++invalid_state_it) {
- HmiStatePtr initial_state = *valid_state_it;
- HmiStatePtr invalid_state = *invalid_state_it;
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
- .WillOnce(Return(initial_state));
- EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
- state_ctrl_.SetRegularState<false>(simple_app_, invalid_state);
- }
- }
-
- NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
- am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
- for (std::vector<HmiStatePtr>::iterator valid_state_it =
- valid_states_for_audio_app_.begin();
- valid_state_it != valid_states_for_audio_app_.end(); ++valid_state_it) {
- for (std::vector<HmiStatePtr>::iterator invalid_state_it =
- invalid_states_for_audio_app.begin();
- invalid_state_it != invalid_states_for_audio_app.end();
- ++invalid_state_it) {
- HmiStatePtr initial_state = *valid_state_it;
- HmiStatePtr invalid_state = *invalid_state_it;
- EXPECT_CALL(*audio_app_mock, CurrentHmiState())
- .WillOnce(Return(initial_state));
- EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*audio_app_mock, SetRegularState(_)).Times(0);
- state_ctrl_.SetRegularState<false>(audio_app, invalid_state);
- }
- }
- for (std::vector<HmiStatePtr>::iterator valid_state_it =
- valid_states_for_not_audio_app_.begin();
- valid_state_it != valid_states_for_not_audio_app_.end();
- ++valid_state_it) {
- for (std::vector<HmiStatePtr>::iterator invalid_state_it =
- invalid_states_for_not_audio_app.begin();
- invalid_state_it != invalid_states_for_not_audio_app.end();
- ++invalid_state_it) {
- HmiStatePtr initial_state = *valid_state_it;
- HmiStatePtr invalid_state = *invalid_state_it;
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
- .WillOnce(Return(initial_state));
- EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
- state_ctrl_.SetRegularState<false>(simple_app_, invalid_state);
- }
- }
-}
-
-TEST_F(StateControllerTest, MoveAppFromInValidStateToValid) {
- using am::HmiState;
- using am::HmiStatePtr;
- using am::UsageStatistics;
+TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
- HmiStatePtr invalid_state =
- createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::INVALID_ENUM);
+ NiceMock<application_manager_test::MockApplication>* audio_app_mock =
+ media_navi_vc_app_ptr_;
+
+ HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
+ AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
+ // Set all valid states for audio app
for (std::vector<HmiStatePtr>::iterator it =
valid_states_for_audio_app_.begin();
- it != valid_states_for_audio_app_.end(); ++it) {
- HmiStatePtr initial_state = *it;
+ it != valid_states_for_audio_app_.end();
+ ++it) {
+ HmiStatePtr state_to_setup = *it;
+ HmiStatePtr state_to_check = state_to_setup;
+ // First time current state is initial, then it changes to setup state
EXPECT_CALL(*audio_app_mock, CurrentHmiState())
- .WillOnce(Return(initial_state));
- EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*audio_app_mock, SetRegularState(_)).Times(0);
- state_ctrl_.SetRegularState<false>(audio_app, invalid_state);
- }
+ .WillOnce(Return(initial_state))
+ .WillOnce(Return(state_to_setup));
+ // Audio resume app when HMI level is LIMITED or FULL gets audible state
+ if (state_to_setup->hmi_level() == HMILevel::HMI_LIMITED) {
+ EXPECT_CALL(*audio_app_mock, is_resuming()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*message_helper_mock_,
+ SendOnResumeAudioSourceToHMI(media_navi_vc_app_id_, _));
+ state_to_check->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
- for (std::vector<HmiStatePtr>::iterator it =
- valid_states_for_not_audio_app_.begin();
- it != valid_states_for_not_audio_app_.end(); ++it) {
- HmiStatePtr initial_state = *it;
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
- .WillOnce(Return(initial_state));
- EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
- state_ctrl_.SetRegularState<false>(simple_app_, invalid_state);
+ } else {
+ if (state_to_setup->hmi_level() == HMILevel::HMI_FULL) {
+ state_to_check->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
+ }
+ EXPECT_CALL(*audio_app_mock, is_resuming()).WillRepeatedly(Return(true));
+ }
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(audio_app))
+ .Times(AtLeast(0));
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(audio_app->app_id(),
+ initial_state->hmi_level(),
+ state_to_setup->hmi_level()))
+ .Times(AtLeast(0));
+
+ // Check that we set correct state
+ EXPECT_CALL(*audio_app_mock,
+ SetRegularState(Truly(HmiStatesComparator(state_to_check))));
+ state_ctrl_->SetRegularState(media_navi_vc_app_, state_to_setup, false);
+ initial_state = state_to_setup;
}
}
-TEST_F(StateControllerTest, MoveAppFromInValidStateToInvalid) {
+TEST_F(StateControllerImplTest, MoveAppFromValidStateToInvalid) {
using am::HmiState;
using am::HmiStatePtr;
- using am::UsageStatistics;
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
- namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
- am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
- HmiStatePtr initial_invalid_state =
- createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
- SystemContext::INVALID_ENUM);
-
- am::ApplicationConstSharedPtr const_audio_app(audio_app);
-
- for (std::vector<HmiStatePtr>::iterator it =
- invalid_states_for_audio_app.begin();
- it != invalid_states_for_audio_app.end(); ++it) {
- HmiStatePtr state_to_setup = *it;
- HmiStatePtr default_state =
- createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::AUDIBLE,
- SystemContext::SYSCTXT_MAIN);
- EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(const_audio_app))
- .WillOnce(Return(HMILevel::HMI_LIMITED));
- EXPECT_CALL(*audio_app_mock, CurrentHmiState())
- .WillOnce(Return(initial_invalid_state))
- .WillOnce(Return(initial_invalid_state))
- .WillOnce(Return(default_state));
- EXPECT_CALL(app_manager_mock_,
- OnHMILevelChanged(audio_app->app_id(),
- initial_invalid_state->hmi_level(),
- default_state->hmi_level()));
- EXPECT_CALL(*audio_app_mock,
- SetRegularState(Truly(HmiStatesComparator(default_state))));
- state_ctrl_.SetRegularState<false>(audio_app, state_to_setup);
+ for (std::vector<HmiStatePtr>::iterator invalid_state_it =
+ common_invalid_states_.begin();
+ invalid_state_it != common_invalid_states_.end();
+ ++invalid_state_it) {
+ HmiStatePtr invalid_state = *invalid_state_it;
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, is_resuming()).Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ state_ctrl_->SetRegularState(simple_app_, invalid_state, false);
}
- for (std::vector<HmiStatePtr>::iterator it =
- invalid_states_for_not_audio_app.begin();
- it != invalid_states_for_not_audio_app.end(); ++it) {
- HmiStatePtr state_to_setup = *it;
- HmiStatePtr default_state = createHmiState(HMILevel::HMI_BACKGROUND,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN);
- am::ApplicationConstSharedPtr const_simple_app(simple_app_);
- EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(const_simple_app))
- .WillOnce(Return(HMILevel::HMI_BACKGROUND));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
- .WillOnce(Return(initial_invalid_state))
- .WillOnce(Return(initial_invalid_state))
- .WillOnce(Return(default_state));
- EXPECT_CALL(app_manager_mock_,
- OnHMILevelChanged(simple_app_ptr_->app_id(),
- initial_invalid_state->hmi_level(),
- default_state->hmi_level()));
- EXPECT_CALL(*simple_app_ptr_,
- SetRegularState(Truly(HmiStatesComparator(default_state))));
- state_ctrl_.SetRegularState<false>(simple_app_, state_to_setup);
+ for (std::vector<HmiStatePtr>::iterator invalid_state_it =
+ common_invalid_states_.begin();
+ invalid_state_it != common_invalid_states_.end();
+ ++invalid_state_it) {
+ HmiStatePtr invalid_state = *invalid_state_it;
+ EXPECT_CALL(*media_navi_vc_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*media_navi_vc_app_ptr_, is_resuming()).Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*media_navi_vc_app_ptr_, SetRegularState(_)).Times(0);
+ state_ctrl_->SetRegularState(media_navi_vc_app_, invalid_state, false);
}
}
-*/
-TEST_F(StateControllerTest, SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
+
+TEST_F(StateControllerImplTest,
+ SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full;
- NiceMock<ApplicationMock>* app_in_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
am::ApplicationSharedPtr app_moved_to_full;
- NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
app_in_full =
ConfigureApp(&app_in_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
@@ -899,244 +1288,261 @@ TEST_F(StateControllerTest, SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) {
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullNotAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullNotAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullNotAudibleState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
}
-TEST_F(StateControllerTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
+TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = media_navi_vc_app_;
- NiceMock<ApplicationMock>* app_in_full_mock = media_navi_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_in_full_mock =
+ media_navi_vc_app_ptr_;
am::ApplicationSharedPtr app_moved_to_full = simple_app_;
- NiceMock<ApplicationMock>* app_moved_to_full_mock = simple_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock =
+ simple_app_ptr_;
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullNotAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullNotAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState(), LimitedState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileAnotherTypeAudioAppAppIsInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = media_app_;
- NiceMock<ApplicationMock>* app_in_full_mock = media_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_in_full_mock =
+ media_app_ptr_;
am::ApplicationSharedPtr app_moved_to_full = navi_app_;
- NiceMock<ApplicationMock>* app_moved_to_full_mock = navi_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock =
+ navi_app_ptr_;
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState(), LimitedState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* app_in_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
am::ApplicationSharedPtr app_in_full =
ConfigureApp(&app_in_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
- NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
ConfigureApp(&app_moved_to_full_mock, 1796, MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* app_in_limited_mock;
+ NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NAVI, NOT_VC);
- NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NAVI, VC);
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* app_in_limited_mock;
+ NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NOT_NAVI, VC);
- NiceMock<ApplicationMock>* app_moved_to_limited_mock;
+ NiceMock<application_manager_test::MockApplication>*
+ app_moved_to_limited_mock;
am::ApplicationSharedPtr app_moved_to_limited =
ConfigureApp(&app_moved_to_limited_mock, 1796, NOT_MEDIA, NOT_NAVI, VC);
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_limited);
- ExpectSuccesfullSetHmiState(app_moved_to_limited, app_moved_to_limited_mock,
- BackgroundState(), LimitedState());
+ ExpectSuccesfullSetHmiState(app_moved_to_limited,
+ app_moved_to_limited_mock,
+ BackgroundState(),
+ LimitedState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(app_moved_to_limited, LimitedState());
+ state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInLimited) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_limited = navi_app_;
- NiceMock<ApplicationMock>* app_in_limited_mock = navi_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_in_limited_mock =
+ navi_app_ptr_;
am::ApplicationSharedPtr app_moved_to_limited = vc_app_;
- NiceMock<ApplicationMock>* app_moved_to_limited_mock = vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>*
+ app_moved_to_limited_mock = vc_app_ptr_;
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_limited);
- ExpectSuccesfullSetHmiState(app_moved_to_limited, app_moved_to_limited_mock,
- BackgroundState(), LimitedState());
+ ExpectSuccesfullSetHmiState(app_moved_to_limited,
+ app_moved_to_limited_mock,
+ BackgroundState(),
+ LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState());
- state_ctrl_.SetRegularState<false>(app_moved_to_limited, LimitedState());
+ state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = navi_app_;
- NiceMock<ApplicationMock>* app_in_full_mock = navi_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_in_full_mock =
+ navi_app_ptr_;
am::ApplicationSharedPtr app_moved_to_limited = vc_app_;
- NiceMock<ApplicationMock>* app_moved_to_limited_mock = vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>*
+ app_moved_to_limited_mock = vc_app_ptr_;
InsertApplication(app_in_full);
InsertApplication(app_moved_to_limited);
- ExpectSuccesfullSetHmiState(app_moved_to_limited, app_moved_to_limited_mock,
- BackgroundState(), LimitedState());
+ ExpectSuccesfullSetHmiState(app_moved_to_limited,
+ app_moved_to_limited_mock,
+ BackgroundState(),
+ LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState());
- state_ctrl_.SetRegularState<false>(app_moved_to_limited, LimitedState());
+ state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
}
-TEST_F(StateControllerTest, SetFullToSimpleAppWhile2AudioAppsInLimited) {
- using am::HmiState;
- using am::HmiStatePtr;
+TEST_F(StateControllerImplTest, SetFullToSimpleAppWhile2AudioAppsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_moved_to_full = simple_app_;
- NiceMock<ApplicationMock>* app_moved_to_full_mock = simple_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock =
+ simple_app_ptr_;
am::ApplicationSharedPtr limited_app1 = media_app_;
- NiceMock<ApplicationMock>* limited_app1_mock = media_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* limited_app1_mock =
+ media_app_ptr_;
am::ApplicationSharedPtr limited_app2 = navi_vc_app_;
- NiceMock<ApplicationMock>* limited_app2_mock = navi_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* limited_app2_mock =
+ navi_vc_app_ptr_;
InsertApplication(app_moved_to_full);
InsertApplication(limited_app1);
InsertApplication(limited_app2);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullNotAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullNotAudibleState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
limited_app1, limited_app1_mock, LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
limited_app2, limited_app2_mock, LimitedState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToSimpleAppWhile1AudioAppInLimitedAnd1AudioAppInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_moved_to_full = simple_app_;
- NiceMock<ApplicationMock>* app_moved_to_full_mock = simple_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock =
+ simple_app_ptr_;
am::ApplicationSharedPtr limited_app = media_app_;
- NiceMock<ApplicationMock>* limited_app_mock = media_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* limited_app_mock =
+ media_app_ptr_;
am::ApplicationSharedPtr full_app = navi_vc_app_;
- NiceMock<ApplicationMock>* full_app_mock = navi_vc_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* full_app_mock =
+ navi_vc_app_ptr_;
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullNotAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullNotAudibleState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
limited_app, limited_app_mock, LimitedState());
@@ -1144,25 +1550,24 @@ TEST_F(StateControllerTest,
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullAudibleState(), LimitedState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToSimpleAppWhile1AudioAppInLimitedAnd1SimpleAppInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
ConfigureApp(&app_moved_to_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
am::ApplicationSharedPtr limited_app = media_app_;
- NiceMock<ApplicationMock>* limited_app_mock = media_app_ptr_;
+ NiceMock<application_manager_test::MockApplication>* limited_app_mock =
+ media_app_ptr_;
- NiceMock<ApplicationMock>* full_app_mock;
+ NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
@@ -1170,8 +1575,10 @@ TEST_F(StateControllerTest,
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullNotAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullNotAudibleState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
limited_app, limited_app_mock, LimitedState());
@@ -1179,27 +1586,25 @@ TEST_F(StateControllerTest,
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullNotAudibleState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
}
TEST_F(
- StateControllerTest,
+ StateControllerImplTest,
SetFullToAudioAppWhile1AudioAppWithSameTypeInLimitedAnd1SimpleAppInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
- NiceMock<ApplicationMock>* limited_app_mock;
+ NiceMock<application_manager_test::MockApplication>* limited_app_mock;
am::ApplicationSharedPtr limited_app =
ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
- NiceMock<ApplicationMock>* full_app_mock;
+ NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
@@ -1207,8 +1612,10 @@ TEST_F(
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
limited_app, limited_app_mock, LimitedState(), BackgroundState());
@@ -1216,27 +1623,25 @@ TEST_F(
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullNotAudibleState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
}
TEST_F(
- StateControllerTest,
+ StateControllerImplTest,
SetFullToAudioAppWhileAudioAppWithSameTypeInLimitedAndAudioAppWithOtherTypeInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
- NiceMock<ApplicationMock>* limited_app_mock;
+ NiceMock<application_manager_test::MockApplication>* limited_app_mock;
am::ApplicationSharedPtr limited_app =
ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
- NiceMock<ApplicationMock>* full_app_mock;
+ NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NAVI, NOT_VC);
@@ -1244,8 +1649,10 @@ TEST_F(
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(app_moved_to_full,
+ app_moved_to_full_mock,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
limited_app, limited_app_mock, LimitedState(), BackgroundState());
@@ -1253,13 +1660,11 @@ TEST_F(
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullAudibleState(), LimitedState());
- state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+ state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToAudioAppWhile3AudioAppsWithSameTypeInLimited) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
@@ -1268,21 +1673,21 @@ TEST_F(StateControllerTest,
InsertApplication(media_app_);
InsertApplication(navi_app_);
InsertApplication(vc_app_);
- ExpectSuccesfullSetHmiState(media_navi_vc_app_, media_navi_vc_app_ptr_,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(media_navi_vc_app_,
+ media_navi_vc_app_ptr_,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
media_app_, media_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
vc_app_, vc_app_ptr_, LimitedState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(media_navi_vc_app_, FullAudibleState());
+ state_ctrl_->SetRegularState(media_navi_vc_app_, FullAudibleState(), false);
}
-TEST_F(StateControllerTest,
+TEST_F(StateControllerImplTest,
SetFullToAudioAppWhile2AudioAppsWithSameTypeInLimitedAndOneInFull) {
- using am::HmiState;
- using am::HmiStatePtr;
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
@@ -1291,18 +1696,21 @@ TEST_F(StateControllerTest,
InsertApplication(media_app_);
InsertApplication(navi_app_);
InsertApplication(vc_app_);
- ExpectSuccesfullSetHmiState(media_navi_vc_app_, media_navi_vc_app_ptr_,
- BackgroundState(), FullAudibleState());
+ ExpectSuccesfullSetHmiState(media_navi_vc_app_,
+ media_navi_vc_app_ptr_,
+ BackgroundState(),
+ FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
media_app_, media_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
vc_app_, vc_app_ptr_, FullAudibleState(), BackgroundState());
- state_ctrl_.SetRegularState<false>(media_navi_vc_app_, FullAudibleState());
+ state_ctrl_->SetRegularState(media_navi_vc_app_, FullAudibleState(), false);
}
-TEST_F(StateControllerTest, ActivateAppSuccessReceivedFromHMI) {
+// TODO {AKozoriz} Changed logic in state_controller
+TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
using namespace hmi_apis;
using namespace mobile_apis;
@@ -1318,45 +1726,48 @@ TEST_F(StateControllerTest, ActivateAppSuccessReceivedFromHMI) {
StateLevelPair(LimitedState(), Common_HMILevel::LIMITED));
hmi_states.push_back(
StateLevelPair(BackgroundState(), Common_HMILevel::BACKGROUND));
- hmi_states.push_back(StateLevelPair(
- createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN),
- Common_HMILevel::NONE));
+ hmi_states.push_back(
+ StateLevelPair(createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN),
+ Common_HMILevel::NONE));
std::vector<StateLevelPair> initial_hmi_states = hmi_states;
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
+ smart_objects::SmartObjectSPtr bc_activate_app_request =
+ new smart_objects::SmartObject();
+ (*bc_activate_app_request)[am::strings::params][am::strings::correlation_id] =
+ corr_id;
+
for (; it != hmi_states.end(); ++it) {
- for (; it2 != initial_hmi_states.end(); ++it2) {
- am::HmiStatePtr hmi_state = it->first;
- am::HmiStatePtr initial_hmi_state = it->first;
- Common_HMILevel::eType hmi_level = it->second;
+ am::HmiStatePtr hmi_state = it->first;
+ am::HmiStatePtr initial_hmi_state = it->first;
+ Common_HMILevel::eType hmi_level = it->second;
- EXPECT_CALL(*message_helper_mock_,
- SendActivateAppToHMI(media_app_->app_id(), hmi_level, _))
- .WillOnce(Return(corr_id));
- EXPECT_CALL(app_manager_mock_, application_id(corr_id))
- .WillOnce(Return(hmi_app_id));
- EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
- .WillOnce(Return(media_app_));
- ExpectSuccesfullSetHmiState(media_app_, media_app_ptr_, initial_hmi_state,
- hmi_state);
- state_ctrl_.SetRegularState<true>(media_app_, hmi_state);
- smart_objects::SmartObject message;
- message[am::strings::params][am::hmi_response::code] =
- Common_Result::SUCCESS;
- message[am::strings::params][am::strings::correlation_id] = corr_id;
- am::event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_ActivateApp);
- event.set_smart_object(message);
- state_ctrl_.on_event(event);
- }
+ SetBCActivateAppRequestToHMI(hmi_level, corr_id);
+ ON_CALL(app_manager_mock_, ManageHMICommand(bc_activate_app_request))
+ .WillByDefault(Return(true));
+
+ EXPECT_CALL(app_manager_mock_, application_id(corr_id))
+ .WillOnce(Return(hmi_app_id));
+ EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
+ .WillOnce(Return(media_app_));
+ ExpectSuccesfullSetHmiState(
+ media_app_, media_app_ptr_, initial_hmi_state, hmi_state);
+ state_ctrl_->SetRegularState(media_app_, hmi_state, true);
+ smart_objects::SmartObject message;
+ message[am::strings::params][am::hmi_response::code] =
+ Common_Result::SUCCESS;
+ message[am::strings::params][am::strings::correlation_id] = corr_id;
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
}
}
-/*
-TEST_F(StateControllerTest, ActivateAppErrorReceivedFromHMI) {
+
+std::vector<hmi_apis::Common_Result::eType> hmi_result() {
using namespace hmi_apis;
- const uint32_t corr_id = 314;
- const uint32_t hmi_app_id = 2718;
std::vector<Common_Result::eType> hmi_results;
hmi_results.push_back(Common_Result::ABORTED);
hmi_results.push_back(Common_Result::APPLICATION_NOT_REGISTERED);
@@ -1383,45 +1794,45 @@ TEST_F(StateControllerTest, ActivateAppErrorReceivedFromHMI) {
hmi_results.push_back(Common_Result::USER_DISALLOWED);
hmi_results.push_back(Common_Result::WARNINGS);
hmi_results.push_back(Common_Result::WRONG_LANGUAGE);
+ return hmi_results;
+}
+
+TEST_F(StateControllerImplTest, SendEventBCActivateApp_HMIReceivesError) {
+ using namespace hmi_apis;
+ const uint32_t corr_id = 314;
+ const uint32_t hmi_app_id = 2718;
+ std::vector<Common_Result::eType> hmi_results = hmi_result();
std::vector<Common_Result::eType>::iterator it = hmi_results.begin();
for (; it != hmi_results.end(); ++it) {
- EXPECT_CALL(
- *message_helper_mock_,
- SendActivateAppToHMI(simple_app_->app_id(), Common_HMILevel::FULL, _))
- .WillOnce(Return(corr_id));
EXPECT_CALL(app_manager_mock_, application_id(corr_id))
.WillOnce(Return(hmi_app_id));
EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
.WillOnce(Return(simple_app_));
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
- .WillOnce(Return(BackgroundState()));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
- .WillOnce(Return(BackgroundState()))
- .WillOnce(Return(BackgroundState()));
- EXPECT_CALL(*simple_app_ptr_,
- SetRegularState(Truly(HmiStatesComparator(BackgroundState()))));
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
.Times(0);
EXPECT_CALL(app_manager_mock_,
OnHMILevelChanged(simple_app_->app_id(), _, _)).Times(0);
- state_ctrl_.SetRegularState<true>(simple_app_, FullNotAudibleState());
+
smart_objects::SmartObject message;
message[am::strings::params][am::hmi_response::code] = *it;
message[am::strings::params][am::strings::correlation_id] = corr_id;
am::event_engine::Event event(FunctionID::BasicCommunication_ActivateApp);
event.set_smart_object(message);
- state_ctrl_.on_event(event);
+ state_ctrl_->on_event(event);
}
}
-*/
-TEST_F(StateControllerTest, ActivateAppInvalidCorrelationId) {
+
+TEST_F(StateControllerImplTest, ActivateAppInvalidCorrelationId) {
using namespace hmi_apis;
const uint32_t corr_id = 314;
const uint32_t hmi_app_id = 2718;
- EXPECT_CALL(*message_helper_mock_,
- SendActivateAppToHMI(simple_app_->app_id(), Common_HMILevel::FULL,
- _)).WillOnce(Return(hmi_app_id));
+
EXPECT_CALL(app_manager_mock_, application_id(corr_id))
.WillOnce(Return(hmi_app_id));
EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
@@ -1431,53 +1842,642 @@ TEST_F(StateControllerTest, ActivateAppInvalidCorrelationId) {
.Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(simple_app_->app_id(), _, _))
.Times(0);
- state_ctrl_.SetRegularState<true>(simple_app_, FullNotAudibleState());
+ SetBCActivateAppRequestToHMI(Common_HMILevel::FULL, corr_id);
+ state_ctrl_->SetRegularState(simple_app_, FullNotAudibleState(), true);
smart_objects::SmartObject message;
message[am::strings::params][am::hmi_response::code] = Common_Result::SUCCESS;
message[am::strings::params][am::strings::correlation_id] = corr_id;
am::event_engine::Event event(FunctionID::BasicCommunication_ActivateApp);
event.set_smart_object(message);
- state_ctrl_.on_event(event);
+ state_ctrl_->on_event(event);
}
-/*
-TEST_F(StateControllerTest, ApplyTempStatesForSimpleApp) {
+
+TEST_F(StateControllerImplTest, ApplyTempStatesForSimpleApp) {
InsertApplication(simple_app_);
CheckStateApplyingForApplication(*simple_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForMediaApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForMediaApp) {
InsertApplication(media_app_);
CheckStateApplyingForApplication(*media_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForNaviApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForNaviApp) {
InsertApplication(navi_app_);
CheckStateApplyingForApplication(*navi_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForVCApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForVCApp) {
InsertApplication(vc_app_);
CheckStateApplyingForApplication(*vc_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForMediaNaviApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviApp) {
InsertApplication(media_navi_app_);
CheckStateApplyingForApplication(*media_navi_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForMediaVCApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForMediaVCApp) {
InsertApplication(media_vc_app_);
CheckStateApplyingForApplication(*media_vc_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForNaviVCApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForNaviVCApp) {
InsertApplication(navi_vc_app_);
CheckStateApplyingForApplication(*navi_vc_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerTest, ApplyTempStatesForMediaNaviVCApp) {
+TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviVCApp) {
InsertApplication(media_navi_vc_app_);
CheckStateApplyingForApplication(*media_navi_vc_app_ptr_, valid_state_ids_);
}
-*/
+
+TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
+ am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
+ simple_app_id_, app_manager_mock_);
+ TestSetState(simple_app_,
+ state_phone_call,
+ APP_TYPE_NON_MEDIA,
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
+ am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
+ media_app_id_, app_manager_mock_);
+ TestSetState(media_app_,
+ state_phone_call,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
+ am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
+ media_navi_app_id_, app_manager_mock_);
+ TestSetState(media_navi_app_,
+ state_phone_call,
+ APP_TYPE_NAVI,
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
+ am::HmiStatePtr state_vr =
+ utils::MakeShared<am::VRHmiState>(simple_app_id_, app_manager_mock_);
+ TestSetState(simple_app_,
+ state_vr,
+ APP_TYPE_NON_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
+ am::HmiStatePtr state_vr =
+ utils::MakeShared<am::VRHmiState>(media_app_id_, app_manager_mock_);
+ TestSetState(media_app_,
+ state_vr,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
+ am::HmiStatePtr state_vr = utils::MakeShared<am::VRHmiState>(
+ media_navi_vc_app_id_, app_manager_mock_);
+ TestSetState(media_navi_vc_app_,
+ state_vr,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetTTSStateForNonMediaApplicationAttenuatedNotSupported) {
+ am::HmiStatePtr state_tts =
+ utils::MakeShared<am::TTSHmiState>(simple_app_id_, app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+ TestSetState(simple_app_,
+ state_tts,
+ APP_TYPE_NON_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetTTSStateForNonMediaApplicationAttenuatedSupported) {
+ am::HmiStatePtr state_tts =
+ utils::MakeShared<am::TTSHmiState>(simple_app_id_, app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+ TestSetState(simple_app_,
+ state_tts,
+ APP_TYPE_NON_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetTTSStateForMediaApplicationAttenuatedNotSupported) {
+ am::HmiStatePtr state_tts =
+ utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+ TestSetState(media_app_,
+ state_tts,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetTTSStateForMediaApplicationAttenuatedSupported) {
+ am::HmiStatePtr state_tts =
+ utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+ TestSetState(media_app_,
+ state_tts,
+ APP_TYPE_ATTENUATED,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetTTSStateForMediaNaviVCApplicationAttenuatedNotSupported) {
+ am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(
+ media_navi_vc_app_id_, app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+ TestSetState(media_navi_vc_app_,
+ state_tts,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetTTSStateForMediaNaviVCApplicationAttenuatedSupported) {
+ am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(
+ media_navi_vc_app_id_, app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+ TestSetState(media_navi_vc_app_,
+ state_tts,
+ APP_TYPE_ATTENUATED,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(simple_app_id_,
+ app_manager_mock_);
+ TestSetState(simple_app_,
+ state_navi_streming,
+ APP_TYPE_NON_MEDIA,
+ &StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(media_app_id_,
+ app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+ TestSetState(media_app_,
+ state_navi_streming,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(media_app_id_,
+ app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+ TestSetState(media_app_,
+ state_navi_streming,
+ APP_TYPE_ATTENUATED,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(vc_app_id_,
+ app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+ TestSetState(vc_app_,
+ state_navi_streming,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetNaviStreamingStateVCApplicationAttenuatedSupported) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(vc_app_id_,
+ app_manager_mock_);
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+ TestSetState(vc_app_,
+ state_navi_streming,
+ APP_TYPE_ATTENUATED,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(navi_app_id_,
+ app_manager_mock_);
+ TestSetState(navi_app_,
+ state_navi_streming,
+ APP_TYPE_NAVI,
+ &StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
+ am::HmiStatePtr state_navi_streming =
+ utils::MakeShared<am::NaviStreamingHmiState>(media_navi_app_id_,
+ app_manager_mock_);
+ TestSetState(media_navi_app_,
+ state_navi_streming,
+ APP_TYPE_NAVI,
+ &StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
+ am::HmiStatePtr state_safety_mode = utils::MakeShared<am::SafetyModeHmiState>(
+ simple_app_id_, app_manager_mock_);
+ TestSetState(simple_app_,
+ state_safety_mode,
+ APP_TYPE_NON_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
+ am::HmiStatePtr state_safety_mode =
+ utils::MakeShared<am::VRHmiState>(media_app_id_, app_manager_mock_);
+ TestSetState(media_app_,
+ state_safety_mode,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ SetSafetyModeStateForMediaNaviVoiceApplication) {
+ am::HmiStatePtr state_safety_mode = utils::MakeShared<am::VRHmiState>(
+ media_navi_vc_app_id_, app_manager_mock_);
+ TestSetState(media_navi_vc_app_,
+ state_safety_mode,
+ APP_TYPE_MEDIA,
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixVRWithPhoneCall) {
+ TestMixState<am::PhoneCallHmiState, am::VRHmiState>(
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixTTSWithPhoneCallAttenuatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::PhoneCallHmiState, am::TTSHmiState>(
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixTTSWithPhoneCallAttenuatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::PhoneCallHmiState, am::TTSHmiState>(
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ MixNaviStreamingWithPhoneCallAttenuatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::PhoneCallHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ MixNaviStreamingWithPhoneCallAttenuatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::PhoneCallHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixSafetyModeWithPhoneCall) {
+ TestMixState<am::PhoneCallHmiState, am::SafetyModeHmiState>(
+ &StateControllerImplTest::PreparePhoneCallHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixTTSWithVRAttenuatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::VRHmiState, am::TTSHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixTTSWithVRAttenuatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::VRHmiState, am::TTSHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixNaviStreamingWithVRAttenuatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::VRHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixNaviStreamingWithVRAttenuatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::VRHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixSafetyModeStreamingWithVR) {
+ TestMixState<am::VRHmiState, am::SafetyModeHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ MixNaviStreamingWithTTSAttenueatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::TTSHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixNaviStreamingWithTTSAttenueatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::TTSHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PrepareNaviStreamTTSStateResult);
+}
+
+TEST_F(StateControllerImplTest, MixSafetyModeWithTTSAttenueatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::TTSHmiState, am::SafetyModeHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, MixSafetyModeWithTTSAttenueatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::TTSHmiState, am::SafetyModeHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ MixSafetyModeWithNaviStreamingAttenueatedNotSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(false));
+
+ TestMixState<am::SafetyModeHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest,
+ MixSafetyModeWithNaviStreamingAttenueatedSupported) {
+ EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
+ .WillRepeatedly(Return(true));
+
+ TestMixState<am::SafetyModeHmiState, am::NaviStreamingHmiState>(
+ &StateControllerImplTest::PrepareVRTTSHMIStateResults);
+}
+
+TEST_F(StateControllerImplTest, SetRegularStateWithNewHmiLvl) {
+ using namespace mobile_apis;
+
+ HMILevel::eType set_lvl = HMILevel::HMI_NONE;
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillOnce(Return(BackgroundState()));
+
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(BackgroundState()))
+ .WillOnce(Return(BackgroundState()));
+
+ state_ctrl_->SetRegularState(simple_app_, set_lvl);
+
+ set_lvl = HMILevel::HMI_LIMITED;
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillOnce(Return(BackgroundState()));
+
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(BackgroundState()))
+ .WillOnce(Return(BackgroundState()));
+ state_ctrl_->SetRegularState(simple_app_, set_lvl);
+
+ set_lvl = HMILevel::HMI_FULL;
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillOnce(Return(BackgroundState()));
+
+ const uint32_t corr_id = 314;
+ SetBCActivateAppRequestToHMI(
+ static_cast<hmi_apis::Common_HMILevel::eType>(set_lvl), corr_id);
+
+ state_ctrl_->SetRegularState(simple_app_, set_lvl);
+
+ set_lvl = HMILevel::HMI_BACKGROUND;
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillOnce(Return(BackgroundState()));
+
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(BackgroundState()))
+ .WillOnce(Return(BackgroundState()));
+
+ state_ctrl_->SetRegularState(simple_app_, set_lvl);
+}
+
+TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
+ using namespace mobile_apis;
+
+ HmiStatePtr check_state = createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillRepeatedly(Return(BackgroundState()));
+
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(check_state))
+ .WillOnce(Return(check_state));
+ EXPECT_CALL(*simple_app_ptr_,
+ SetRegularState(Truly(HmiStatesComparator(check_state))));
+
+ state_ctrl_->SetRegularState(simple_app_, AudioStreamingState::AUDIBLE);
+}
+
+TEST_F(StateControllerImplTest,
+ SetRegularStateToMediaAndNonMediaApps_VRStarted_SetPostponedState) {
+ using namespace mobile_apis;
+
+ // Precondition
+ am::event_engine::Event event(hmi_apis::FunctionID::VR_Started);
+ state_ctrl_->on_event(event);
+
+ HmiStatePtr check_state = FullNotAudibleState();
+
+ // Non-media app can't have LIMITED-AUDIO state
+ EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+ EXPECT_CALL(*simple_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(simple_app_, check_state, false);
+
+ check_state = LimitedState();
+ EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*media_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*media_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*media_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(media_app_, check_state, false);
+}
+
+TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
+ using namespace mobile_apis;
+
+ // Precondition
+ am::event_engine::Event prev_event(hmi_apis::FunctionID::VR_Started);
+ state_ctrl_->on_event(prev_event);
+
+ am::event_engine::Event next_event(hmi_apis::FunctionID::VR_Stopped);
+ state_ctrl_->on_event(next_event);
+
+ // Set state of non-media app after vr has stopped
+ HmiStatePtr check_state = FullNotAudibleState();
+
+ // Non-media app can't have LIMITED-AUDIO state
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(check_state))
+ .WillOnce(Return(check_state));
+
+ EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*message_helper_mock_,
+ SendOnResumeAudioSourceToHMI(simple_app_id_, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))))
+ .Times(0);
+ EXPECT_CALL(*simple_app_ptr_,
+ SetRegularState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(simple_app_, check_state, false);
+
+ // Set state of media app after vr has stopped
+ check_state = LimitedState();
+
+ EXPECT_CALL(*media_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(check_state))
+ .WillOnce(Return(check_state));
+
+ EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*message_helper_mock_,
+ SendOnResumeAudioSourceToHMI(media_app_id_, _));
+ EXPECT_CALL(*media_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))))
+ .Times(0);
+ EXPECT_CALL(*media_app_ptr_,
+ SetRegularState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(media_app_, check_state, false);
+}
+
+TEST_F(StateControllerImplTest,
+ SetRegStateForMediaAndNonMediaApps_OnEmergencyEvent_SetPostponedState) {
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ using namespace am::event_engine;
+
+ // Precondition
+ Event event(FunctionID::BasicCommunication_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ Common_EventTypes::EMERGENCY_EVENT;
+
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
+
+ // Non-media app can't have LIMITED-AUDIO state
+ HmiStatePtr check_state = FullNotAudibleState();
+ EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+ EXPECT_CALL(*simple_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(simple_app_, check_state, false);
+
+ // Set media app
+ check_state = LimitedState();
+ EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState()).Times(0);
+ EXPECT_CALL(*media_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*media_app_ptr_, SetRegularState(_)).Times(0);
+
+ EXPECT_CALL(*media_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(media_app_, check_state, false);
+}
+
+TEST_F(StateControllerImplTest,
+ SetStateForMediaApp_BCOnPhoneCall_SetPostponedState) {
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ using namespace am::event_engine;
+
+ // Precondition
+ Event event(FunctionID::BasicCommunication_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
+
+ am::HmiStatePtr check_state = FullAudibleState();
+
+ EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*media_app_ptr_, is_media_application())
+ .WillRepeatedly(Return(true));
+
+ EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+
+ EXPECT_CALL(*media_app_ptr_,
+ SetPostponedState(Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(media_app_, check_state, false);
+}
+
} // namespace state_controller_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
new file mode 100644
index 0000000000..b5d1da0992
--- /dev/null
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/usage_statistics.h"
+#include <memory>
+#include "gmock/gmock.h"
+#include "smart_objects/enum_schema_item.h"
+#include "policy/mock_statistics_manager.h"
+#include "mock_app_stopwatch.h"
+#include "utils/make_shared.h"
+#include "utils/shared_ptr.h"
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+using namespace mobile_apis; // For Language enums
+using namespace NsSmartDeviceLink::NsSmartObjects; // For EnumToCString &
+ // EnumConversionHelper
+using namespace usage_statistics;
+using testing::_;
+
+namespace {
+
+std::string LanguageIdToString(Language::eType lang_id) {
+ const char* str;
+ const bool ok =
+ EnumConversionHelper<Language::eType>::EnumToCString(lang_id, &str);
+ return ok ? str : "unknown";
+}
+
+// Constant values used in tests
+const Language::eType kTestLanguageId = Language::eType::DE_DE;
+const usage_statistics::AppStopwatchId kTestAppStopwatchId =
+ usage_statistics::AppStopwatchId::SECONDS_HMI_NONE;
+const std::string kAppId = "SPT";
+
+} // namespace
+
+class UsageStatisticsTest : public testing::Test {
+ public:
+ UsageStatisticsTest()
+ : mock_statistics_manager_sptr_(
+ utils::MakeShared<MockStatisticsManager>())
+ , usage_statistics_test_object1_sptr_(
+ new application_manager::UsageStatistics(
+ kAppId, mock_statistics_manager_sptr_))
+ , language_(LanguageIdToString(kTestLanguageId)) {}
+
+ protected:
+ utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_;
+ std::auto_ptr<application_manager::UsageStatistics>
+ usage_statistics_test_object1_sptr_;
+ const std::string language_;
+};
+
+TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
+ // Arrange
+ std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object(
+ new MockAppStopwatch);
+
+ // Checks
+ EXPECT_CALL(*mock_app_stopwatch_object, Start(kTestAppStopwatchId));
+ EXPECT_CALL(*mock_app_stopwatch_object, Switch(kTestAppStopwatchId));
+
+ // Act
+ std::auto_ptr<application_manager::UsageStatistics>
+ usage_statistics_test_object2_sptr_(
+ new application_manager::UsageStatistics(
+ kAppId,
+ mock_statistics_manager_sptr_,
+ mock_app_stopwatch_object.release()));
+ usage_statistics_test_object2_sptr_->RecordHmiStateChanged(
+ HMILevel::eType::HMI_NONE);
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordAppRegistrationGuiLanguage_CallMethod_ExpectSetMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Set(kAppId, _, language_));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordAppRegistrationGuiLanguage(
+ kTestLanguageId);
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordAppRegistrationVuiLanguage_CallMethod_ExpectSetMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Set(kAppId, _, language_));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordAppRegistrationVuiLanguage(
+ kTestLanguageId);
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordRpcSentInHMINone_CallMethod_ExpectIncrementMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Increment(kAppId, _));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordRpcSentInHMINone();
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordPolicyRejectedRpcCall_CallMethod_ExpectIncrementMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Increment(kAppId, _));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordPolicyRejectedRpcCall();
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordAppUserSelection_CallMethod_ExpectIncrementMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Increment(kAppId, _));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordAppUserSelection();
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordRunAttemptsWhileRevoked_CallMethod_ExpectIncrementMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Increment(kAppId, _));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordRunAttemptsWhileRevoked();
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordRemovalsForBadBehavior_CallMethod_ExpectIncrementMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Increment(kAppId, _));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordRemovalsForBadBehavior();
+}
+
+TEST_F(UsageStatisticsTest,
+ RecordTLSError_CallMethod_ExpectIncrementMethodCall) {
+ // Expectation
+ EXPECT_CALL(*mock_statistics_manager_sptr_, Increment(kAppId, _));
+ // Act
+ usage_statistics_test_object1_sptr_->RecordTLSError();
+}
+
+} // namespace usage_statistics_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc
new file mode 100644
index 0000000000..0f52639575
--- /dev/null
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <algorithm>
+#include "gtest/gtest.h"
+
+#include "application_manager/request_controller.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/commands/mobile/put_file_request.h"
+#include "application_manager/commands/mobile/register_app_interface_request.h"
+#include "application_manager/commands/mobile/unregister_app_interface_request.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace application {
+using namespace ::profile;
+
+using namespace application_manager::request_controller;
+using namespace application_manager;
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+commands::Command* RegisterApplication() {
+ SmartObjectSPtr resultsmart =
+ application_manager::MessageHelper::CreateModuleInfoSO(1);
+ SmartObject& test_message = *resultsmart;
+ uint32_t connection_key = 0;
+ test_message[strings::params][strings::connection_key] = connection_key;
+ test_message[strings::msg_params][strings::language_desired] = 0;
+ test_message[strings::msg_params][strings::hmi_display_language_desired] = 0;
+ commands::Command* testregCommand =
+ new commands::RegisterAppInterfaceRequest(resultsmart);
+ return testregCommand;
+}
+
+commands::Command* UnregisterApplication() {
+ SmartObjectSPtr resultsmart =
+ application_manager::MessageHelper::CreateModuleInfoSO(2);
+ commands::Command* testregCommand =
+ new commands::UnregisterAppInterfaceRequest(resultsmart);
+ return testregCommand;
+}
+
+commands::Command* PutFileCommand(uint32_t& correlation_id,
+ uint32_t& connection_key) {
+ SmartObjectSPtr resultsmart =
+ application_manager::MessageHelper::CreateModuleInfoSO(32);
+ SmartObject& test_message = *resultsmart;
+ test_message[strings::params][strings::correlation_id] = correlation_id;
+ test_message[strings::params][strings::connection_key] = connection_key;
+ test_message[strings::msg_params][strings::sync_file_name] = "file.png";
+ test_message[strings::msg_params][strings::file_type] =
+ mobile_apis::FileType::GRAPHIC_PNG;
+
+ commands::Command* testCommand = new commands::PutFileRequest(resultsmart);
+ return testCommand;
+}
+
+TEST(RequestControlTest, ZeroValuePendingRequestsAmount) {
+ // Default value
+ const uint32_t big_count_of_requests_for_test_ =
+ 10; // bigger than pending_requests_amount
+ uint32_t correlation_id = 0;
+ uint32_t connection_key = 0;
+ RequestController::TResult result;
+ RequestController request_ctrl_;
+
+ commands::Command* reg = RegisterApplication();
+ request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
+
+ for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
+ correlation_id = i;
+ commands::Command* testCommand =
+ PutFileCommand(correlation_id, connection_key);
+ result = request_ctrl_.addMobileRequest(testCommand,
+ mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_EQ(RequestController::SUCCESS, result);
+ }
+
+ commands::Command* unreg = UnregisterApplication();
+ request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
+}
+
+TEST(RequestControlTest, ZeroValueAppRequestsTimeScale) {
+ // Default value
+ const uint32_t big_count_of_requests_for_test_ =
+ 10; // bigger than pending_requests_amount
+ uint32_t correlation_id = 0;
+ uint32_t connection_key = 0;
+ RequestController::TResult result;
+ RequestController request_ctrl_;
+
+ commands::Command* reg = RegisterApplication();
+ request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
+
+ for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
+ correlation_id = i;
+ commands::Command* testCommand =
+ PutFileCommand(correlation_id, connection_key);
+ result = request_ctrl_.addMobileRequest(testCommand,
+ mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_EQ(RequestController::SUCCESS, result);
+ }
+
+ commands::Command* unreg = UnregisterApplication();
+ request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
+}
+
+TEST(RequestControlTest, ZeroValueAppTimeScaleMaxRequests) {
+ // Default value
+ const uint32_t big_count_of_requests_for_test_ =
+ 10; // bigger than pending_requests_amount
+ uint32_t correlation_id = 0;
+ uint32_t connection_key = 0;
+ RequestController::TResult result;
+ RequestController request_ctrl_;
+
+ commands::Command* reg = RegisterApplication();
+ request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
+
+ for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
+ correlation_id = i;
+ commands::Command* testCommand =
+ PutFileCommand(correlation_id, connection_key);
+ result = request_ctrl_.addMobileRequest(testCommand,
+ mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_EQ(RequestController::SUCCESS, result);
+ }
+
+ commands::Command* unreg = UnregisterApplication();
+ request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
+}
+
+} // namespace application
+} // namespace components
+} // namespace test