diff options
author | JackLivio <jack@livio.io> | 2016-05-11 10:31:37 -0400 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2016-05-11 10:31:37 -0400 |
commit | d7a07895971d6cd50c9acbac20cdc9fc5e84529c (patch) | |
tree | 88ee9d90f6dc562b9748e8fd5a23a77a57f9b7d4 | |
parent | 2b17b5546d4d94665a37697d73f10adfb14b6dd3 (diff) | |
download | sdl_core-hotfix/policy_manager_stress_test.tar.gz |
Re-adds policy_manager_impl_stress_test.cc with fixhotfix/policy_manager_stress_test
Adds "device" and "pre_DataConsent" to the app_policies section when the test case is building a sample policy table.
-rw-r--r-- | src/components/policy/test/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/components/policy/test/include/mock_policy_listener.h | 6 | ||||
-rw-r--r-- | src/components/policy/test/policy_manager_impl_stress_test.cc | 26 |
3 files changed, 27 insertions, 8 deletions
diff --git a/src/components/policy/test/CMakeLists.txt b/src/components/policy/test/CMakeLists.txt index d23a50e7fe..9339350e2c 100644 --- a/src/components/policy/test/CMakeLists.txt +++ b/src/components/policy/test/CMakeLists.txt @@ -81,8 +81,7 @@ else () sqlite_wrapper/sql_query_test.cc generated_code_with_sqlite_test.cc - # TODO{ALeshin} AssertTrue in SetUpTestCase() return false - #policy_manager_impl_stress_test.cc + policy_manager_impl_stress_test.cc ) list (APPEND testLibraries sqlite3) endif() diff --git a/src/components/policy/test/include/mock_policy_listener.h b/src/components/policy/test/include/mock_policy_listener.h index 6cbca0557a..7ee74e64c0 100644 --- a/src/components/policy/test/include/mock_policy_listener.h +++ b/src/components/policy/test/include/mock_policy_listener.h @@ -73,10 +73,8 @@ class MockPolicyListener : public PolicyListener { void(std::map<std::string, StringArray>)); MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>&)); - MOCK_METHOD3(OnSnapshotCreated, - void(const BinaryMessage& pt_string, - const std::vector<int>& retry_seconds, - int timeout_exceed)); + MOCK_METHOD1(OnSnapshotCreated, + void(const BinaryMessage& pt_string)); MOCK_METHOD0(CanUpdate, bool()); MOCK_METHOD1(OnCertificateUpdated, void (const std::string&)); diff --git a/src/components/policy/test/policy_manager_impl_stress_test.cc b/src/components/policy/test/policy_manager_impl_stress_test.cc index 1f85f738c7..564a673c7d 100644 --- a/src/components/policy/test/policy_manager_impl_stress_test.cc +++ b/src/components/policy/test/policy_manager_impl_stress_test.cc @@ -47,8 +47,8 @@ namespace policy { class PolicyManagerImplStressTest : public ::testing::Test { protected: static const std::string kNameFile; - static const int kNumberGroups = 3; //10; - static const int kNumberFuncs = 4; //100; + static const int kNumberGroups = 3; + static const int kNumberFuncs = 4; static const int kNumberApps = 5; static const int kNumberAppGroups = 5; static PolicyManagerImpl* manager; @@ -143,6 +143,28 @@ void PolicyManagerImplStressTest::CreateApps(std::ofstream& ofs) { "]" "},\n"; + //Device app_policies object must be present and initialized for PT to be valid. + ofs << "\"device\":{\n"; + ofs << "\"keep_context\": false,\n" + "\"steal_focus\": false,\n" + "\"priority\": \"NONE\",\n" + "\"default_hmi\": \"NONE\",\n"; + ofs << "\"groups\":[" + "\"Group-1\"" + "]" + "},\n"; + + //preData app_policies must be present and initialized for PT to be valid. + ofs << "\"pre_DataConsent\":{\n"; + ofs << "\"keep_context\": false,\n" + "\"steal_focus\": false,\n" + "\"priority\": \"NONE\",\n" + "\"default_hmi\": \"NONE\",\n"; + ofs << "\"groups\":[" + "\"Group-1\"" + "]" + "},\n"; + std::stringstream ss; std::string number; for (int i = 0; i < kNumberApps - 1; ++i) { |