telephonyserverplugins/multimodetsy/test/Te_LoopBack/Te_LoopbackTestStepBase.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 // This file contains the base test class CTestBase which is derived from CTestStep.
       
    15 // It also contains the script list enumeration (TScriptList).  This file should be
       
    16 // included by all test specific include files.
       
    17 // 
       
    18 //
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23 */
       
    24 
       
    25 #ifndef __TE_LOOPBACK_TESTSTEP_BASE__
       
    26 #define __TE_LOOPBACK_TESTSTEP_BASE__
       
    27 
       
    28 #include <test/testexecutestepbase.h>
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <e32test.h>
       
    32 #include <etelmm.h>   
       
    33 
       
    34 #define PHONE_NAME	_L("GsmPhone1")
       
    35 #define MODULE_NAME	_L("MM")
       
    36 
       
    37 //Test Checking Macros
       
    38 #define CHECKPOINT(code,expected,msg){\
       
    39 	TEST((code)==(expected));\
       
    40 	if (code != expected ) INFO_PRINTF1(msg);\
       
    41 	}
       
    42 
       
    43 #define CHECKPOINT_EXPR(boolexpr,msg) {\
       
    44 	TEST((boolexpr));\
       
    45 	if (EFalse == (boolexpr)) INFO_PRINTF1(msg);\
       
    46 	}
       
    47 
       
    48 
       
    49 // TScriptList is a list of all the test scripts available to the regression test harness.
       
    50 // This list must be modified to add another test script.  These are mapped to script names
       
    51 // by a switch statement in the StartScriptL function (StartThread.cpp)
       
    52 enum TScriptList
       
    53 	{
       
    54 	ERxMessScript,						//< Simple SMS Receive and SMS CMTI Notification Tests  (see Crxmess.h) 
       
    55 	ENoPduRxMessScript,					//< Modem claims No SMS PDU Capability Test  (see CNoPduRxMess.h)
       
    56 	ERxMessCmtScript,					//< CMT SMS Rx and SMS CMT Notification and Rx Tests  (see Crxmess.h)
       
    57 	ERxMessCmtAndCmtiScript,			//< CMT and CMTI SMS Rx Tests  (see Crxmess.h)
       
    58 	ERxMessEricssonT28Script,			//< CMTI SMS Rx Test emulating an Ericsson T28  (see Crxmess.h)
       
    59 	EScaSimpleScript,					//< Simple SCA retrieval and setting test  (see CSca.h)
       
    60 	ESca8210StyleScript,				//< 8210-style SCA retrieval and setting test  (see CSca.h)
       
    61 	ETxMessScript,						//< Simple SMS Tx Test (see Ctxmess.h)
       
    62 	ETxMessNewStdScript,				//< New Standard SMS Tx Test (see Ctxmess.h)
       
    63 	ETxMessT28NewStdScript,				//< New Standard SMS Tx Test emulating an Ericsson T28  (see Ctxmess.h)
       
    64 	ETxMessScriptNoprefixNodefscaNew,	//< Tx Test, No PDU Prefix, No Default SCA Set, New Standard  (see Ctxmess.h)
       
    65 	ETxMessScriptPrefixNodefscaNew,		//< Tx Test, PDU Prefix, No Default SCA Set, New Standard  (see Ctxmess.h)
       
    66 	ETxMessScriptNoprefixDefscaNew,		//< Tx Test, No PDU Prefix, Default SCA Set, New Standard  (see Ctxmess.h)
       
    67 	ETxMessScriptPrefixDefscaNew,		//< Tx Test, PDU Prefix, Default SCA Set, New Standard  (see Ctxmess.h)
       
    68 	ETxMessScriptNoprefixNodefscaOld,	//< Tx Test, No PDU Prefix, No Default SCA Set, Old Standard  (see Ctxmess.h)
       
    69 	ETxMessScriptPrefixNodefscaOld,		//< Tx Test, PDU Prefix, No Default SCA Set, Old Standard  (see Ctxmess.h)
       
    70 	ETxMessScriptNoprefixDefscaOld,		//< Tx Test, No PDU Prefix, Default SCA Set, Old Standard  (see Ctxmess.h)
       
    71 	ETxMessScriptPrefixDefscaOld,		//< Tx Test, PDU Prefix, Default SCA Set, Old Standard  (see file Ctxmess.h)
       
    72 	ETxMessRxTxScriptA,					//< Test a +CMS ERROR 321 from a Read - observed on Ericsson 888 (see Ctxmess.h) 
       
    73 	EDataCallScript,					//< Dial a Simple Data Call (see CDataCall.h)
       
    74 	EDataCallErrorAScript,				//< Dial a Simple Data Call with Modem ERRORing some command (see CDataCall.h)
       
    75 	EOddInitAScript,					//< Test of an odd initialization sequence (see COddInits.h) 
       
    76 	EOddInitBScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    77 	EOddInitCScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    78 	EOddInitDScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    79 	EOddInitEScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    80 	EOddInitFScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    81 	EOddInitGScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    82 	EOddInitHScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    83 	EOddInitIScript,					//< Test of an odd initialization sequence (see COddInits.h)
       
    84 	EMessStorOldSmsStdScript,			//< Test Message Storage Functions with Old Standard PDUs (see CMessStor.h)
       
    85 	EMessStorNewSmsStdScript,			//< Test Message Storage Functions with New Standard PDUs (see CMessStor.h)
       
    86 	EFailInitAScript,					//< Test Initialization Failure Scenarios (see CFailInits.h)
       
    87 	EInCallScriptA,						//< Test Incoming Call Scenarios (see CInCall.h)
       
    88 	EInCallScriptB,						//< Test Incoming Call Scenarios with a Nokia (see CInCall.h)
       
    89 	ESmsCancelScript,					//< Test SMS Cancel CMT Scenarios  (see CSmsCancel.h)
       
    90 	ESmsCancelCmtiScript,				//< Test SMS Cancel CMTI Scenarios (see CSmsCancel.h)
       
    91 	EShutdownScript,					//< Test Shutdown Scenarios (see CShutdown.h)
       
    92 	EShutdownScriptA,					//< Test Shutdown Scenario A (see CShutdown.h)
       
    93 	ESmsStorageDeleteScript,			//< Simple SMS Storage Delete Test (see CSmsDelete.h) 
       
    94 	ESsFaxScriptA,						//< Test Simultaneous Fax Rx and Signal Strength Retrieval (see CSsFax.h)
       
    95 	ESsDataScriptA,						//< Test Simultaneous Data Call and Signal Strength Retrieval (see CSsFax.h)
       
    96 	EDataCallCancelScript,				//< Test Data Call Cancel Scenarios (see CDataCallCancel.h)
       
    97 	EFaxPremCloseScriptA,				//< Test Fax Premature Close Scenarios (see CFaxPremClose.h)
       
    98 	EFaxPremCloseScriptB,				//< Test Fax Premature Close Scenarios Part B (see CFaxPremClose.h)
       
    99 	ETwoFaxRxScriptA,					//< Test Two Fax Reception Scenarios (see CTwoFaxRx.h)
       
   100 	EVoiceCallScriptA,					//< Test Voice Call Scenarios (see CVoiceCall.h)
       
   101 	EDataCallRemoteTermScript,			//< Test Data Call Set-up, Data Transfer and Remote Termination (see CDataCallRemoteTerm.H)
       
   102 	EDataCallCallBackScript,			//< Test Data Call Dial-up Networking Call-back (see CDataCallCallBack.H)
       
   103 	EDataCallRemoteHangDialScript,		//< Test Data Call Answer and Remote Hang-up Closely Followed by a Dial (see CDataCallRemoteHangupDial.H)
       
   104 	EPhoneBookScript,
       
   105 	ENetworkRegistrationScript,
       
   106 	EPhoneLineScript, 
       
   107 	EAllCallsScript,
       
   108 	ENoCnmiScript,
       
   109 	ENoCmgfScript,
       
   110 	EOOMVoiceCall,
       
   111         ECallDiffParamScript,
       
   112 	ECbstParseScript,
       
   113 	ECGQREQResponsesScript,
       
   114 	EUnsolicitedScript
       
   115 	};
       
   116 
       
   117 // TThreadData is a stucture containing the TScriptList value and the Call Delay value 
       
   118 // to be used to pass information to the Responder Thread to identify the scripts and the 
       
   119 // EWait's varialble delay value (i.e., when required) to be used for the test in the regression test harness.
       
   120 typedef struct threadData_s
       
   121 	{
       
   122 	TScriptList			iScriptList;
       
   123 	TInt				iVariableDelay;
       
   124 	TRequestStatus**	iRestartReqStat;
       
   125 	} TThreadData;
       
   126 
       
   127 /**
       
   128  * This is the base test class, derived from CTestStep, that is the super-class of all test 
       
   129  * specific test classes.  This class "glues" the user interface (from RunTest), the ETel API
       
   130  * (from DriveEtelApi), and the Modem Emulation (from StartEmulator) together.
       
   131  */
       
   132 class CTestBase : public CTestStep
       
   133 	{
       
   134 public:
       
   135 	CTestBase();
       
   136 	//> left for backward compatibility
       
   137 	void ConstructL(){}; 
       
   138 	~CTestBase();
       
   139 
       
   140 	// Called by the User Interface executable to invoke the selected test.
       
   141 	virtual TInt RunTestL()=0;
       
   142  	virtual TVerdict doTestStepPreambleL( void );
       
   143 	virtual TVerdict doTestStepPostambleL( void );
       
   144 	virtual TVerdict doTestStepL( void ) ; 
       
   145 	void RestartScript();
       
   146 	void TerminateScript();
       
   147 protected:
       
   148 	TInt StartEmulatorL();
       
   149 
       
   150 	// Called by StartEmulator after spawning modem emulator to drive the ETel API in specific test.
       
   151 	virtual TInt DriveETelApiL()=0;
       
   152 	TScriptList  iCurrentScript;	//< Identifies to emulator which test is being run 
       
   153 	TInt         iVariableDelay;	//< Variable delay value to be used as the timeout by the 
       
   154 									//< ...script processing when the iParam value is set -1 in 
       
   155 	RTelServer iServer;
       
   156 	RTelServer iServer2;
       
   157 	RMobilePhone iPhone;		
       
   158 	RMobilePhone iPhone2;
       
   159 									//< ...a TScript script whose iCommand is an EWait.
       
   160 	TRequestStatus* iRestartReqStat;	//< The Request Status of the script restart signal
       
   161 private:
       
   162 	CActiveScheduler* iTestScheduler;
       
   163 	RThread iScriptThread;
       
   164 	TProcessPriority  iOrgProcessPriority;
       
   165 	TThreadPriority  iOrgThreadPriority;
       
   166 	};
       
   167 
       
   168 #endif