[Issue#] PkgName could have been NULL.
[Bug] N/A
[Cause] N/A
[Solution] Changed Pkgname type, changed api methods. This is a temporary change, to test if the new API work.
[Verification] Build commons, plugins, installer, wrt. Run tests.
Change-Id: I55750b51fbdf4a68f2f44d2bb1884a8981346ab9
ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
"Failed to get widget by handle");
}
- DPL::OptionalString pkgname = rowList.front().Get_pkgname();
- if(pkgname.IsNull()){
- ThrowMsg(WidgetDAOReadOnly::Exception::DatabaseError,
- "PkgName is null for this widget");
- }
- return *pkgname;
+ WidgetPkgName pkgname = rowList.front().Get_pkgname();
+
+ return pkgname;
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle")
DPL::OptionalString WidgetDAOReadOnly::getPkgname() const
{
- return DPL::OptionalString(getPkgname_TEMPORARY_API());
-}
-
-WidgetPkgName WidgetDAOReadOnly::getPkgname_TEMPORARY_API() const
-{
- WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
- return row.Get_pkgname();
+ return DPL::OptionalString(getPkgName());
}
DPL::OptionalString WidgetDAOReadOnly::getDefaultlocale() const
using namespace WrtDB::WidgetConfig;
std::ostringstream path;
- WidgetPkgName pkgname = getPkgname_TEMPORARY_API();
+ WidgetPkgName pkgname = getPkgName();
path << GetWidgetPersistentStoragePath(pkgname);
path << "/";
std::string WidgetDAOReadOnly::getPrivateLocalStoragePath() const
{
std::ostringstream path;
- WidgetPkgName pkgname = getPkgname_TEMPORARY_API();
+ WidgetPkgName pkgname = getPkgName();
path << WidgetConfig::GetWidgetWebLocalStoragePath(pkgname);
path << "/";
LocalizationData localizationData;
DPL::OptionalString pkgname;
- WidgetPkgName pkgname_TEMPORARY_API;
+ WidgetPkgName pkgName;
time_t installedTime;
PackagingType packagingType;
*/
WidgetGUID getGUID() const;
+
/**
- * This method returns the Package name of the widget.
- *
- * @return pkgname
- * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
- * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
- */
+ * This method returns the Package name of the widget.
+ *
+ * @return pkgname
+ * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
+ * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
+ */
DPL::OptionalString getPkgname() const;
- WidgetPkgName getPkgname_TEMPORARY_API() const;
/**
* This method returns the defaultlocale for the widget.
{
WidgetPkgName pkgname;
Try {
- auto previous = WidgetDAO::getPkgnameList();
+ auto previous = WidgetDAO::getPkgnameList_TEMPORARY_API();
// register widget
pkgname = WidgetDAO::registerWidgetGenerateTizenId(regInfo, sec);
RUNNER_ASSERT_MSG(!pkgname.empty(),
"(called from line " << line << ")");
- auto current = WidgetDAO::getPkgnameList();
+ auto current = WidgetDAO::getPkgnameList_TEMPORARY_API();
RUNNER_ASSERT_MSG(previous.size()+1 == current.size(),
"(called from line " << line << ")");
WacSecurityMock sec;
const std::size_t NUMBER_OF_WIDGETS = 5;
- DPL::Optional<WidgetPkgName> lastPkgname;
+ WidgetPkgName lastPkgname;
for (std::size_t number = 0; number < NUMBER_OF_WIDGETS; ++number)
{
*/
RUNNER_TEST(widget_dao_test_get_widget_pkgname_list)
{
- WidgetPkgNameList pkgnames = WidgetDAO::getPkgnameList();
+ WidgetPkgNameList_TEMPORARY_API pkgnames = WidgetDAO::getPkgnameList_TEMPORARY_API();
RUNNER_ASSERT(pkgnames.size() >= 3);
}
RUNNER_ASSERT(list.size() >= 3);
RUNNER_ASSERT_MSG(!!list.front(), "widget dao exists");
WidgetDAOReadOnlyPtr dao = list.front();
- RUNNER_ASSERT_MSG(!dao->getPkgname().IsNull(), "dao object do not have tizen id");
}
/*