diff options
author | JackLivio <jack@livio.io> | 2018-10-03 10:15:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 10:15:40 -0400 |
commit | 486610a54ae35b6cebf62b5ff4cc07f0ee9d1543 (patch) | |
tree | 3371a5144a41fcdd049eff4602e0d1909e301a2b /src/components/policy | |
parent | 8d2f777498d744e890a2b5148c69969940ccd655 (diff) | |
download | sdl_core-486610a54ae35b6cebf62b5ff4cc07f0ee9d1543.tar.gz |
Remove OnPolicyInit, Unused Function (#2650)
Diffstat (limited to 'src/components/policy')
9 files changed, 0 insertions, 86 deletions
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h index 29adeec084..3a9e13b83f 100644 --- a/src/components/policy/policy_external/include/policy/update_status_manager.h +++ b/src/components/policy/policy_external/include/policy/update_status_manager.h @@ -125,12 +125,6 @@ class UpdateStatusManager { void OnNewApplicationAdded(const DeviceConsent consent); /** - * @brief Update status handler for policy initialization - * @param is_update_required Update necessity flag - */ - void OnPolicyInit(bool is_update_required); - - /** * @brief In case application from non-consented device has been registered * before and and no updated happened then triggers status change */ diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc index 579ad8cb56..b352b5ea39 100644 --- a/src/components/policy/policy_external/src/update_status_manager.cc +++ b/src/components/policy/policy_external/src/update_status_manager.cc @@ -139,14 +139,6 @@ void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) { ProcessEvent(kOnNewAppRegistered); } -void UpdateStatusManager::OnPolicyInit(bool is_update_required) { - LOG4CXX_AUTO_TRACE(logger_); - if (is_update_required) { - current_status_.reset(new UpToDateStatus()); - ProcessEvent(kScheduleUpdate); - } -} - void UpdateStatusManager::OnDeviceConsented() { LOG4CXX_AUTO_TRACE(logger_); if (app_registered_from_non_consented_device_) { diff --git a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h index 104b37e379..662632fc59 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h +++ b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h @@ -50,7 +50,6 @@ class MockUpdateStatusManager : public ::policy::UpdateStatusManager { MOCK_METHOD0(OnResetRetrySequence, void()); MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required)); MOCK_METHOD1(OnNewApplicationAdded, void(const DeviceConsent)); - MOCK_METHOD1(OnPolicyInit, void(bool is_update_required)); MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus()); }; diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc index 278c4fc43a..bf443bb201 100644 --- a/src/components/policy/policy_external/test/update_status_manager_test.cc +++ b/src/components/policy/policy_external/test/update_status_manager_test.cc @@ -287,42 +287,6 @@ TEST_F(UpdateStatusManagerTest, ScheduleUpdate_ExpectStatusUpdateNeeded) { } TEST_F(UpdateStatusManagerTest, - OnPolicyInit_SetUpdateRequired_ExpectStatusUpdateNeeded) { - // Arrange - manager_->OnPolicyInit(true); - status_ = manager_->GetLastUpdateStatus(); - // Checks - EXPECT_EQ(StatusUpdateRequired, status_); - EXPECT_FALSE(manager_->IsUpdatePending()); - EXPECT_TRUE(manager_->IsUpdateRequired()); -} - -TEST_F(UpdateStatusManagerTest, - OnPolicyInit_SetUpdateNotRequired_ExpectStatusUpToDate) { - // Arrange - manager_->OnPolicyInit(false); - status_ = manager_->GetLastUpdateStatus(); - // Checks - EXPECT_EQ(StatusUpToDate, status_); - EXPECT_FALSE(manager_->IsUpdatePending()); - EXPECT_FALSE(manager_->IsUpdateRequired()); -} - -TEST_F(UpdateStatusManagerTest, - StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) { - // Arrange - manager_->OnPolicyInit(false); - // Check - EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus()); - manager_->OnPolicyInit(true); - // Check - EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus()); - manager_->OnUpdateSentOut(k_timeout_); - // Check - EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus()); -} - -TEST_F(UpdateStatusManagerTest, OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) { // Arrange manager_->OnAppsSearchStarted(); diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h index 5cd20e57e3..c90acd4957 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h @@ -124,12 +124,6 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { void OnExistedApplicationAdded(const bool is_update_required); /** - * @brief Update status handler for policy initialization - * @param is_update_required Update necessity flag - */ - void OnPolicyInit(bool is_update_required); - - /** * @brief In case application from non-consented device has been registered * before and and no updated happened then triggers status change */ diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h index b4999b569c..4763ff2eb5 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h @@ -109,12 +109,6 @@ class UpdateStatusManagerInterface { * @param is_update_required Update necessity flag */ virtual void OnExistedApplicationAdded(const bool is_update_required) = 0; - - /** - * @brief Update status handler for policy initialization - * @param is_update_required Update necessity flag - */ - virtual void OnPolicyInit(bool is_update_required) = 0; }; typedef std::shared_ptr<UpdateStatusManagerInterface> diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc index 97a1573176..c37f8bbadc 100644 --- a/src/components/policy/policy_regular/src/update_status_manager.cc +++ b/src/components/policy/policy_regular/src/update_status_manager.cc @@ -119,14 +119,6 @@ void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) { ProcessEvent(kOnNewAppRegistered); } -void UpdateStatusManager::OnPolicyInit(bool is_update_required) { - LOG4CXX_AUTO_TRACE(logger_); - if (is_update_required) { - current_status_.reset(new UpToDateStatus()); - ProcessEvent(kScheduleUpdate); - } -} - void UpdateStatusManager::OnDeviceConsented() { LOG4CXX_AUTO_TRACE(logger_); if (app_registered_from_non_consented_device_) { diff --git a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h index 8dcaabd3cb..e66d2012cb 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h @@ -49,7 +49,6 @@ class MockUpdateStatusManager : public UpdateStatusManager { MOCK_METHOD0(OnResetRetrySequence, void()); MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required)); MOCK_METHOD0(OnNewApplicationAdded, void()); - MOCK_METHOD1(OnPolicyInit, void(bool is_update_required)); MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus()); }; diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc index 6f301c6720..244858554f 100644 --- a/src/components/policy/policy_regular/test/update_status_manager_test.cc +++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc @@ -62,20 +62,6 @@ class UpdateStatusManagerTest : public ::testing::Test { }; TEST_F(UpdateStatusManagerTest, - StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) { - // Arrange - manager_->OnPolicyInit(false); - // Check - EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus()); - manager_->OnPolicyInit(true); - // Check - EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus()); - manager_->OnUpdateSentOut(); - // Check - EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus()); -} - -TEST_F(UpdateStatusManagerTest, OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) { // Arrange manager_->OnAppsSearchStarted(); |