2 * Copyright (c) 2013 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.
18 * @author Karol Pawlowski (k.pawlowski@samsung.com)
19 * @author Tomasz Iwanek (t.iwanek@samsung.com)
21 * @brief Manifest installation test's bodies
25 #include <dpl/utils/wrt_utility.h>
26 #include <dpl/test/test_runner.h>
27 #include <InstallerWrapper.h>
28 #include <ManifestFile.h>
29 #include <dpl/log/log.h>
31 using namespace InstallerWrapper;
33 ////////////////////////////////////////////////////////////////////////////////
35 RUNNER_TEST_GROUP_INIT(Manifest)
38 Name: creatingManifestFile
39 Description: Creation of manifest file by wrt-installer test
40 Expected: file should be created and installed by wrt-installer. Content should
43 RUNNER_TEST(creatingManifestFile)
45 std::string manifestPath = "/opt/share/packages/";
46 /* This widget removal should stay here in case previous test run failed
47 * (so widget has not been uninstalled) */
50 if(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId)
51 != InstallerWrapper::Success)
54 RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId)
55 == InstallerWrapper::Success);
58 RUNNER_ASSERT(WrtUtilFileExists(manifestPath.append(tizenId.substr(0,10)).append(".xml")));
59 ManifestFile mf(manifestPath);
63 LogDebug("Package " << mf.getValueByXpath("/p:manifest/@package"));
64 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@package")
65 == tizenId.substr(0,10));
66 LogDebug("type " << mf.getValueByXpath("/p:manifest/@type"));
67 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@type")
69 LogDebug("version " << mf.getValueByXpath("/p:manifest/@version"));
70 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@version")
72 LogDebug("label " << mf.getValueByXpath("/p:manifest/p:label"));
73 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:label")
74 == "Manifest Example");
76 LogDebug("email " << mf.getValueByXpath("/p:manifest/p:author/@email"));
77 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@email")
78 == "manifest@misc.test.create.desktop.com");
79 LogDebug("href " << mf.getValueByXpath("/p:manifest/p:author/@href"));
80 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@href")
81 == "http://misc.test.create.desktop.com");
82 LogDebug("author " << mf.getValueByXpath("/p:manifest/p:author"));
83 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author")
86 LogDebug("appid " << mf.getValueByXpath("/p:manifest/p:ui-application/@appid"));
87 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@appid")
89 LogDebug("nodisplay " << mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay"));
90 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay")
92 LogDebug("type " << mf.getValueByXpath("/p:manifest/p:ui-application/@type"));
93 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@type")
95 LogDebug("extraid " << mf.getValueByXpath("/p:manifest/p:ui-application/@extraid"));
96 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@extraid")
97 == "http://test.samsung.com/widget/manifestTest");
98 LogDebug("taskmanage " << mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage"));
99 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage")
102 LogDebug("icon " << mf.getValueByXpath("/p:manifest/p:ui-application/p:icon"));
103 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:icon")
104 == (tizenId + ".png"));
106 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[not(@xml:lang)]")
107 == "Manifest Example");
108 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de-de']")
109 == "Manifest Beispiel");
110 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en-us']")
111 == "Manifest Example");
112 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pl']")
113 == "Przykład Manifest");
114 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt-pt']")
115 == "Exemplo manifesto");
117 Catch(ManifestFile::ManifestParseError)
119 RUNNER_ASSERT_MSG(false,DPL::Exception::KnownExceptionToString(_rethrown_exception));
121 /* If test finished sucessfully than uninstall test widget */