X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fgeneral%2FManifestTests.cpp;h=6b76d3a04ff5f6fa5afe048d9c131c40e3a8c2d6;hb=bb6a49cba8cf075304d971b519809b1816bc53ad;hp=769bfa3f2d16de7fb110f62f2a28f5bd58b52cdb;hpb=4c3a03cc7892389de60114e3ef3afff627fe919a;p=framework%2Fweb%2Fwrt-installer.git diff --git a/tests/general/ManifestTests.cpp b/tests/general/ManifestTests.cpp index 769bfa3..6b76d3a 100644 --- a/tests/general/ManifestTests.cpp +++ b/tests/general/ManifestTests.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using namespace InstallerWrapper; @@ -41,57 +42,76 @@ Expected: file should be created and installed by wrt-installer. Content should */ RUNNER_TEST(creatingManifestFile) { - const char * manifestPath = "/opt/share/packages/manifest01.xml"; + std::string manifestPath = "/opt/share/packages/"; /* This widget removal should stay here in case previous test run failed * (so widget has not been uninstalled) */ - uninstallByGuid("http://test.samsung.com/widget/manifestTest"); std::string tizenId; - RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId) - == InstallerWrapper::Success); - RUNNER_ASSERT(WrtUtilFileExists(manifestPath)); + + if(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId) + != InstallerWrapper::Success) + { + uninstall(tizenId); + RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId) + == InstallerWrapper::Success); + } + + RUNNER_ASSERT(WrtUtilFileExists(manifestPath.append(tizenId.substr(0,10)).append(".xml"))); ManifestFile mf(manifestPath); Try { + LogDebug("Package " << mf.getValueByXpath("/p:manifest/@package")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@package") - == "manifest01"); + == tizenId.substr(0,10)); + LogDebug("type " << mf.getValueByXpath("/p:manifest/@type")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@type") == "wgt"); + LogDebug("version " << mf.getValueByXpath("/p:manifest/@version")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@version") == "1.0"); + LogDebug("label " << mf.getValueByXpath("/p:manifest/p:label")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:label") == "Manifest Example"); + LogDebug("email " << mf.getValueByXpath("/p:manifest/p:author/@email")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@email") == "manifest@misc.test.create.desktop.com"); + LogDebug("href " << mf.getValueByXpath("/p:manifest/p:author/@href")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@href") == "http://misc.test.create.desktop.com"); + LogDebug("author " << mf.getValueByXpath("/p:manifest/p:author")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author") == "Manifest"); + LogDebug("appid " << mf.getValueByXpath("/p:manifest/p:ui-application/@appid")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@appid") - == "manifest01"); + == tizenId); + LogDebug("nodisplay " << mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay") == "false"); + LogDebug("type " << mf.getValueByXpath("/p:manifest/p:ui-application/@type")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@type") == "webapp"); + LogDebug("extraid " << mf.getValueByXpath("/p:manifest/p:ui-application/@extraid")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@extraid") == "http://test.samsung.com/widget/manifestTest"); + LogDebug("taskmanage " << mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage") == "true"); + LogDebug("icon " << mf.getValueByXpath("/p:manifest/p:ui-application/p:icon")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:icon") - == "manifest01.png"); + == (tizenId + ".png")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[not(@xml:lang)]") == "Manifest Example"); - RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de_DE']") + RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de-de']") == "Manifest Beispiel"); - RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en_US']") + RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en-us']") == "Manifest Example"); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pl']") == "Przykład Manifest"); - RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt_PT']") + RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt-pt']") == "Exemplo manifesto"); } Catch(ManifestFile::ManifestParseError)