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>
30 using namespace InstallerWrapper;
32 ////////////////////////////////////////////////////////////////////////////////
34 RUNNER_TEST_GROUP_INIT(Manifest)
37 Name: creatingManifestFile
38 Description: Creation of manifest file by wrt-installer test
39 Expected: file should be created and installed by wrt-installer. Content should
42 RUNNER_TEST(creatingManifestFile)
44 const char * manifestPath = "/opt/share/packages/manifest01.xml";
45 /* This widget removal should stay here in case previous test run failed
46 * (so widget has not been uninstalled) */
47 uninstallByGuid("http://test.samsung.com/widget/manifestTest");
49 RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId)
50 == InstallerWrapper::Success);
51 RUNNER_ASSERT(WrtUtilFileExists(manifestPath));
52 ManifestFile mf(manifestPath);
56 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@package")
58 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@type")
60 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@version")
62 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:label")
63 == "Manifest Example");
65 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@email")
66 == "manifest@misc.test.create.desktop.com");
67 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@href")
68 == "http://misc.test.create.desktop.com");
69 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author")
72 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@appid")
74 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay")
76 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@type")
78 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@extraid")
79 == "http://test.samsung.com/widget/manifestTest");
80 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage")
83 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:icon")
86 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[not(@xml:lang)]")
87 == "Manifest Example");
88 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de_DE']")
89 == "Manifest Beispiel");
90 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en_US']")
91 == "Manifest Example");
92 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pl']")
93 == "Przykład Manifest");
94 RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt_PT']")
95 == "Exemplo manifesto");
97 Catch(ManifestFile::ManifestParseError)
99 RUNNER_ASSERT_MSG(false,DPL::Exception::KnownExceptionToString(_rethrown_exception));
101 /* If test finished sucessfully than uninstall test widget */