summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex <akutsan@luxoft.com>2018-06-14 09:28:51 +0000
committerIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2018-06-26 12:01:48 +0300
commit8e9394b5b5240495783dba6562b505318baa5a3d (patch)
treee3b559c334ccbb38770ec792663e8e3f5f3376c2
parentc1381e83fd9673394b7fd84501e4bef96c319e61 (diff)
downloadsdl_core-8e9394b5b5240495783dba6562b505318baa5a3d.tar.gz
Enable System request tests, removed tests from sdl_rpc plugin
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc46
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h5
2 files changed, 21 insertions, 30 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
index 94ec61ad06..d6e1b2fe52 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -73,18 +73,14 @@ class OnSystemRequestNotificationTest
void PreConditions() {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
-
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
}
protected:
MockAppPtr mock_app_;
- MockPolicyHandlerInterface mock_policy_handler_;
};
-TEST_F(OnSystemRequestNotificationTest, DISABLED_Run_ProprietaryType_SUCCESS) {
+TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
const mobile_apis::RequestType::eType request_type =
mobile_apis::RequestType::PROPRIETARY;
@@ -95,13 +91,12 @@ TEST_F(OnSystemRequestNotificationTest, DISABLED_Run_ProprietaryType_SUCCESS) {
SharedPtr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
- MockAppPtr mock_app = CreateMockApp();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
- std::string policy_app_id;
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(policy_app_id, request_type))
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
.WillRepeatedly(Return(true));
#ifdef PROPRIETARY_MODE
@@ -125,7 +120,7 @@ TEST_F(OnSystemRequestNotificationTest, DISABLED_Run_ProprietaryType_SUCCESS) {
(*msg)[strings::params][strings::protocol_version].asInt());
}
-TEST_F(OnSystemRequestNotificationTest, DISABLED_Run_HTTPType_SUCCESS) {
+TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
const mobile_apis::RequestType::eType request_type =
mobile_apis::RequestType::HTTP;
@@ -136,11 +131,9 @@ TEST_F(OnSystemRequestNotificationTest, DISABLED_Run_HTTPType_SUCCESS) {
SharedPtr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
- MockAppPtr mock_app = CreateMockApp();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- std::string policy_app_id;
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
.WillOnce(Return(true));
@@ -161,8 +154,7 @@ TEST_F(OnSystemRequestNotificationTest, DISABLED_Run_HTTPType_SUCCESS) {
(*msg)[strings::params][strings::protocol_version].asInt());
}
-TEST_F(OnSystemRequestNotificationTest,
- DISABLED_Run_InvalidApp_NoNotification) {
+TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
const mobile_apis::RequestType::eType request_type =
mobile_apis::RequestType::HTTP;
@@ -173,10 +165,9 @@ TEST_F(OnSystemRequestNotificationTest,
SharedPtr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
- MockAppPtr mock_app = CreateMockApp();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(MockAppPtr()));
- EXPECT_CALL(*mock_app, policy_app_id()).Times(0);
+ EXPECT_CALL(*mock_app_, policy_app_id()).Times(0);
EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _)).Times(0);
EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
@@ -186,8 +177,7 @@ TEST_F(OnSystemRequestNotificationTest,
command->Run();
}
-TEST_F(OnSystemRequestNotificationTest,
- DISABLED_Run_RequestNotAllowed_NoNotification) {
+TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
const mobile_apis::RequestType::eType request_type =
mobile_apis::RequestType::HTTP;
@@ -198,25 +188,22 @@ TEST_F(OnSystemRequestNotificationTest,
SharedPtr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
- MockAppPtr mock_app = CreateMockApp();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- std::string policy_app_id;
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
.WillOnce(Return(false));
EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
- ;
command->Run();
}
TEST_F(
OnSystemRequestNotificationTest,
- DISABLED_Run_RequestTypeAllowedAndRequestSubTypeDisallowed_MessageNotSentToMobile) {
+ Run_RequestTypeAllowedAndRequestSubTypeDisallowed_MessageNotSentToMobile) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
const auto request_type = mobile_apis::RequestType::HTTP;
@@ -242,9 +229,8 @@ TEST_F(
command->Run();
}
-TEST_F(
- OnSystemRequestNotificationTest,
- DISABLED_Run_RequestTypeAllowedAndRequestSubTypeAllowed_SendMessageToMobile) {
+TEST_F(OnSystemRequestNotificationTest,
+ Run_RequestTypeAllowedAndRequestSubTypeAllowed_SendMessageToMobile) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
const auto request_type = mobile_apis::RequestType::OEM_SPECIFIC;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
index 727780eaf9..76b44f70f0 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
@@ -41,6 +41,11 @@
namespace vehicle_info_plugin {
namespace app_mngr = application_manager;
+/**
+ * @brief Defines set of vehicle info types
+ */
+typedef std::set<mobile_apis::VehicleDataType::eType> VehicleInfoSubscriptions;
+
class VehicleInfoAppExtension : app_mngr::AppExtension {
public:
explicit VehicleInfoAppExtension(app_mngr::AppExtensionUID uid);