[Release] wrt-installer_0.1.9
[platform/framework/web/wrt-installer.git] / tests / general / ManifestTests.cpp
similarity index 52%
rename from tests/general/TestCases.cpp
rename to tests/general/ManifestTests.cpp
index a0a978a..769bfa3 100644 (file)
  * @author  Karol Pawlowski (k.pawlowski@samsung.com)
  * @author  Tomasz Iwanek (t.iwanek@samsung.com)
  * @version 1.0
- * @brief   Miscellaneous test's bodies
+ * @brief   Manifest installation test's bodies
  */
 
 #include <string>
 #include <dpl/utils/wrt_utility.h>
 #include <dpl/test/test_runner.h>
-#include <dpl/log/log.h>
 #include <InstallerWrapper.h>
 #include <ManifestFile.h>
 
 using namespace InstallerWrapper;
 
-namespace {
-
-const std::string miscWidgetsStuff = "/opt/share/widget/tests/misc/";
-
-struct Result {
-    bool m_exc;
-    bool m_exd;
-    bool m_exs;
-    std::string message;
-    Result(bool exc = false, bool exd = false, bool exs = false)
-        : m_exc(exc), m_exd(exd), m_exs(exs) {}
-};
-
-}
-
 ////////////////////////////////////////////////////////////////////////////////
 
 RUNNER_TEST_GROUP_INIT(Manifest)
@@ -117,130 +101,3 @@ RUNNER_TEST(creatingManifestFile)
     /* If test finished sucessfully than uninstall test widget */
     uninstall(tizenId);
 }
-
-////////////////////////////////////////////////////////////////////////////////
-
-RUNNER_TEST_GROUP_INIT(BackgroundPage)
-
-/*
-Name: widgetWithBackgroundPage
-Description: Tests if widget with background page is installed correctly
-Expected: widget should be installed correctly
-*/
-RUNNER_TEST(widgetWithBackgroundPage)
-{
-    std::string tizenId;
-    RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/bg-00-with_bg.wgt",
-            tizenId) == InstallerWrapper::Success);
-    uninstall(tizenId);
-}
-
-/*
-Name: missingBackgroundFile
-Description: Tests if widget with declared in conifg background page
- but missing background file will be installed correctly.
-Expected: widget should NOT be installed
-*/
-RUNNER_TEST(missingBackgroundFile)
-{
-    std::string tizenId;
-    if(install(miscWidgetsStuff + "widgets/bg-01-missing_file.wgt",
-            tizenId) == InstallerWrapper::Success) {
-        uninstall(tizenId);
-        RUNNER_ASSERT_MSG(false, "Invalid widget package installed");
-    }
-}
-
-/*
-Name: widgetWithoutBackgroundPage
-Description: Complementary test to check if normal widget\
- without background page is successfully installed
-Expected: widget should be installed
-*/
-RUNNER_TEST(widgetWithoutBackgroundPage)
-{
-    std::string tizenId;
-    RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/bg-02-without_bg.wgt",
-            tizenId) == InstallerWrapper::Success);
-    uninstall(tizenId);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-RUNNER_TEST_GROUP_INIT(NonRootUser)
-
-/*
-Name: widgetNonRootInstallation
-Description: Check installation from other user than root
-Expected: widget should be installed
-*/
-RUNNER_TEST(widgetNonRootInstallation)
-{
-    std::string tizenId;
-    RUNNER_ASSERT(install(
-                miscWidgetsStuff + "widgets/nonroot.wgt",
-                tizenId,
-                "app") == InstallerWrapper::Success);
-    uninstall(tizenId);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-RUNNER_TEST_GROUP_INIT(NPluginsInstall)
-
-/*
-Name: pluginFilesAdded
-Description: Tests installation of plugins attached to widget
-Expected: widget should be succesfully installed
-*/
-RUNNER_TEST(pluginFilesAdded)
-{
-    std::string tizenId;
-    RUNNER_ASSERT(install(miscWidgetsStuff
-            + "widgets/inst_nplug_1.wgt", tizenId) == InstallerWrapper::Success);
-    uninstall(tizenId);
-}
-
-/*
-Name: emptyPluginsDir
-Description: Tests installation with empty 'plugins' directory
-Expected: widget should be not installed
-*/
-RUNNER_TEST(emptyPluginsDir)
-{
-    std::string tizenId;
-    if(install(miscWidgetsStuff + "widgets/inst_nplug_2.wgt",
-            tizenId) == InstallerWrapper::Success) {
-        uninstall(tizenId);
-        RUNNER_ASSERT_MSG(false, "Invalid widget package installed");
-    }
-}
-
-/*
-Name: pluginFileAndOtherFile
-Description: Tests installation with plugins directory and data files
-Expected: widget should be installed
-*/
-RUNNER_TEST(pluginFileAndOtherFile)
-{
-    std::string tizenId;
-    RUNNER_ASSERT(install(miscWidgetsStuff
-            + "widgets/inst_nplug_3.wgt", tizenId) == InstallerWrapper::Success);
-    uninstall(tizenId);
-}
-
-/*
-Name: pluginFileAndSubdir
-Description: Tests installation with 'plugins' directory and subdirectories
- inside plugin directory
-Expected: widget should be not installed
-*/
-RUNNER_TEST(pluginFileAndSubdir)
-{
-    std::string tizenId;
-    if(install(miscWidgetsStuff + "widgets/inst_nplug_4.wgt",
-            tizenId) == InstallerWrapper::Success) {
-        uninstall(tizenId);
-        RUNNER_ASSERT_MSG(false, "Invalid widget package installed");
-    }
-}