os/ossrv/lowlevellibsandfws/pluginfw/Framework/LoadManagerTest/LoadManagerUnitTest.cpp
Update contrib.
     1 // Copyright (c) 1997-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".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    14 // The unit test class implementations for the CLoadManager tests
 
    18 #include "LoadManagerUnitTest.h"
 
    19 #include "RegistryData.h"
 
    21 CLoadManager_CreateAndDestroy_UnitTest* CLoadManager_CreateAndDestroy_UnitTest::NewL(CDataLogger& aDataLogger,
 
    22 											MUnitTestObserver& aObserver)
 
    24 	CLoadManager_CreateAndDestroy_UnitTest* self = 
 
    25 					new(ELeave) CLoadManager_CreateAndDestroy_UnitTest(aDataLogger,
 
    27 	CleanupStack::PushL(self);
 
    33 // Now the Individual transitions need to be added.
 
    34 inline void CLoadManager_CreateAndDestroy_UnitTest::ConstructL()
 
    36 	// Perform the base class initialization
 
    39 	// Create the Unit test state accessor
 
    40 	iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
 
    41 	// Construct the Unit test context.
 
    42 	iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
 
    43 	// Add the Transitions in the order they are to run
 
    44 	// C'tor first, D'tor last...
 
    45 	iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
 
    46 	AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
 
    47 	iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
 
    48 	AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
 
    51 void CLoadManager_CreateAndDestroy_UnitTest::PrepareUnitTestL()
 
    53 	// Give the context a constructed set of data
 
    54 	iUTContext->iRegistryData = CRegistryData::NewL(iFs);
 
    57 // ______________________________________________________________________________
 
    59 CLoadManager_FindInstantiationAndDestroy_UnitTest* CLoadManager_FindInstantiationAndDestroy_UnitTest::NewL(CDataLogger& aDataLogger,
 
    60 											MUnitTestObserver& aObserver)
 
    62 	CLoadManager_FindInstantiationAndDestroy_UnitTest* self = 
 
    63 					new(ELeave) CLoadManager_FindInstantiationAndDestroy_UnitTest(aDataLogger,
 
    65 	CleanupStack::PushL(self);
 
    71 // Now the Individual transitions need to be added.
 
    72 inline void CLoadManager_FindInstantiationAndDestroy_UnitTest::ConstructL()
 
    74 	// Perform the base class initialization
 
    77 	// Create the Unit test state accessor
 
    78 	iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
 
    79 	// Construct the Unit test context.
 
    80 	iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
 
    82 	iUTContext->iUniqueImplementationUid = KUniqueImplementationUid_Works;
 
    83 	// Add the Transitions in the order they are to run
 
    84 	// C'tor first, D'tor last...
 
    85 	iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
 
    86 	AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
 
    88 	iInstantiationMethodValidator = new(ELeave) TLoadManager_InstantiationMethod_TransitionValidator(*iUTContext);
 
    89 	AddTransitionL(new(ELeave)CLoadManager_InstantiationMethodL_Transition(*iUTContext,*iInstantiationMethodValidator));
 
    91 	iDestroyThisValidator = new(ELeave) TLoadManager_DestroyThis_TransitionValidator(*iUTContext);
 
    92 	AddTransitionL(new(ELeave)CLoadManager_DestroyedThis_Transition(*iUTContext,*iDestroyThisValidator));
 
    94 	iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
 
    95 	AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
 
    98 void CLoadManager_FindInstantiationAndDestroy_UnitTest::PrepareUnitTestL()
 
   100 	iUTContext->iRegistryData = CRegistryData::NewL(iFs);
 
   103 // ______________________________________________________________________________
 
   105 CLoadManager_FindInstantiationFailure_UnitTest* CLoadManager_FindInstantiationFailure_UnitTest::NewL(CDataLogger& aDataLogger,
 
   106 											MUnitTestObserver& aObserver)
 
   108 	CLoadManager_FindInstantiationFailure_UnitTest* self = 
 
   109 					new(ELeave) CLoadManager_FindInstantiationFailure_UnitTest(aDataLogger,
 
   111 	CleanupStack::PushL(self);
 
   117 // Now the Individual transitions need to be added.
 
   118 inline void CLoadManager_FindInstantiationFailure_UnitTest::ConstructL()
 
   120 	// Perform the base class initialization
 
   121 	UnitTestConstructL();
 
   123 	// Create the Unit test state accessor
 
   124 	iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
 
   125 	// Construct the Unit test context.
 
   126 	iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
 
   128 	iUTContext->iUniqueImplementationUid = KUniqueImplementationUid_Fails;
 
   129 	iUTContext->iRegistryData = CRegistryData::NewL(iFs);
 
   130 	// Add the Transitions in the order they are to run
 
   131 	// C'tor first, D'tor last...
 
   132 	iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
 
   133 	AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
 
   135 	iInstantiationMethodValidator = new(ELeave) TLoadManager_InstantiationFailure_TransitionValidator(*iUTContext);
 
   136 	AddTransitionL(new(ELeave)CLoadManager_InstantiationMethodL_Transition(*iUTContext,*iInstantiationMethodValidator));
 
   138 	iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
 
   139 	AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
 
   142 // ______________________________________________________________________________
 
   144 CLoadManager_DefectFOT56ULPM_UnitTest* CLoadManager_DefectFOT56ULPM_UnitTest::NewL(CDataLogger& aDataLogger,
 
   145 											MUnitTestObserver& aObserver)
 
   147 	CLoadManager_DefectFOT56ULPM_UnitTest* self = 
 
   148 					new(ELeave) CLoadManager_DefectFOT56ULPM_UnitTest(aDataLogger,
 
   150 	CleanupStack::PushL(self);
 
   156 // Now the Individual transitions need to be added.
 
   157 inline void CLoadManager_DefectFOT56ULPM_UnitTest::ConstructL()
 
   159 	// Perform the base class initialization
 
   160 	UnitTestConstructL();
 
   162 	// Create the Unit test state accessor
 
   163 	iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
 
   164 	// Construct the Unit test context.
 
   165 	iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
 
   167 	iUTContext->iUniqueImplementationUid = KUniqueImplementationUid_Works;
 
   168 	iUTContext->iRegistryData = CRegistryData::NewL(iFs);
 
   169 	// Add the Transitions in the order they are to run
 
   170 	// C'tor first, D'tor last...
 
   171 	iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
 
   172 	iInstantiationMethodValidator = new(ELeave) TLoadManager_InstantiationMethod_TransitionValidator(*iUTContext);
 
   173 	iDestroyThisValidator = new(ELeave) TLoadManager_DestroyThis_TransitionValidator(*iUTContext);
 
   174 	iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
 
   176 	AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
 
   177 	AddTransitionL(new(ELeave)CLoadManager_InstantiationMethodL_Transition(*iUTContext,*iInstantiationMethodValidator));
 
   178 	AddTransitionL(new(ELeave)CLoadManager_DestroyCreate_Transition(*iUTContext,*iDestroyThisValidator));
 
   179 	AddTransitionL(new(ELeave)CLoadManager_DestroyedThis_Transition(*iUTContext,*iDestroyThisValidator));
 
   180 	AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));