sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // The definitions of the Unit tests upon the CLoadManager class sl@0: // sl@0: // sl@0: sl@0: #ifndef __LOADMANAGERUNITTEST_H__ sl@0: #define __LOADMANAGERUNITTEST_H__ sl@0: sl@0: sl@0: #include sl@0: #include "LoadManagerStateAccessor.h" sl@0: #include "LoadManagerTransitionValidation.h" sl@0: #include "LoadManagerTransitions.h" sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: /** sl@0: @internalComponent sl@0: Comments : Unit Test for CreateAndDestroy on CLoadManager, the class under test. sl@0: */ sl@0: class CLoadManager_CreateAndDestroy_UnitTest : public CUnitTest sl@0: { sl@0: public: sl@0: /** sl@0: @fn NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Standard two-phase construction which leaves nothing on the sl@0: cleanup stack. sl@0: Error Condition : Leaves with the error code. sl@0: @leave KErrNoMemory sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @return CLoadManager_CreateAndDestroy_UnitTest* The constructed object. sl@0: @pre None. sl@0: @post CLoadManager_CreateAndDestroy_UnitTest is fully constructed, and initialised. sl@0: */ sl@0: static CLoadManager_CreateAndDestroy_UnitTest* NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn RunError(TInt aError) sl@0: Intended Usage : Intercept the panic caused by a RunL leave, sl@0: to restore the CLoadManager_CreateAndDestroy_UnitTest sl@0: object to a sensible state. sl@0: (called by the Active Scheduler immediately before the Panic). sl@0: Error Condition : @see CUnitTest::RunError(). sl@0: @since 7.0 sl@0: @return TInt KErrNone if cleanup successful, otherwise sl@0: @see CUnitTest::RunError() sl@0: @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed, and initialised. sl@0: @post The object has been restored to a sensible state. sl@0: */ sl@0: inline TInt RunError(TInt aError); sl@0: sl@0: /** sl@0: @fn ~CLoadManager_CreateAndDestroy_UnitTest() sl@0: Intended Usage : Standard Destructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed. sl@0: @post CLoadManager_CreateAndDestroy_UnitTest is fully destroyed. sl@0: */ sl@0: ~CLoadManager_CreateAndDestroy_UnitTest(); sl@0: sl@0: /** sl@0: @fn PrepareUnitTestL() sl@0: Intended Usage : Called by test framework just before test is run to allow sl@0: any test preparation to take place. sl@0: Error Condition : sl@0: @since 7.0 sl@0: @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed. sl@0: @post This unit test is ready to run. sl@0: */ sl@0: void PrepareUnitTestL(); sl@0: sl@0: private: sl@0: /** sl@0: @fn CLoadManager_CreateAndDestroy_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Default constructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @param aStateAccessor WhiteBox state access to the CLoadManager class. sl@0: @pre None. sl@0: @post CLoadManager_CreateAndDestroy_UnitTest is fully constructed. sl@0: */ sl@0: inline CLoadManager_CreateAndDestroy_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn void ConstructL() sl@0: Intended Usage : Second phase of safe two phase construction, sl@0: to complete the object initialisation. sl@0: Error Condition : Leaves with an error code. sl@0: @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). sl@0: @since 7.0 sl@0: @return None sl@0: @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed. sl@0: @post CLoadManager_CreateAndDestroy_UnitTest is fully initialised. sl@0: */ sl@0: inline void ConstructL(); sl@0: sl@0: /** sl@0: The context of the Unit Test. sl@0: i.e The CLoadManager class tested by this UnitTest's transitions. sl@0: */ sl@0: CLoadManager_UnitTestContext* iUTContext; sl@0: TLoadManager_StateAccessor* iStateAccessor; sl@0: /* Example c'tor and d'tor transition validators */ sl@0: TLoadManager_Ctor_TransitionValidator* iCtorValidator; sl@0: TLoadManager_Dtor_TransitionValidator* iDtorValidator; sl@0: }; // CLoadManager_CreateAndDestroy_UnitTest sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: /** sl@0: @internalComponent sl@0: Comments : Unit Test for FindInstantiationAndDestroy on CLoadManager, the class under test. sl@0: */ sl@0: class CLoadManager_FindInstantiationAndDestroy_UnitTest : public CUnitTest sl@0: { sl@0: public: sl@0: /** sl@0: @fn NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Standard two-phase construction which leaves nothing on the sl@0: cleanup stack. sl@0: Error Condition : Leaves with the error code. sl@0: @leave KErrNoMemory sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @return CLoadManager_FindInstantiationAndDestroy_UnitTest* The constructed object. sl@0: @pre None. sl@0: @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed, and initialised. sl@0: */ sl@0: static CLoadManager_FindInstantiationAndDestroy_UnitTest* NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn RunError(TInt aError) sl@0: Intended Usage : Intercept the panic caused by a RunL leave, sl@0: to restore the CLoadManager_FindInstantiationAndDestroy_UnitTest sl@0: object to a sensible state. sl@0: (called by the Active Scheduler immediately before the Panic). sl@0: Error Condition : @see CUnitTest::RunError(). sl@0: @since 7.0 sl@0: @return TInt KErrNone if cleanup successful, otherwise sl@0: @see CUnitTest::RunError() sl@0: @pre CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed, and initialised. sl@0: @post The object has been restored to a sensible state. sl@0: */ sl@0: inline TInt RunError(TInt aError); sl@0: sl@0: /** sl@0: @fn ~CLoadManager_FindInstantiationAndDestroy_UnitTest() sl@0: Intended Usage : Standard Destructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @pre CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. sl@0: @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully destroyed. sl@0: */ sl@0: ~CLoadManager_FindInstantiationAndDestroy_UnitTest(); sl@0: sl@0: void PrepareUnitTestL(); sl@0: sl@0: private: sl@0: /** sl@0: @fn CLoadManager_FindInstantiationAndDestroy_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Default constructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @param aStateAccessor WhiteBox state access to the CLoadManager class. sl@0: @pre None. sl@0: @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. sl@0: */ sl@0: inline CLoadManager_FindInstantiationAndDestroy_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn void ConstructL() sl@0: Intended Usage : Second phase of safe two phase construction, sl@0: to complete the object initialisation. sl@0: Error Condition : Leaves with an error code. sl@0: @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). sl@0: @since 7.0 sl@0: @return None sl@0: @pre CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. sl@0: @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully initialised. sl@0: */ sl@0: void ConstructL(); sl@0: sl@0: /** sl@0: The context of the Unit Test. sl@0: i.e The CLoadManager class tested by this UnitTest's transitions. sl@0: */ sl@0: CLoadManager_UnitTestContext* iUTContext; sl@0: TLoadManager_StateAccessor* iStateAccessor; sl@0: /* C'tor, d'tor, and method transition validators */ sl@0: TLoadManager_Ctor_TransitionValidator* iCtorValidator; sl@0: TLoadManager_InstantiationMethod_TransitionValidator* iInstantiationMethodValidator; sl@0: TLoadManager_DestroyThis_TransitionValidator* iDestroyThisValidator; sl@0: TLoadManager_Dtor_TransitionValidator* iDtorValidator; sl@0: }; // CLoadManager_FindInstantiationAndDestroy_UnitTest sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: /** sl@0: @internalComponent sl@0: Comments : Unit Test for Find Instantiation failure UnitTest on CLoadManager, the class under test. sl@0: */ sl@0: class CLoadManager_FindInstantiationFailure_UnitTest : public CUnitTest sl@0: { sl@0: public: sl@0: /** sl@0: @fn NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Standard two-phase construction which leaves nothing on the sl@0: cleanup stack. sl@0: Error Condition : Leaves with the error code. sl@0: @leave KErrNoMemory sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @return CLoadManager_FindInstantiationAndDestroy_UnitTest* The constructed object. sl@0: @pre None. sl@0: @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed, and initialised. sl@0: */ sl@0: static CLoadManager_FindInstantiationFailure_UnitTest* NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn RunError(TInt aError) sl@0: Intended Usage : Intercept the panic caused by a RunL leave, sl@0: to restore the CLoadManager_FindInstantiationAndDestroy_UnitTest sl@0: object to a sensible state. sl@0: (called by the Active Scheduler immediately before the Panic). sl@0: Error Condition : @see CUnitTest::RunError(). sl@0: @since 7.0 sl@0: @return TInt KErrNone if cleanup successful, otherwise sl@0: @see CUnitTest::RunError() sl@0: @pre CLoadManager_FindInstantiationFailure_UnitTest is fully constructed, and initialised. sl@0: @post The object has been restored to a sensible state. sl@0: */ sl@0: inline TInt RunError(TInt aError); sl@0: sl@0: /** sl@0: @fn ~CLoadManager_FindInstantiationFailure_UnitTest() sl@0: Intended Usage : Standard Destructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @pre CLoadManager_FindInstantiationFailure_UnitTest is fully constructed. sl@0: @post CLoadManager_FindInstantiationFailure_UnitTest is fully destroyed. sl@0: */ sl@0: ~CLoadManager_FindInstantiationFailure_UnitTest(); sl@0: sl@0: private: sl@0: /** sl@0: @fn CLoadManager_FindInstantiationFailure_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Default constructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @param aStateAccessor WhiteBox state access to the CLoadManager class. sl@0: @pre None. sl@0: @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. sl@0: */ sl@0: inline CLoadManager_FindInstantiationFailure_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn void ConstructL() sl@0: Intended Usage : Second phase of safe two phase construction, sl@0: to complete the object initialisation. sl@0: Error Condition : Leaves with an error code. sl@0: @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). sl@0: @since 7.0 sl@0: @return None sl@0: @pre CLoadManager_FindInstantiationFailure_UnitTest is fully constructed. sl@0: @post CLoadManager_FindInstantiationFailure_UnitTest is fully initialised. sl@0: */ sl@0: void ConstructL(); sl@0: sl@0: /** sl@0: The context of the Unit Test. sl@0: i.e The CLoadManager class tested by this UnitTest's transitions. sl@0: */ sl@0: CLoadManager_UnitTestContext* iUTContext; sl@0: TLoadManager_StateAccessor* iStateAccessor; sl@0: /* C'tor, d'tor, and method transition validators */ sl@0: TLoadManager_Ctor_TransitionValidator* iCtorValidator; sl@0: TLoadManager_InstantiationFailure_TransitionValidator* iInstantiationMethodValidator; sl@0: TLoadManager_Dtor_TransitionValidator* iDtorValidator; sl@0: }; // CLoadManager_FindInstantiationFailure_UnitTest sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: /** sl@0: @internalComponent sl@0: Comments : sl@0: */ sl@0: class CLoadManager_DefectFOT56ULPM_UnitTest : public CUnitTest sl@0: { sl@0: public: sl@0: /** sl@0: @fn NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Standard two-phase construction which leaves nothing on the sl@0: cleanup stack. sl@0: Error Condition : Leaves with the error code. sl@0: @leave KErrNoMemory sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @return CLoadManager_DefectFOT56ULPM_UnitTest* The constructed object. sl@0: @pre None. sl@0: @post CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed, and initialised. sl@0: */ sl@0: static CLoadManager_DefectFOT56ULPM_UnitTest* NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn RunError(TInt aError) sl@0: Intended Usage : Intercept the panic caused by a RunL leave, sl@0: to restore the CLoadManager_FindInstantiationAndDestroy_UnitTest sl@0: object to a sensible state. sl@0: (called by the Active Scheduler immediately before the Panic). sl@0: Error Condition : @see CUnitTest::RunError(). sl@0: @since 7.0 sl@0: @return TInt KErrNone if cleanup successful, otherwise sl@0: @see CUnitTest::RunError() sl@0: @pre CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed, and initialised. sl@0: @post The object has been restored to a sensible state. sl@0: */ sl@0: inline TInt RunError(TInt aError); sl@0: sl@0: /** sl@0: @fn ~CLoadManager_DefectFOT56ULPM_UnitTest() sl@0: Intended Usage : Standard Destructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @pre CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed. sl@0: @post CLoadManager_DefectFOT56ULPM_UnitTest is fully destroyed. sl@0: */ sl@0: ~CLoadManager_DefectFOT56ULPM_UnitTest(); sl@0: sl@0: private: sl@0: /** sl@0: @fn CLoadManager_DefectFOT56ULPM_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: Intended Usage : Default constructor. sl@0: Error Condition : None. sl@0: @since 7.0 sl@0: @param aDataLogger The output logging object. sl@0: @param aObserver The observer of this UnitTest. sl@0: @param aStateAccessor WhiteBox state access to the CLoadManager class. sl@0: @pre None. sl@0: @post CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed. sl@0: */ sl@0: inline CLoadManager_DefectFOT56ULPM_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver); sl@0: sl@0: /** sl@0: @fn void ConstructL() sl@0: Intended Usage : Second phase of safe two phase construction, sl@0: to complete the object initialisation. sl@0: Error Condition : Leaves with an error code. sl@0: @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). sl@0: @since 7.0 sl@0: @return None sl@0: @pre CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed. sl@0: @post CLoadManager_DefectFOT56ULPM_UnitTest is fully initialised. sl@0: */ sl@0: void ConstructL(); sl@0: sl@0: /** sl@0: The context of the Unit Test. sl@0: i.e The CLoadManager class tested by this UnitTest's transitions. sl@0: */ sl@0: CLoadManager_UnitTestContext* iUTContext; sl@0: TLoadManager_StateAccessor* iStateAccessor; sl@0: /* C'tor, d'tor, and method transition validators */ sl@0: TLoadManager_Ctor_TransitionValidator* iCtorValidator; sl@0: TLoadManager_InstantiationMethod_TransitionValidator* iInstantiationMethodValidator; sl@0: TLoadManager_DestroyThis_TransitionValidator* iDestroyThisValidator; sl@0: TLoadManager_Dtor_TransitionValidator* iDtorValidator; sl@0: }; // CLoadManager_DefectFOT56ULPM_UnitTest sl@0: sl@0: #include "LoadManagerUnitTest.inl" sl@0: sl@0: #endif // __LOADMANAGERUNITTEST_H__