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>
34 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 = L"/opt/share/widget/tests/localization/widget1/";
44 static const DPL::String widget2Path = L"/opt/share/widget/tests/localization/widget2/";
46 } // anonymous namespace
48 RUNNER_TEST(test01_getFilePathInWidgetPackageFromUrl){
49 const int widgetHandle = 1;
50 WrtDB::WidgetDAO dao(widgetHandle);
51 //dao.setPath(widget1Path);
53 auto result = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
58 RUNNER_ASSERT(*result == L"/opt/share/widget/tests/localization/widget1/locales/pl-en/one");
61 RUNNER_TEST(test02_getFilePathInWidgetPackageFromUrl){
62 const int widgetHandle = 2;
63 WrtDB::WidgetDAO dao(widgetHandle);
64 //dao.setPath(widget2Path);
66 auto result = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
71 RUNNER_ASSERT(*result == L"/opt/share/widget/tests/localization/widget2/locales/pl-en/one");
74 RUNNER_TEST(test03_getFilePathInWidgetPackageFromUrl){
75 const int widgetHandle = 2;
76 WrtDB::WidgetDAO dao(widgetHandle);
77 //dao.setPath(widget2Path);
79 auto result = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
84 RUNNER_ASSERT(*result == L"/opt/share/widget/tests/localization/widget2/locales/en-en/two");
87 RUNNER_TEST(test04_getFilePathInWidgetPackage){
88 const int widgetHandle = 1;
89 WrtDB::WidgetDAO dao(widgetHandle);
90 //dao.setPath(widget1Path);
92 auto result = W3CFileLocalization::getFilePathInWidgetPackage(
97 RUNNER_ASSERT(*result == L"locales/pl-en/one");
100 RUNNER_TEST(test05_getFilePathInWidgetPackage){
101 const int widgetHandle = 2;
102 WrtDB::WidgetDAO dao(widgetHandle);
103 //dao.setPath(widget2Path);
105 auto result = W3CFileLocalization::getFilePathInWidgetPackage(
110 RUNNER_ASSERT(*result == L"locales/en-en/two");