diff options
author | Kozoriz <kozorizandriy@gmail.com> | 2016-12-28 10:18:43 +0200 |
---|---|---|
committer | Kozoriz <kozorizandriy@gmail.com> | 2016-12-29 09:42:05 +0200 |
commit | 68f3194e5c47a295ea18530121905b92a0a7f82a (patch) | |
tree | 6480d6c7cd0d2174c008f45fa97a243a336209c7 /src/components/policy/policy_external/test | |
parent | 85bba21e1839f3a5f79b64b88578e7dbbe134c3c (diff) | |
download | sdl_core-68f3194e5c47a295ea18530121905b92a0a7f82a.tar.gz |
Fix tests after changing implementation
Removed preloaded_pt field from PTU json files.
Fixed failed related tests.
Related task : APPLINK-30866
Diffstat (limited to 'src/components/policy/policy_external/test')
16 files changed, 98 insertions, 106 deletions
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json index dc53722243..eb139cb52e 100644 --- a/src/components/policy/policy_external/test/json/PTU.json +++ b/src/components/policy/policy_external/test/json/PTU.json @@ -1,7 +1,6 @@ - { - "policy_table": { - "module_config": { - "preloaded_pt": true, +{ + "policy_table" : { + "module_config": { "preloaded_date": "2015-12-08", "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, @@ -1912,7 +1911,7 @@ } }, "app_policies": { - "default": { + "default": { "keep_context": false, "steal_focus": false, "priority": "NONE", @@ -1933,17 +1932,18 @@ "groups": ["DataConsent-2"] }, "pre_DataConsent": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": ["BaseBeforeDataConsent"], - "RequestType": [ - "QUERY_APPS", - "LAUNCH_APP", - "PROPRIETARY" - ] - } - } + "keep_context" : false, + "steal_focus" + : false, + "priority" + : "NONE", + "default_hmi" + : "NONE", + "groups" : + ["BaseBeforeDataConsent"], + "RequestType" + :[ "QUERY_APPS", "LAUNCH_APP", "PROPRIETARY" ] } - }
\ No newline at end of file + } + } +} diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json index fead05adab..317e8a8716 100644 --- a/src/components/policy/policy_external/test/json/PTU2.json +++ b/src/components/policy/policy_external/test/json/PTU2.json @@ -1,7 +1,6 @@ - { - "policy_table": { - "module_config": { - "preloaded_pt": true, +{ + "policy_table" : { + "module_config": { "preloaded_date": "2015-12-08", "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, @@ -1912,7 +1911,7 @@ } }, "app_policies": { - "default": { + "default": { "keep_context": false, "steal_focus": false, "priority": "NONE", @@ -1934,15 +1933,17 @@ "groups": ["BaseBeforeDataConsent"] }, "1234": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": ["BaseBeforeDataConsent"], - "RequestType": [ + "keep_context" : false, + "steal_focus" + : false, + "priority" : "NONE", + "default_hmi" + : "NONE", + "groups" : ["BaseBeforeDataConsent"], + "RequestType" : [ - ] - } - } - } + ] + } } + } +} diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json index cc4859ea21..da7f7a68de 100644 --- a/src/components/policy/policy_external/test/json/PTU3.json +++ b/src/components/policy/policy_external/test/json/PTU3.json @@ -1,7 +1,6 @@ - { - "policy_table": { - "module_config": { - "preloaded_pt": true, +{ + "policy_table" : { + "module_config": { "preloaded_date": "2015-12-08", "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, @@ -1912,7 +1911,7 @@ } }, "app_policies": { - "default": { + "default": { "keep_context": false, "steal_focus": false, "priority": "NONE", @@ -1933,18 +1932,20 @@ "groups": ["DataConsent-2"] }, "pre_DataConsent": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": ["BaseBeforeDataConsent"], - "RequestType": [ - "QUERY_APPS", - "LAUNCH_APP", - "PROPRIETARY", - "INVALID_REQUEST_TYPE" - ] - } - } + "keep_context" : false, + "steal_focus" + : false, + "priority" : "NONE", + "default_hmi" + : "NONE", + "groups" : ["BaseBeforeDataConsent"], + "RequestType" :[ + "QUERY_APPS", + "LAUNCH_APP", + "PROPRIETARY", + "INVALID_REQUEST_TYPE" + ] } - }
\ No newline at end of file + } + } +} diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json index 50364397fd..899e58a68d 100644 --- a/src/components/policy/policy_external/test/json/ptu2_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "preloaded_date": "2015-12-02", "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, @@ -2596,19 +2595,20 @@ ] }, "584421907": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": [ - "BaseBeforeDataConsent" - ], - "RequestType": [ - "TRAFFIC_MESSAGE_CHANNEL", - "QUERY_APPS", - "LAUNCH_APP", - "PROPRIETARY" - ] + "keep_context" : false, + "steal_focus" : false, + "priority" + : "NONE", + "default_hmi" + : "NONE", + "groups" : + ["BaseBeforeDataConsent"], + "RequestType" :[ + "TRAFFIC_MESSAGE_CHANNEL", + "QUERY_APPS", + "LAUNCH_APP", + "PROPRIETARY" + ] } } } diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json index d4c85d0d05..6bfa2a3f58 100644 --- a/src/components/policy/policy_external/test/json/ptu_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu_requestType.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "preloaded_date": "2015-12-02", "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, @@ -2591,16 +2590,15 @@ ] }, "584421907": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": [ - "BaseBeforeDataConsent" - ], - "RequestType": [ - "PROPRIETARY" - ] + "keep_context" : false, + "steal_focus" + : false, + "priority" : "NONE", + "default_hmi" + : "NONE", + "groups" : ["BaseBeforeDataConsent"], + "RequestType" : + ["PROPRIETARY"] } } } diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json index 2983f07146..18b0a09040 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2338,4 +2337,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json index a13edef669..3530c01388 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2340,4 +2339,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json index 29851341ba..e169aea24a 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2328,4 +2327,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json index 08dec59730..df45a0be61 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2327,4 +2326,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json index 4ae5d9cc20..c471d6ec97 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2339,4 +2338,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json index d4b52c6176..29781d211c 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2328,4 +2327,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json index 0144900e31..91be06a561 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json @@ -1,7 +1,6 @@ { - "policy_table": { + "policy_table" : { "module_config": { - "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 20, @@ -2333,4 +2332,4 @@ }, } } -}
\ No newline at end of file +} diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index 16c5587541..cec844fb85 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -125,7 +125,7 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) { TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) { // Arrange - std::ifstream ifile(preloadet_pt_filename_); + std::ifstream ifile(kValidSdlPtUpdateJson); Json::Reader reader; std::string json; Json::Value root(Json::objectValue); @@ -177,7 +177,7 @@ TEST_F(PolicyManagerImplTest2, EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted); ASSERT_TRUE(output.list_of_allowed_params.empty()); // Act - std::ifstream ifile(preloadet_pt_filename_); + std::ifstream ifile(kValidSdlPtUpdateJson); Json::Reader reader; std::string json; Json::Value root(Json::objectValue); @@ -219,7 +219,7 @@ TEST_F(PolicyManagerImplTest2, // Add app from consented device. App will be assigned with default policies manager_->AddApplication(application_id_); // Emulate PTU with new policies for app added above - std::ifstream ifile(preloadet_pt_filename_); + std::ifstream ifile(kValidSdlPtUpdateJson); Json::Reader reader; std::string json; Json::Value root(Json::objectValue); diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc index eceecac0b1..63bcb30374 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc @@ -92,7 +92,6 @@ Json::Value createPTforLoad() { "{" "\"policy_table\": {" "\"module_config\": {" - "\"preloaded_pt\": true," "\"exchange_after_x_ignition_cycles\": 10," "\"exchange_after_x_kilometers\": 100," "\"exchange_after_x_days\": 5," diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index 63cd26b84c..aa4a12e028 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -222,7 +222,6 @@ TEST_F(SQLPTExtRepresentationTest, Json::Value& module_config = policy_table["module_config"]; module_config["preloaded_date"] = Json::Value(""); - module_config["preloaded_pt"] = Json::Value(true); module_config["exchange_after_x_ignition_cycles"] = Json::Value(10); module_config["exchange_after_x_kilometers"] = Json::Value(100); module_config["exchange_after_x_days"] = Json::Value(5); @@ -330,6 +329,7 @@ TEST_F(SQLPTExtRepresentationTest, policy_table["module_meta"] = Json::Value(Json::objectValue); policy_table["usage_and_error_counts"] = Json::Value(Json::objectValue); policy_table["device_data"] = Json::Value(Json::objectValue); + policy_table["module_config"]["preloaded_pt"] = Json::Value(false); Json::Value& module_meta = policy_table["module_meta"]; module_meta["ccpu_version"] = Json::Value(""); diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index ebc3080169..a29d554f3b 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -224,7 +224,6 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, policy_table["app_policies"] = Json::Value(Json::objectValue); Json::Value& module_config = policy_table["module_config"]; - module_config["preloaded_pt"] = Json::Value(false); module_config["preloaded_date"] = Json::Value("25-04-2015"); module_config["exchange_after_x_ignition_cycles"] = Json::Value(10); module_config["exchange_after_x_kilometers"] = Json::Value(100); @@ -1600,6 +1599,7 @@ TEST_F(SQLPTRepresentationTest, table["policy_table"]["app_policies"]["device"].removeMember("groups"); table["policy_table"]["device_data"] = Json::Value(Json::objectValue); table["policy_table"]["module_meta"] = Json::Value(Json::objectValue); + table["policy_table"]["module_config"]["preloaded_pt"] = Json::Value(false); policy_table::Table expected(&table); Json::StyledWriter writer; // Checks |