From a037fc0098253478bb1e9b7a16f1157687e148f6 Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Sat, 23 Mar 2013 17:55:49 +0900 Subject: [PATCH] Clean-up unused feature data [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Current WRT uses Privilege instead of Feature Deprecated : typedef for "param" (Params, Param, ParamsIterator) API for "param" and "required" (isRequired(), getParams(), addParam) Remove test case [SCMRequest] N/A Change-Id: I2bb282fbff562a8181b1bc3bbe9dc44b9e3d4ca1 --- src/modules/API/WidgetDB/IWidgetFeature.h | 12 ------ src/modules/tizen/WidgetDB/WidgetDB.cpp | 10 ----- src/modules/tizen/WidgetDB/WidgetFeature.cpp | 21 ---------- src/modules/tizen/WidgetDB/WidgetFeature.h | 10 ----- tests/dao/WidgetDBTest.cpp | 63 ---------------------------- 5 files changed, 116 deletions(-) diff --git a/src/modules/API/WidgetDB/IWidgetFeature.h b/src/modules/API/WidgetDB/IWidgetFeature.h index 17e635d..2371c1e 100644 --- a/src/modules/API/WidgetDB/IWidgetFeature.h +++ b/src/modules/API/WidgetDB/IWidgetFeature.h @@ -32,24 +32,12 @@ namespace Api { class IWidgetFeature { public: - typedef std::pair Param; - typedef std::list Params; - typedef Params::const_iterator ParamsIterator; - - public: virtual ~IWidgetFeature() {} virtual std::string getName() const = 0; - virtual bool isRequired() const = 0; - - virtual Params getParams() const = 0; - - virtual void addParam(const std::string& paramName, - const std::string& paramValue) = 0; - virtual bool isRequestedByWidget() const = 0; }; diff --git a/src/modules/tizen/WidgetDB/WidgetDB.cpp b/src/modules/tizen/WidgetDB/WidgetDB.cpp index b37711c..08c3f42 100644 --- a/src/modules/tizen/WidgetDB/WidgetDB.cpp +++ b/src/modules/tizen/WidgetDB/WidgetDB.cpp @@ -273,16 +273,7 @@ Api::Features WidgetDB::getWidgetFeatures() const { Api::IWidgetFeaturePtr feature( new WidgetFeature(DPL::ToUTF8String((*it).name), - (*it).required, true)); // requested (WidgetFeature param) - // iterating multimap - FOREACH(iterator, (*it).params) - { - // adding features with key(first) and value(second) - feature->addParam(DPL::ToUTF8String(iterator->first), - DPL::ToUTF8String(iterator->second)); - } - outFeatures.push_back(feature); } @@ -327,7 +318,6 @@ Api::Features WidgetDB::getRegisteredFeatures() const // 'required' property false Api::IWidgetFeaturePtr newFeature(new WidgetFeature( dao.GetName(), - false, false)); // TODO what about feature params? aren't they needed diff --git a/src/modules/tizen/WidgetDB/WidgetFeature.cpp b/src/modules/tizen/WidgetDB/WidgetFeature.cpp index 5733926..aee4902 100644 --- a/src/modules/tizen/WidgetDB/WidgetFeature.cpp +++ b/src/modules/tizen/WidgetDB/WidgetFeature.cpp @@ -25,10 +25,8 @@ namespace WrtDeviceApis { namespace WidgetDB { WidgetFeature::WidgetFeature(const std::string& name, - bool required, bool requested) : m_name(name), - m_required(required), m_requested(requested) { //LogDebug("entered"); @@ -40,25 +38,6 @@ std::string WidgetFeature::getName() const return m_name; } -bool WidgetFeature::isRequired() const -{ - //LogDebug("entered"); - return m_required; -} - -Api::IWidgetFeature::Params WidgetFeature::getParams() const -{ - //LogDebug("entered"); - return m_params; -} - -void WidgetFeature::addParam(const std::string& paramName, - const std::string& paramValue) -{ - //LogDebug("entered"); - m_params.push_back(std::make_pair(paramName, paramValue)); -} - WidgetFeature::~WidgetFeature() { //LogDebug("entered"); diff --git a/src/modules/tizen/WidgetDB/WidgetFeature.h b/src/modules/tizen/WidgetDB/WidgetFeature.h index 11be686..d14dc69 100644 --- a/src/modules/tizen/WidgetDB/WidgetFeature.h +++ b/src/modules/tizen/WidgetDB/WidgetFeature.h @@ -31,27 +31,17 @@ class WidgetFeature : public Api::IWidgetFeature { public: WidgetFeature(const std::string& name, - bool required, bool requested); std::string getName() const; - bool isRequired() const; - - Api::IWidgetFeature::Params getParams() const; - virtual ~WidgetFeature(); - virtual void addParam(const std::string& paramName, - const std::string& paramValue); - virtual bool isRequestedByWidget() const; private: std::string m_name; - bool m_required; bool m_requested; - Params m_params; }; } // WidgetDB } // WrtDeviceApis diff --git a/tests/dao/WidgetDBTest.cpp b/tests/dao/WidgetDBTest.cpp index ea6ca11..d210f9d 100644 --- a/tests/dao/WidgetDBTest.cpp +++ b/tests/dao/WidgetDBTest.cpp @@ -439,67 +439,4 @@ RUNNER_TEST(widgetDB_test_check_installation_status_latest) } } -/* - * Name: widgetDB_test_widget_feature - * Description: check accessiblity of widget features and their values by - * WidgetDB - * Expected: feature names and values should match this, which was inserted into - * widget database - */ -RUNNER_TEST(widgetDB_test_widget_feature) -{ - try { - IWidgetDBPtr widget = getWidgetDB(2000); - Features features = widget->getWidgetFeatures(); - - RUNNER_ASSERT(features.size() == 5); - - FOREACH(it, features) - { - std::string name = (*it)->getName(); - if ("first_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 4); - - RUNNER_ASSERT((*it)->isRequired()); - } else if ("second_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 1); - } else if ("third_2000" == name) { - IWidgetFeature::Params params = (*it)->getParams(); - - RUNNER_ASSERT(params.size() == 1); - RUNNER_ASSERT_WHAT_EQUALS("third_2000", params.begin()->first); - RUNNER_ASSERT_WHAT_EQUALS("thirdValue1", params.begin()->second); - RUNNER_ASSERT(!(*it)->isRequired()); - } else if ("fourth_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 0); - } else if ("fifth_2000" == name) { - RUNNER_ASSERT((*it)->getParams().size() == 0); - } else { - RUNNER_ASSERT(false); - } - } - } catch (const WrtDeviceApis::Commons::SecurityException &e) { - LogError("Exception thrown." << e.DumpToString()); - RUNNER_ASSERT(false); - } -} - -/* - * Name: widgetDB_test_widget_feature2 - * Description: check if requesting features from WidgetDB throw excpetion if - * widget does not exists - * Expected: exception should be raise if widget does not exists - */ -RUNNER_TEST(widgetDB_test_widget_feature2) -{ - try { - IWidgetDBPtr widget = getWidgetDB(2011); //no such widget - Features features = widget->getWidgetFeatures(); - - RUNNER_ASSERT(false); - } catch (const WrtDeviceApis::Commons::SecurityException &e) { - LogDebug("OK. Exception thrown." << e.DumpToString()); - } -} - #undef RUNNER_ASSERT_WHAT_EQUALS -- 2.7.4