diff options
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_service_update_notification.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_service_status_update_notification.h) | 22 | ||||
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_status_update_notification.cc) | 12 | ||||
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc | 5 | ||||
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc | 16 | ||||
-rw-r--r-- | src/components/application_manager/test/include/application_manager/mock_message_helper.h | 64 |
5 files changed, 58 insertions, 61 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_service_status_update_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_service_update_notification.h index f51b0c2907..bfa9b6e6ae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_service_status_update_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_service_update_notification.h @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SERVICE_STATUS_UPDATE_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SERVICE_STATUS_UPDATE_NOTIFICATION_H_ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SERVICE_UPDATE_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SERVICE_UPDATE_NOTIFICATION_H_ #include "application_manager/commands/notification_to_hmi.h" @@ -42,29 +42,29 @@ namespace commands { namespace hmi { /** - * @brief OnServiceStatusUpdateNotification command class + * @brief OnServiceUpdateNotification command class **/ -class OnServiceStatusUpdateNotification +class OnServiceUpdateNotification : public app_mngr::commands::NotificationToHMI { public: /** - * @brief OnServiceStatusUpdateNotification class constructor + * @brief OnServiceUpdateNotification class constructor * @param application_manager ref to application manager * @param rpc_service ref to rpc service * @param hmi_capabilities ref to HMI capabilities * @param policy_handle ref to policy handler **/ - OnServiceStatusUpdateNotification( + OnServiceUpdateNotification( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, app_mngr::rpc_service::RPCService& rpc_service, app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handle); + policy::PolicyHandlerInterface& policy_handler); /** - * @brief OnServiceStatusUpdateNotification class destructor + * @brief OnServiceUpdateNotification class destructor **/ - virtual ~OnServiceStatusUpdateNotification() OVERRIDE; + virtual ~OnServiceUpdateNotification() OVERRIDE; /** * @brief Execute command @@ -72,11 +72,11 @@ class OnServiceStatusUpdateNotification void Run() OVERRIDE; private: - DISALLOW_COPY_AND_ASSIGN(OnServiceStatusUpdateNotification); + DISALLOW_COPY_AND_ASSIGN(OnServiceUpdateNotification); }; } // namespace hmi } // namespace commands } // namespace sdl_rpc_plugin -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SERVICE_STATUS_UPDATE_NOTIFICATION_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SERVICE_UPDATE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_status_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc index 6dc5f9a7fc..de03b75214 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_status_update_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc @@ -30,7 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "sdl_rpc_plugin/commands/hmi/on_service_status_update_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_service_update_notification.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -39,21 +39,21 @@ namespace commands { namespace hmi { -OnServiceStatusUpdateNotification::OnServiceStatusUpdateNotification( +OnServiceUpdateNotification::OnServiceUpdateNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, rpc_service::RPCService& rpc_service, HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handle) + policy::PolicyHandlerInterface& policy_handler) : NotificationToHMI(message, application_manager, rpc_service, hmi_capabilities, - policy_handle) {} + policy_handler) {} -OnServiceStatusUpdateNotification::~OnServiceStatusUpdateNotification() {} +OnServiceUpdateNotification::~OnServiceUpdateNotification() {} -void OnServiceStatusUpdateNotification::Run() { +void OnServiceUpdateNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc index 6ac398c093..a0dee162dd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc @@ -247,7 +247,7 @@ #include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h" #include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_service_status_update_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_service_update_notification.h" #include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h" #include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h" #include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h" @@ -868,8 +868,7 @@ CommandCreator& HMICommandFactory::get_creator_factory( : factory.GetCreator<commands::hmi::DialNumberResponse>(); } case hmi_apis::FunctionID::BasicCommunication_OnServiceUpdate: { - return factory - .GetCreator<commands::hmi::OnServiceStatusUpdateNotification>(); + return factory.GetCreator<commands::hmi::OnServiceUpdateNotification>(); } case hmi_apis::FunctionID::Navigation_OnWayPointChange: { return factory.GetCreator<commands::OnNaviWayPointChangeNotification>(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc index 5df1d6e207..e35c06b192 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc @@ -36,19 +36,19 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/smart_object_keys.h" #include "gtest/gtest.h" -#include "hmi/on_service_status_update_notification.h" +#include "hmi/on_service_update_notification.h" #include "smart_objects/smart_object.h" namespace test { namespace components { namespace commands_test { namespace hmi_commands_test { -namespace on_service_status_update_notification { +namespace on_service_update_notification { using namespace application_manager; -using sdl_rpc_plugin::commands::hmi::OnServiceStatusUpdateNotification; +using sdl_rpc_plugin::commands::hmi::OnServiceUpdateNotification; -typedef std::shared_ptr<OnServiceStatusUpdateNotification> NotificationPtr; +typedef std::shared_ptr<OnServiceUpdateNotification> NotificationPtr; typedef hmi_apis::Common_ServiceType::eType ServiceType; typedef hmi_apis::Common_ServiceEvent::eType ServiceEvent; @@ -57,10 +57,10 @@ const uint32_t kConnectionKey = 1232u; const uint32_t kHmi_app_id = 321u; } // namespace -class OnServiceStatusUpdateNotificationTest +class OnServiceUpdateNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> { public: - OnServiceStatusUpdateNotificationTest() + OnServiceUpdateNotificationTest() : message_(CreateMessage(smart_objects::SmartType_Map)) {} public: @@ -68,13 +68,13 @@ class OnServiceStatusUpdateNotificationTest NotificationPtr command_; }; -TEST_F(OnServiceStatusUpdateNotificationTest, SendNotificationToHMI) { +TEST_F(OnServiceUpdateNotificationTest, SendNotificationToHMI) { (*message_)[strings::msg_params][hmi_notification::service_type] = ServiceType::AUDIO; (*message_)[strings::msg_params][hmi_notification::service_event] = ServiceEvent::REQUEST_ACCEPTED; (*message_)[strings::msg_params][strings::app_id] = kConnectionKey; - command_ = CreateCommand<OnServiceStatusUpdateNotification>(message_); + command_ = CreateCommand<OnServiceUpdateNotification>(message_); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(message_)).Times(1); 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 index e74e43df01..6f06a9adce 100644 --- 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 @@ -346,44 +346,42 @@ class MockMessageHelper { CreateDisplayCapabilityUpdateToMobile, smart_objects::SmartObjectSPtr(const smart_objects::SmartObject&, application_manager::Application&)); - MOCK_METHOD3(CreateOnServiceStatusUpdateNotification, - smart_objects::SmartObject( - const uint32_t app_id, - const hmi_apis::Common_ServiceType::eType service_type, - const hmi_apis::Common_ServiceEvent::eType service_event)); - MOCK_METHOD4(CreateOnServiceStatusUpdateNotification, - smart_objects::SmartObject( - const uint32_t app_id, - const hmi_apis::Common_ServiceType::eType service_type, - const hmi_apis::Common_ServiceEvent::eType service_event, - const hmi_apis::Common_ServiceStatusUpdateReason::eType - service_update_reason)); + MOCK_METHOD3(CreateOnServiceUpdateNotification, smart_objects::SmartObject( + const uint32_t app_id, + const hmi_apis::Common_ServiceType::eType service_type, + const hmi_apis::Common_ServiceEvent::eType service_event)); + MOCK_METHOD4(CreateOnServiceUpdateNotification, smart_objects::SmartObject( + const uint32_t app_id, + const hmi_apis::Common_ServiceType::eType service_type, + const hmi_apis::Common_ServiceEvent::eType service_event, + const hmi_apis::Common_ServiceStatusUpdateReason::eType + service_update_reason)); - class MockServiceStatusUpdateNotificationBuilder - : public MessageHelper::ServiceStatusUpdateNotificationBuilder { - public: - MockServiceStatusUpdateNotificationBuilder( - const MockServiceStatusUpdateNotificationBuilder& obj){}; - MockServiceStatusUpdateNotificationBuilder(){}; - MOCK_METHOD2(CreateBuilder, - MessageHelper::ServiceStatusUpdateNotificationBuilder( - hmi_apis::Common_ServiceType::eType, - hmi_apis::Common_ServiceEvent::eType)); +class MockServiceStatusUpdateNotificationBuilder + : public MessageHelper::ServiceStatusUpdateNotificationBuilder { + public: + MockServiceStatusUpdateNotificationBuilder( + const MockServiceStatusUpdateNotificationBuilder& obj){}; + MockServiceStatusUpdateNotificationBuilder(){}; + MOCK_METHOD2(CreateBuilder, + MessageHelper::ServiceStatusUpdateNotificationBuilder( + hmi_apis::Common_ServiceType::eType, + hmi_apis::Common_ServiceEvent::eType)); - MOCK_METHOD1(AddAppID, - MessageHelper::ServiceStatusUpdateNotificationBuilder&( - const uint32_t app_id)); + MOCK_METHOD1(AddAppID, + MessageHelper::ServiceStatusUpdateNotificationBuilder & + (const uint32_t app_id)); - MOCK_METHOD1(AddServiceUpdateReason, - MessageHelper::ServiceStatusUpdateNotificationBuilder&( - const hmi_apis::Common_ServiceStatusUpdateReason::eType)); + MOCK_METHOD1(AddServiceUpdateReason, + MessageHelper::ServiceStatusUpdateNotificationBuilder & + (const hmi_apis::Common_ServiceStatusUpdateReason::eType)); - MOCK_CONST_METHOD0(notification, smart_objects::SmartObjectSPtr()); - }; + MOCK_CONST_METHOD0(notification, smart_objects::SmartObjectSPtr()); +}; - static MockMessageHelper* message_helper_mock(); - static MockServiceStatusUpdateNotificationBuilder* - on_service_update_builder_mock(); +static MockMessageHelper* message_helper_mock(); +static MockServiceStatusUpdateNotificationBuilder* +on_service_update_builder_mock(); }; } // namespace application_manager |