videofeeds/server/tsrc/VCXServiceManagementApiTest/inc/IptvServiceManagementApiTest.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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:   ?Description*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IPTVSERVICEMANAGEMENTAPITEST_H
       
    21 #define IPTVSERVICEMANAGEMENTAPITEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <StifLogger.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <StifTestModule.h>
       
    27 #include "CIptvServiceManagementSync.h"
       
    28 #include <badesca.h>
       
    29 
       
    30 #include "CIptvService.h"
       
    31 #include "MIptvServiceManagementClientObserver.h"
       
    32 
       
    33 // CONSTANTS
       
    34 const TInt32 KNoFilter = 0;
       
    35 const CIptvServiceManagementClient::TOrder KNoSort = CIptvServiceManagementClient::EDateAscending;
       
    36 const TInt KLastServiceInDb = 60000;
       
    37 
       
    38 _LIT(K2kLongUrl, "http://193.65.182.78/misc/2kcharslongpath/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpat/256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslongpath256charslo/123456.xml");
       
    39 _LIT(K256charsLongSearchUrl, "http://193.65.182.78/search.php?file=nseries.xml&q=#search#&256charslongsearchurl___charslongsearchurl___charslongsearchurl___charslongsearchurl___charslongsearchurl___charslongsearchurl___charslongsearchurl___charslongsearchurl___charslongsearchurl___1X");
       
    40 _LIT(K256LongFile, "http://193.65.182.78/misc/256charslongfilenames/256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslongfilename256charslon.xml");
       
    41 
       
    42 // Logging path
       
    43 _LIT( KIptvServiceManagementApiTestLogPath, "\\logs\\testframework\\IptvServiceManagementApiTest\\" );
       
    44 // Log file
       
    45 _LIT( KIptvServiceManagementApiTestLogFile, "IptvServiceManagementApiTest.txt" );
       
    46 
       
    47 // MACROS
       
    48 
       
    49 // FUNCTION PROTOTYPES
       
    50 
       
    51 // FORWARD DECLARATIONS
       
    52 
       
    53 class CIptvServiceManagementApiTest;
       
    54 class CIptvTestUtilities;
       
    55 class CIptvServiceManagementSync;
       
    56 class CIptvTestMobilecrashWatcher;
       
    57 class CIptvServiceInfo;
       
    58 class CIptvTestServiceStore;
       
    59 class CIptvTestUtilALR;
       
    60 
       
    61 // DATA TYPES
       
    62 #define ESucceeded          MIptvServiceManagementClientObserver::ESucceeded
       
    63 #define EServiceNotFound    MIptvServiceManagementClientObserver::EServiceNotFound
       
    64 #define EGeneralError       MIptvServiceManagementClientObserver::EGeneralError
       
    65 
       
    66 // CLASS DECLARATION
       
    67 
       
    68 /**
       
    69 *  CIptvServiceManagementApiTest test class for STIF Test Framework TestScripter.
       
    70 *
       
    71 *
       
    72 *  @lib ?library
       
    73 *  @since ?Series60_version
       
    74 */
       
    75 NONSHARABLE_CLASS(CIptvServiceManagementApiTest) : public CScriptBase
       
    76     {
       
    77     public:  // Constructors and destructor
       
    78 
       
    79         /**
       
    80         * Two-phased constructor.
       
    81         */
       
    82         static CIptvServiceManagementApiTest* NewL( CTestModuleIf& aTestModuleIf );
       
    83 
       
    84         /**
       
    85         * Destructor.
       
    86         */
       
    87         virtual ~CIptvServiceManagementApiTest();
       
    88 
       
    89         /**
       
    90         * TServiceFieldId
       
    91         */
       
    92         enum TServiceFieldId
       
    93             {
       
    94             EId = 0, // TUint32
       
    95             EName,
       
    96             EAddress,
       
    97             EIconPath,
       
    98             EEpgPluginUid, // TUid
       
    99             EVodPluginUid, // TUid
       
   100             EIptvPluginUid, // TUid
       
   101             EServiceType, // TServiceType
       
   102             ESetIapList, // TInt count of iaps
       
   103             EUserName,
       
   104             EPassword,
       
   105             EDesc,
       
   106             EFlags,
       
   107             EApplicationUid, // TInt32
       
   108             EDisplayOrder, // TUint32
       
   109             EProviderId, // TDesC
       
   110             EAccountManagementUrl,
       
   111             EScheduleDlTime,
       
   112             EScheduleDlNetwork,
       
   113             EScheduleDlType,
       
   114             EScheduleLastDlTime, // time used is the current time
       
   115             ESearchUrl // TDesC
       
   116             };
       
   117 
       
   118         /**
       
   119         * TScheduleDlType
       
   120         */
       
   121         enum  TScheduleDlType
       
   122             {
       
   123             EIptvTestNoDownload          = 0,
       
   124             EIptvTestDownloadLatest      = 1,
       
   125             EIptvTestDownloadOldest      = 2,
       
   126             EIptvTestDownloadAddedAfterLastScheduledDownload = 3,
       
   127             EIptvTestDownloadAll         = 4
       
   128             };
       
   129 
       
   130     public: // New functions
       
   131 
       
   132     public: // Functions from base classes
       
   133 
       
   134         /**
       
   135         * From CScriptBase Runs a script line.
       
   136         * @since
       
   137         * @param aItem Script line containing method name and parameters
       
   138         * @return Symbian OS error code
       
   139         */
       
   140         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   141 
       
   142     protected:  // New functions
       
   143 
       
   144     protected:  // Functions from base classes
       
   145 
       
   146     private:
       
   147 
       
   148         /**
       
   149         * C++ default constructor.
       
   150         */
       
   151         CIptvServiceManagementApiTest( CTestModuleIf& aTestModuleIf );
       
   152 
       
   153         /**
       
   154         * By default Symbian 2nd phase constructor is private.
       
   155         */
       
   156         void ConstructL();
       
   157 
       
   158         /**
       
   159         * Frees all resources allocated from test methods.
       
   160         */
       
   161         void Delete();
       
   162 
       
   163         /**
       
   164         * Test methods are listed below.
       
   165         */
       
   166 
       
   167         virtual TInt CreateL( CStifItemParser& aItem );
       
   168         virtual TInt DestroyL( CStifItemParser& aItem );
       
   169 
       
   170         virtual TInt AddHardCodedServiceL( CStifItemParser& aItem );
       
   171         virtual TInt UpdateServiceFieldL( CStifItemParser& aItem );
       
   172         virtual TInt UpdateServiceL( CStifItemParser& aItem );
       
   173         virtual TInt DeleteServiceL( CStifItemParser& aItem );
       
   174         virtual TInt DeleteAllServicesL( CStifItemParser& aItem );
       
   175         virtual TInt GetServicesL( CStifItemParser& aItem );
       
   176         virtual TInt GetServicesByProviderIdL( CStifItemParser& aItem );
       
   177         virtual TInt GetAllSelectedServicesL( CStifItemParser& aItem );
       
   178         virtual TInt GetServicesFilteredL( CStifItemParser& aItem );
       
   179         virtual TInt GetServicesByTypeL( CStifItemParser& aItem );
       
   180         virtual TInt ShutdownServerL( CStifItemParser& aItem );
       
   181         virtual TInt SetUsedIap( CStifItemParser& aItem );
       
   182         virtual TInt GetUsedIap( CStifItemParser& aItem );
       
   183         virtual TInt ClearUsedIapL(CStifItemParser& aItem );
       
   184         virtual TInt SetAllIapsL( CStifItemParser& aItem );
       
   185         virtual TInt SetConnectionAllowedL( CStifItemParser& aItem );
       
   186         virtual TInt IsConnectionAllowedL( CStifItemParser& aItem );
       
   187         virtual TInt VerifyServerIsShutdownL( CStifItemParser& aItem );
       
   188 
       
   189         virtual TInt RepeatNextRequest( CStifItemParser& aItem );
       
   190         virtual TInt SetSpecialAction( CStifItemParser& aItem );
       
   191 
       
   192         /**
       
   193         * Dummy method for old test methods which do nothing but are still called from security tests (nobody updates 'em).
       
   194         */
       
   195         virtual TInt Dummy( CStifItemParser& /*aItem*/ );
       
   196 
       
   197         /**
       
   198         * Helper funtions
       
   199         */
       
   200 
       
   201         /**
       
   202         * Deallocates resources used by test module.
       
   203         */
       
   204         void DeAllocateResources();
       
   205 
       
   206         /**
       
   207         * Gets IAP id from CommDb.
       
   208         * @since
       
   209         * @param aIndex
       
   210         * @param aIapId
       
   211         * @return Symbian OS error code.
       
   212         */
       
   213         TInt GetCommDbIapIdByOrder(TInt aIndex, TUint32& aIapId);
       
   214 
       
   215         /**
       
   216         * These methods are in CIptvServiceManagementLogic.cpp
       
   217         */
       
   218 
       
   219         /**
       
   220         * TestUpdateService
       
   221         * @since
       
   222         * @param aConn
       
   223         * @param aIdDestination
       
   224         * @param aIdSource
       
   225         * @return Symbian OS error code.
       
   226         */
       
   227         TInt TestUpdateService(CIptvServiceManagementSync::TIptvSmTestConnection aConn, TInt aIdDestination, TInt aIdSource);
       
   228 
       
   229         /**
       
   230         * IsServiceInDb
       
   231         * @since
       
   232         * @param aId
       
   233         * @return ETrue if service is found from the database.
       
   234         */
       
   235         TBool IsServiceInDb(TInt aId);
       
   236 
       
   237         /**
       
   238         * GetHardcodedService
       
   239         * @since
       
   240         * @param aHardcodedServiceNameOrID
       
   241         * @param aIapName
       
   242         * @return Instance to service. Ownwership moves to caller.
       
   243         */
       
   244         CIptvService* GetHardcodedService(TDesC& aHardcodedServiceNameOrID, TDesC& aIapName);
       
   245 
       
   246         /**
       
   247         * GetHardcodedService
       
   248         * @since
       
   249         * @param aHardcodedServiceNameOrID
       
   250         * @param aIapsToAdd
       
   251         * @return Instance to service. Ownwership moves to caller.
       
   252         */
       
   253         CIptvService* GetHardcodedService(TDesC& aHardcodedServiceNameOrID, TInt aIapsToAdd);
       
   254 
       
   255         /**
       
   256         * Gets service id
       
   257         * @param aItem next parameter in aItem should have service ID or service name
       
   258         * @param aServiceId will contain the specified service's ID as a result
       
   259         * @param aServiceName will contain the specified service's name as a result
       
   260         * @return Symbian OS error code.
       
   261         */
       
   262         TInt GetServiceIdFromParam(CStifItemParser& aItem, TInt& aServiceId, TDes& aServiceName);
       
   263 
       
   264         /**
       
   265         * InitHardcodedServicesL
       
   266         * @since
       
   267         * @return Symbian OS error code.
       
   268         */
       
   269         TInt InitHardcodedServicesL();
       
   270 
       
   271     public:     // Data
       
   272 
       
   273     protected:  // Data
       
   274 
       
   275     private:    // Data
       
   276         // Instance of CIptvTestMobilecrashWatcher
       
   277         CIptvTestMobilecrashWatcher* iIptvTestMobilecrashWatcher;
       
   278 
       
   279         //Instance of the servicemanagement API
       
   280         CIptvServiceManagementSync*   iIptvServiceManagementSync;
       
   281 
       
   282         //Instance of testutility class
       
   283         CIptvTestUtilities* iIptvTestUtilities;
       
   284 
       
   285         // Array which holds the hardcoded test services.
       
   286         RPointerArray<CIptvServiceInfo> iHardcodedServices;
       
   287 
       
   288         // Array holding known IAP IDs from CommDb
       
   289         CArrayFix<TUint32> *iIapNumList;
       
   290 
       
   291         // Counter which is incremented when NEXT hardcoded service is asked from STIF script.
       
   292         TInt iHardCodedServiceCounter;
       
   293 
       
   294         CIptvTestServiceStore* iServiceStore;
       
   295 
       
   296         // Sets the iap to highest priority when used iap is set.
       
   297         CIptvTestUtilALR* iAlrUtil;
       
   298     };
       
   299 
       
   300 #endif      // IPTVSERVICEMANAGEMENTAPITEST_H
       
   301 
       
   302 // End of File