os/ossrv/lowlevellibsandfws/pluginfw/Framework/LoadManagerTest/LoadManagerTransitions.inl
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/LoadManagerTest/LoadManagerTransitions.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,149 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// The definition of the transition classes on the CLoadManager class
1.18 +//
1.19 +//
1.20 +
1.21 +// ______________________________________________________________________________
1.22 +//
1.23 +inline CLoadManager_UnitTestContext::CLoadManager_UnitTestContext(CDataLogger& aDataLogger,
1.24 + MStateAccessor& aStateAccessor,
1.25 + MTransitionObserver& aObserver)
1.26 +: CUnitTestContext(aDataLogger, aStateAccessor, aObserver)
1.27 + {
1.28 + //Do nothing
1.29 + }
1.30 +
1.31 +inline CLoadManager_UnitTestContext::~CLoadManager_UnitTestContext()
1.32 + {
1.33 + delete iLoadManager;
1.34 + delete iRegistryData;
1.35 + }
1.36 +
1.37 +// ______________________________________________________________________________
1.38 +//
1.39 +_LIT(KLoadManagerNewLTransition,"CLoadManager_NewL_Transition");
1.40 +
1.41 +inline CLoadManager_NewL_Transition::CLoadManager_NewL_Transition(CUnitTestContext& aUTContext,
1.42 + TTransitionValidator& aValidator)
1.43 +: CTransitionType(KLoadManagerNewLTransition, aUTContext, aValidator)
1.44 + {
1.45 + // Do nothing here.
1.46 + }
1.47 +
1.48 +inline void CLoadManager_NewL_Transition::TransitMethodL()
1.49 + {
1.50 + Context().iLoadManager = CLoadManager::NewL();
1.51 + }
1.52 +
1.53 +inline CLoadManager_UnitTestContext& CLoadManager_NewL_Transition::Context() const
1.54 + {
1.55 + return REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext);
1.56 + }
1.57 +
1.58 +// ______________________________________________________________________________
1.59 +//
1.60 +_LIT(KLoadManagerDtorTransition,"CLoadManager_Dtor_Transition");
1.61 +
1.62 +inline CLoadManager_Dtor_Transition::CLoadManager_Dtor_Transition(CUnitTestContext& aUTContext,
1.63 + TTransitionValidator& aValidator)
1.64 +: CTransition(KLoadManagerDtorTransition, aUTContext, aValidator)
1.65 + {
1.66 + // Do nothing here.
1.67 + }
1.68 +
1.69 +inline void CLoadManager_Dtor_Transition::TransitMethodL()
1.70 + {
1.71 + delete Context().iLoadManager;
1.72 + Context().iLoadManager = NULL;
1.73 + }
1.74 +
1.75 +inline CLoadManager_UnitTestContext& CLoadManager_Dtor_Transition::Context() const
1.76 + {
1.77 + return REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext);
1.78 + }
1.79 +
1.80 +// ______________________________________________________________________________
1.81 +//
1.82 +_LIT(KLoadManagerInstantiationMethodLTransition,"CLoadManager_InstantiationMethodL_Transition");
1.83 +
1.84 +inline CLoadManager_InstantiationMethodL_Transition::CLoadManager_InstantiationMethodL_Transition(CUnitTestContext& aUTContext,
1.85 + TTransitionValidator& aValidator)
1.86 +: CTransition(KLoadManagerInstantiationMethodLTransition, aUTContext, aValidator)
1.87 + {
1.88 + // Do nothing here.
1.89 + }
1.90 +
1.91 +inline void CLoadManager_InstantiationMethodL_Transition::TransitMethodL()
1.92 + {
1.93 + _LIT(KLoadManagerInstantiationMethodLTransitMethod, "CLoadManager::InstantiationMethodL transition");
1.94 + Context().DataLogger().LogInformation(KLoadManagerInstantiationMethodLTransitMethod);
1.95 + Context().iLoadMethod = Context().iLoadManager->InstantiationMethodL(Context().iUniqueImplementationUid,
1.96 + Context().iDllEntry);
1.97 + }
1.98 +
1.99 +inline CLoadManager_UnitTestContext& CLoadManager_InstantiationMethodL_Transition::Context() const
1.100 + {
1.101 + return REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext);
1.102 + }
1.103 +
1.104 +// ______________________________________________________________________________
1.105 +//
1.106 +_LIT(KLoadManagerDestroyedThisTransition,"CLoadManager_DestroyedThis_Transition");
1.107 +
1.108 +inline CLoadManager_DestroyedThis_Transition::CLoadManager_DestroyedThis_Transition(CUnitTestContext& aUTContext,
1.109 + TTransitionValidator& aValidator)
1.110 +: CTransition(KLoadManagerDestroyedThisTransition, aUTContext, aValidator)
1.111 + {
1.112 + // Do nothing here.
1.113 + }
1.114 +
1.115 +inline void CLoadManager_DestroyedThis_Transition::TransitMethodL()
1.116 + {
1.117 + _LIT(KLoadManagerDestroyedThisTransitMethod, "CLoadManager::DestroyedThis transition");
1.118 + Context().DataLogger().LogInformation(KLoadManagerDestroyedThisTransitMethod);
1.119 + Context().iLoadManager->DestroyedThis(Context().iUniqueImplementationUid);
1.120 + }
1.121 +
1.122 +inline CLoadManager_UnitTestContext& CLoadManager_DestroyedThis_Transition::Context() const
1.123 + {
1.124 + return REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext);
1.125 + }
1.126 +
1.127 +// ______________________________________________________________________________
1.128 +//
1.129 +_LIT(KLoadManagerDestroyCreateTransition,"CLoadManager_DestroyCreate_Transition");
1.130 +
1.131 +inline CLoadManager_DestroyCreate_Transition::CLoadManager_DestroyCreate_Transition(CUnitTestContext& aUTContext,
1.132 + TTransitionValidator& aValidator)
1.133 +: CTransition(KLoadManagerDestroyCreateTransition, aUTContext, aValidator)
1.134 + {
1.135 + // Do nothing here.
1.136 + }
1.137 +
1.138 +inline void CLoadManager_DestroyCreate_Transition::TransitMethodL()
1.139 + {
1.140 + _LIT(KLoadManagerDestroyCreateTransitMethod, "CLoadManager_DestroyCreate_Transition");
1.141 + Context().DataLogger().LogInformation(KLoadManagerDestroyCreateTransitMethod);
1.142 + Context().iLoadManager->DestroyedThis(Context().iUniqueImplementationUid);
1.143 + Context().iLoadMethod = Context().iLoadManager->InstantiationMethodL(Context().iUniqueImplementationUid,
1.144 + Context().iDllEntry);
1.145 +
1.146 + }
1.147 +
1.148 +inline CLoadManager_UnitTestContext& CLoadManager_DestroyCreate_Transition::Context() const
1.149 + {
1.150 + return REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext);
1.151 + }
1.152 +