2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * This file contains the declaration of widget dao class.
19 * @file test_suite01.cpp
20 * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
25 #include <dpl/log/log.h>
26 #include <dpl/test/test_runner.h>
28 //#include "mockup_include/dpl/wrt-dao-rw/widget_dao.h"
29 #include <dpl/wrt-dao-rw/widget_dao.h>
30 #include <dpl/localization/w3c_file_localization.h>
33 WrtDB::LanguageTagList generateLanguageTags()
35 WrtDB::LanguageTagList tags;
36 tags.push_back(L"pl-pl");
37 tags.push_back(L"en-en");
38 tags.push_back(L"pl-en");
42 static const WrtDB::LanguageTagList languageTags = generateLanguageTags();
43 static const DPL::String widget1Path =
44 L"/opt/share/widget/tests/localization/widget1/";
45 static const DPL::String widget2Path =
46 L"/opt/share/widget/tests/localization/widget2/";
47 } // anonymous namespace
49 RUNNER_TEST(test01_getFilePathInWidgetPackageFromUrl){
50 const int widgetHandle = 1;
51 WrtDB::WidgetDAO dao(widgetHandle);
52 //dao.setPath(widget1Path);
54 auto result = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
61 L"/opt/share/widget/tests/localization/widget1/locales/pl-en/one");
64 RUNNER_TEST(test02_getFilePathInWidgetPackageFromUrl){
65 const int widgetHandle = 2;
66 WrtDB::WidgetDAO dao(widgetHandle);
67 //dao.setPath(widget2Path);
69 auto result = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
76 L"/opt/share/widget/tests/localization/widget2/locales/pl-en/one");
79 RUNNER_TEST(test03_getFilePathInWidgetPackageFromUrl){
80 const int widgetHandle = 2;
81 WrtDB::WidgetDAO dao(widgetHandle);
82 //dao.setPath(widget2Path);
84 auto result = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
91 L"/opt/share/widget/tests/localization/widget2/locales/en-en/two");
94 RUNNER_TEST(test04_getFilePathInWidgetPackage){
95 const int widgetHandle = 1;
96 WrtDB::WidgetDAO dao(widgetHandle);
97 //dao.setPath(widget1Path);
99 auto result = W3CFileLocalization::getFilePathInWidgetPackage(
104 RUNNER_ASSERT(*result == L"locales/pl-en/one");
107 RUNNER_TEST(test05_getFilePathInWidgetPackage){
108 const int widgetHandle = 2;
109 WrtDB::WidgetDAO dao(widgetHandle);
110 //dao.setPath(widget2Path);
112 auto result = W3CFileLocalization::getFilePathInWidgetPackage(
117 RUNNER_ASSERT(*result == L"locales/en-en/two");