controlpanel/tsrc/unit/ut_cppluginloader/src/ut_cppluginloader.cpp
branchRCL_3
changeset 54 7e0eff37aedb
parent 53 8ee96d21d9bf
child 57 e78c61e77b1a
equal deleted inserted replaced
53:8ee96d21d9bf 54:7e0eff37aedb
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *       test application for qt control panel public apis.
       
    16 */
       
    17 
       
    18 #include "ut_cppluginloader.h"
       
    19 #include "cppluginloader.h"
       
    20 
       
    21 #include <QtTest/QtTest>
       
    22 
       
    23 
       
    24 /*!
       
    25     \class TestCpPluginLoader
       
    26     \brief The TestCpPluginLoader class is designed for the unit testing for CpPluginLoader class.
       
    27     This unit test is supported by QTest.
       
    28     There are total 6 test cases in this unit.
       
    29  */
       
    30 
       
    31 void TestCpPluginLoader::initTestCase()
       
    32     {
       
    33     }
       
    34 
       
    35 void TestCpPluginLoader::cleanupTestCase()
       
    36     {
       
    37     QCoreApplication::processEvents();
       
    38     }
       
    39 
       
    40 /*!
       
    41  * Test Case Description:\n &nbsp;
       
    42  * 1. Fucntion Name: loadCpPluginInterface() \n&nbsp;
       
    43    2. Function Descrition: \n &nbsp;&nbsp;
       
    44         load a plugin file, which is derived from CpPluginInterface class.\n&nbsp;
       
    45    3. Input Parameters: cpcfg file name. \n&nbsp;
       
    46    4. Expected result: \n&nbsp;&nbsp;
       
    47        case run without verify failed.\n 
       
    48  */
       
    49 void TestCpPluginLoader::testLoadCpPluginInterfaceWithCpcfgFilename()
       
    50     {
       
    51     CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("testplugin.cpcfg");
       
    52     QVERIFY(plugin != 0);
       
    53     }
       
    54 
       
    55 /*!
       
    56  * Test Case Description:\n &nbsp;
       
    57  * 1. Fucntion Name: loadCpPluginInterface() \n&nbsp;
       
    58    2. Function Descrition: \n &nbsp;&nbsp;
       
    59         load a plugin file, which is derived from CpPluginInterface class.\n&nbsp;
       
    60    3. Input Parameters: absolute path of cpcfg file name. \n&nbsp;
       
    61    4. Expected result: \n&nbsp;&nbsp;
       
    62        case run without verify failed.\n 
       
    63  */
       
    64 void TestCpPluginLoader::testLoadCpPluginInterfaceWithAbsoluteQtpluginPath()
       
    65     {
       
    66     CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("/resource/qt/plugins/controlpanel/testplugin.qtplugin");
       
    67     QVERIFY(plugin != 0);
       
    68     }
       
    69 
       
    70 /*!
       
    71  * Test Case Description:\n &nbsp;
       
    72  * 1. Fucntion Name: loadCpPluginInterface() \n&nbsp;
       
    73    2. Function Descrition: \n &nbsp;&nbsp;
       
    74         load a plugin file, which is derived from CpPluginInterface class.\n&nbsp;
       
    75    3. Input Parameters: qtplugin file name. \n&nbsp;
       
    76    4. Expected result: \n&nbsp;&nbsp;
       
    77        case run without verify failed.\n 
       
    78  */
       
    79 void TestCpPluginLoader::testLoadCpPluginInterfaceWithQtpluginFilename()
       
    80     {
       
    81     CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("testplugin.qtplugin");
       
    82     QVERIFY(plugin != 0);
       
    83     }
       
    84 
       
    85 /*!
       
    86  * Test Case Description:\n &nbsp;
       
    87  * 1. Fucntion Name: loadCpLauncherInterface() \n&nbsp;
       
    88    2. Function Descrition: \n &nbsp;&nbsp;
       
    89         load a plugin file, which is derived from CpLauncherInterface class.\n&nbsp;
       
    90    3. Input Parameters: defined cpcfg file name. \n&nbsp;
       
    91    4. Expected result: \n&nbsp;&nbsp;
       
    92        case run without verify failed.\n 
       
    93  */
       
    94 void TestCpPluginLoader::testLoadCpLauncherInterfaceWithCpcfgFilename()
       
    95     {
       
    96     CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("testplugin.cpcfg");
       
    97     QVERIFY(plugin != 0);
       
    98     }
       
    99 
       
   100 /*!
       
   101  * Test Case Description:\n &nbsp;
       
   102  * 1. Fucntion Name: loadCpLauncherInterface() \n&nbsp;
       
   103    2. Function Descrition: \n &nbsp;&nbsp;
       
   104         load a plugin file, which is derived from CpLauncherInterface class.\n&nbsp;
       
   105    3. Input Parameters: absolute path of a user defined qtplugin file name. \n&nbsp;
       
   106    4. Expected result: \n&nbsp;&nbsp;
       
   107        case run without verify failed.\n 
       
   108  */
       
   109 void TestCpPluginLoader::testLoadCpLauncherInterfaceWithAbsoluteQtpluginFilename()
       
   110     {
       
   111     CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("/resource/qt/plugins/controlpanel/testplugin.qtplugin");
       
   112     QVERIFY(plugin != 0);
       
   113     }
       
   114 
       
   115 /*!
       
   116  * Test Case Description:\n &nbsp;
       
   117  * 1. Fucntion Name: loadCpLauncherInterface() \n&nbsp;
       
   118    2. Function Descrition: \n &nbsp;&nbsp;
       
   119         load a plugin file, which is derived from CpLauncherInterface class.\n&nbsp;
       
   120    3. Input Parameters: qtplugin file name. \n&nbsp;
       
   121    4. Expected result: \n&nbsp;&nbsp;
       
   122        case run without verify failed.\n 
       
   123  */
       
   124 void TestCpPluginLoader::testLoadCpLauncherInterfaceWithQtpluginFilename()
       
   125     {
       
   126     CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("testplugin.qtplugin");
       
   127     QVERIFY(plugin != 0);
       
   128     }
       
   129 
       
   130 QTEST_APPLESS_MAIN(TestCpPluginLoader)