commonappservices/alarmservertest/TestMultipleAlarmsSuite/inc/TestBaseStep.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Contains declaration of CTestBaseStep class, from which all the test steps
       
    15 // are derived
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef __TEST_BASE_STEP_H__
       
    20 #define __TEST_BASE_STEP_H__
       
    21 
       
    22 // User Includes
       
    23 #include "TestMultipleAlarmsServer.h"
       
    24 
       
    25 /*@{*/
       
    26 // Literal constant defined for identifying step name
       
    27 _LIT(KTestBaseStep, "TestBaseStep");
       
    28 /*@}*/
       
    29 
       
    30 /*@{*/
       
    31 // Literal constants defined for ini keys
       
    32 _LIT(KIniMaxAlarms, "maxalarms");
       
    33 _LIT(KIniAfter, "after");
       
    34 _LIT(KIniAt, "at");
       
    35 _LIT(KIniNumOfEntries, "numofentries");
       
    36 _LIT(KIniSubsections, "subsections");
       
    37 _LIT(KIniTypeOfEntry, "typeofentry");
       
    38 _LIT(KIniGUId, "guid");
       
    39 _LIT(KIniTypeOfAD, "typeofad");
       
    40 _LIT(KIniContentType, "contenttype");
       
    41 _LIT(KIniUrl, "url");
       
    42 _LIT(KIniMime, "mime");
       
    43 _LIT(KIniFileName, "filename");
       
    44 _LIT(KIniAlarmMessage, "message");
       
    45 _LIT(KIniAlarmSoundName, "alarmsoundname");
       
    46 _LIT(KIniIsPlaying, "isplaying");
       
    47 _LIT(KIniIsShowing, "isshowing");
       
    48 _LIT(KIniIsSnoozed, "issnoozed");
       
    49 _LIT(KIniExpectedCalls, "expectedcalls");
       
    50 _LIT(KIniAlarmMinsFromNow, "alarmminsfromnow");
       
    51 _LIT(KIniMinsToSnooze, "minstosnooze");
       
    52 _LIT(KIniDataReadTime, "datareadtime");
       
    53 _LIT(KIniNotificationTime, "notificationtime");
       
    54 _LIT(KIniClearAll, "clearall");
       
    55 /*@}*/	
       
    56 
       
    57 /*@{*/
       
    58 // Literal constant identifying a flag in the ini file
       
    59 _LIT(KYes, "yes");
       
    60 /*@}*/	
       
    61 
       
    62 /**
       
    63 The Base Test Step from which all other test steps are derived
       
    64 @internalTechnology
       
    65 @test
       
    66 */
       
    67 class CTestBaseStep : public CTestStep
       
    68 	{
       
    69 public:
       
    70 	// Construction
       
    71 	CTestBaseStep(CTestMultipleAlarmsServer& aTestServer);
       
    72 	
       
    73 	// Base class virtual
       
    74 	TVerdict 					doTestStepPostambleL();
       
    75 
       
    76 	CTestMultipleAlarmsServer*	TestServer();
       
    77 protected:
       
    78 	// Functions useful to sub-classes
       
    79 	TBool 						ReadStringsFromConfig(TRefByValue<const TDesC> aSection, ...);
       
    80 	TBool 						ReadIntsFromConfig(TRefByValue<const TDesC> aSection, ...);
       
    81 	void						IniProblem();
       
    82 	void 						PrintIfError(const TInt& aError);
       
    83 	void 						PrintIfError(const TDesC& aMessage, const TInt& aError);
       
    84 	void 						GetAlarmContentFromFileL(const TDesC& aFileName, HBufC8*& aAlarmContentBuf);
       
    85 	TBool 						GetBool(const TPtrC& aString);
       
    86 	TReal32 					GetTReal32(const TPtrC& aString);
       
    87 	void 						CheckAltSrvThreadDeathStatus();
       
    88 	void 						StartActiveSchedAndWaitL(TRequestStatus& aStatus);
       
    89 	void 						CheckTimeDifference(const TTime& aStartTime, const TTime& aEndTime, const TReal32 aMaxSecondsLimit);
       
    90 	CCalSession* 				CreateAndInitializeCalSessionL(const TBool& aCreateNewFile = EFalse);
       
    91 	CCalEntryView* 				CreateEntryViewL(CCalSession* aCalSession);
       
    92 	
       
    93 private:	
       
    94 	/** Test server reference for sharing data between test steps */
       
    95 	CTestMultipleAlarmsServer& iTestServer;
       
    96 	};
       
    97 
       
    98 #endif		// __TEST_BASE_STEP_H__