supl/locationomasuplpostester/epos_comasuplpostestermodulecfg/inc/epos_comasuplpossessioncreationtest.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Tests creation of single POS session.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_COMASUPLPOSSESSIONCREATIONTEST_H
       
    19 #define C_COMASUPLPOSSESSIONCREATIONTEST_H
       
    20 
       
    21 #include <e32cmn.h>
       
    22 #include <ecom/implementationinformation.h>
       
    23 
       
    24 #include "epos_comasuplpostestercategory.h"
       
    25 
       
    26 class COMASuplPosTesterLogger;
       
    27 class COMASuplTestHandler;
       
    28 class COMASuplPosSessionBase;
       
    29 class COMASuplPosHandlerBase;
       
    30 
       
    31 /** Constant used for logging name of test*/
       
    32 _LIT8(KPosSessionCreationTest, "---------------POS Session Creation Test---------------");
       
    33 
       
    34 /** Constant used for logging information about test*/
       
    35 _LIT8(KPosSessionCreationTestComplete, "Info: POS Session Creation Test Complete.");
       
    36 
       
    37 /** Constant used for logging information about test*/
       
    38 _LIT8(KPosSessionCreationTestCancel, "Info: POS Session Creation Test Canceled.");
       
    39 
       
    40 /** Constant used for logging information about test*/
       
    41 _LIT8(KPosSessionCreationTestAborted, "Error: POS Session Creation Test Aborted");
       
    42 
       
    43 
       
    44 /**
       
    45  *  Tests creation of single POS session.
       
    46  *
       
    47  *  It creates a POS handler, initializes it, creates a pos session and 
       
    48  *  initializes it.
       
    49  *
       
    50  *  @lib epos_comasuplpostestermodulecfg.lib
       
    51  *  @since S60 v3.1
       
    52  */
       
    53 class COMASuplPosSessionCreationTest : public COMASuplPosTesterCategory
       
    54 	{
       
    55 	/**  Controls the case execution in RunL */
       
    56 	enum TExecutionSequence
       
    57 		{
       
    58 		EStartTest = 0,
       
    59 		EInitializeHandler,
       
    60 		ECreatePosSession,
       
    61 		EInitializeSession,
       
    62 		EPosSessionTestComplete
       
    63 		};
       
    64 	public:
       
    65 		static COMASuplPosSessionCreationTest* NewL(
       
    66 								CImplementationInformation& aImplInfo
       
    67 								, COMASuplPosTesterCategory* aCallBack = NULL);
       
    68 		virtual ~COMASuplPosSessionCreationTest();
       
    69 		
       
    70 	public:
       
    71 		/**
       
    72 	     * From COMASuplPosTesterCategory
       
    73 	     * Starts testing for the test class
       
    74 	     *
       
    75 	     * @since S60 v3.1
       
    76 	     */
       
    77 		void StartTestingL();
       
    78 	public:
       
    79 		/**
       
    80 	     * From COMASuplPosTesterCategory
       
    81 	     * Handles completion of asynchronous request
       
    82 	     *
       
    83 	     * @since S60 v3.1
       
    84 	     */
       
    85 		void RunL();
       
    86 		
       
    87 		/**
       
    88 	     * From COMASuplPosTesterCategory
       
    89 	     * Handles cancellation of asynchronous request
       
    90 	     *
       
    91 	     * @since S60 v3.1
       
    92 	     */
       
    93 		void DoCancel();
       
    94 		
       
    95 		/**
       
    96 	     * From COMASuplPosTesterCategory
       
    97 	     * Handles leave from RunL, aborts testing.
       
    98 	     *
       
    99 	     * @since S60 v3.1
       
   100 	     * @param aError Errorcode of leaving
       
   101 	     */
       
   102 		TInt  RunError(TInt aError);
       
   103 	private:
       
   104 		COMASuplPosSessionCreationTest(CImplementationInformation& aImplInfo
       
   105 									, COMASuplPosTesterCategory* aCallBack);
       
   106 		void ConstructL();
       
   107 	private:
       
   108 		//Not to be deleted in destructor
       
   109 		/**
       
   110 		 * Pointer to the implementation to be tested for session creation.
       
   111 		 * Not own.
       
   112 		 */
       
   113 		CImplementationInformation* iImplInfo;
       
   114 		
       
   115 		/**
       
   116 		 * Identifies the casr to be executed when RunL executes.
       
   117 		 */
       
   118 		TExecutionSequence iNextInSeq;
       
   119 		
       
   120 		/**
       
   121 		 * Pointer to COMASuplPosSessionBase objected created.
       
   122 		 * Own.
       
   123 		 */
       
   124 		COMASuplPosSessionBase* iSessionBase;
       
   125 		
       
   126 		/**
       
   127 		 * Pointer to COMASuplPosHandlerBase objected created.
       
   128 		 * Own.
       
   129 		 */
       
   130 		COMASuplPosHandlerBase* iPosHandler;
       
   131 		
       
   132 		/**
       
   133 		 * Pointer to MOMASuplObserver.
       
   134 		 * Not own.
       
   135 		 */
       
   136 		MOMASuplObserver* iSuplObserver;
       
   137 		
       
   138 		/**
       
   139 		 * Unique Id used to identify session.
       
   140 		 */
       
   141 		TInt iRequestID;
       
   142 	};
       
   143 #endif