Clean-up unused feature data
authorJihoon Chung <jihoon.chung@samsung.com>
Sat, 23 Mar 2013 08:55:49 +0000 (17:55 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Sun, 31 Mar 2013 08:41:37 +0000 (17:41 +0900)
[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
src/modules/tizen/WidgetDB/WidgetDB.cpp
src/modules/tizen/WidgetDB/WidgetFeature.cpp
src/modules/tizen/WidgetDB/WidgetFeature.h
tests/dao/WidgetDBTest.cpp

index 17e635d..2371c1e 100644 (file)
@@ -32,24 +32,12 @@ namespace Api {
 class IWidgetFeature
 {
   public:
-    typedef std::pair<std::string, std::string> Param;
-    typedef std::list<Param> 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;
 };
 
index b37711c..08c3f42 100644 (file)
@@ -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
index 5733926..aee4902 100644 (file)
 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");
index 11be686..d14dc69 100644 (file)
@@ -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
index ea6ca11..d210f9d 100644 (file)
@@ -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