os/ossrv/lowlevellibsandfws/pluginfw/Framework/ResolverTest/ResolverTransitions.inl
First public contribution.
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 CResolver test transition class implementations
18 #include "ResolverStateAccessor.h"
20 // ______________________________________________________________________________
22 _LIT(KDefaultResolverNewLTransition,"CDefaultResolver_NewL_Transition");
24 inline CDefaultResolver_NewL_Transition::CDefaultResolver_NewL_Transition(CUnitTestContext& aUTContext,
25 TTransitionValidator& aValidator)
26 : CTransitionType(KDefaultResolverNewLTransition, aUTContext, aValidator)
31 inline void CDefaultResolver_NewL_Transition::TransitMethodL()
33 _LIT(KDefaultResolverNewLTransitMethod, "CDefaultResolver::NewL transition");
34 Context().DataLogger().LogInformation(KDefaultResolverNewLTransitMethod);
36 Context().iDefaultResolver = CDefaultResolver::NewL(*Context().iRegistry);
39 inline CDefaultResolver_UnitTestContext& CDefaultResolver_NewL_Transition::Context() const
41 return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
44 // ______________________________________________________________________________
46 _LIT(KDefaultResolverDtorTransition,"CDefaultResolver_Dtor_Transition");
48 inline CDefaultResolver_Dtor_Transition::CDefaultResolver_Dtor_Transition(CUnitTestContext& aUTContext,
49 TTransitionValidator& aValidator)
50 : CTransition(KDefaultResolverDtorTransition, aUTContext, aValidator)
55 inline void CDefaultResolver_Dtor_Transition::TransitMethodL()
57 _LIT(KDefaultResolverDtorTransitMethod, "CDefaultResolver::Dtor transition");
58 Context().DataLogger().LogInformation(KDefaultResolverDtorTransitMethod);
60 delete Context().iDefaultResolver;
61 Context().iDefaultResolver = 0;
64 inline CDefaultResolver_UnitTestContext& CDefaultResolver_Dtor_Transition::Context() const
66 return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
69 // ______________________________________________________________________________
71 _LIT(KDefaultResolverIdentifyImplementationLTransition,"CDefaultResolver_IdentifyImplementationL_Transition");
73 inline CDefaultResolver_IdentifyImplementationL_Transition::CDefaultResolver_IdentifyImplementationL_Transition(CUnitTestContext& aUTContext,
74 TTransitionValidator& aValidator)
75 : CTransitionType(KDefaultResolverIdentifyImplementationLTransition, aUTContext, aValidator)
80 inline void CDefaultResolver_IdentifyImplementationL_Transition::TransitMethodL()
82 _LIT(KDefaultResolverIdentifyImplementationLTransitMethod, "CDefaultResolver::IdentifyImplementationL transition");
83 Context().DataLogger().LogInformation(KDefaultResolverIdentifyImplementationLTransitMethod);
85 Context().iResolvedImpUid =
86 Context().iDefaultResolver->IdentifyImplementationL(Context().iInterfaceUid,
87 Context().iAdditionalParameters);
90 inline CDefaultResolver_UnitTestContext& CDefaultResolver_IdentifyImplementationL_Transition::Context() const
92 return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
95 // ______________________________________________________________________________
97 _LIT(KDefaultResolverListAllLTransition,"CDefaultResolver_ListAllL_Transition");
99 inline CDefaultResolver_ListAllL_Transition::CDefaultResolver_ListAllL_Transition(CUnitTestContext& aUTContext,
100 TTransitionValidator& aValidator)
101 : CTransitionType(KDefaultResolverListAllLTransition, aUTContext, aValidator)
106 inline void CDefaultResolver_ListAllL_Transition::TransitMethodL()
108 _LIT(KDefaultResolverListAllLTransitMethod, "CDefaultResolver::ListAllL transition");
109 Context().DataLogger().LogInformation(KDefaultResolverListAllLTransitMethod);
111 Context().iDefaultResolver->ListAllL(Context().iInterfaceUid,
112 Context().iAdditionalParameters);
115 inline CDefaultResolver_UnitTestContext& CDefaultResolver_ListAllL_Transition::Context() const
117 return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
120 // ______________________________________________________________________________
122 _LIT(KDefaultResolverMatchTransition,"CDefaultResolver_Match_Transition");
124 inline CDefaultResolver_Match_Transition::CDefaultResolver_Match_Transition(CUnitTestContext& aUTContext,
125 TTransitionValidator& aValidator)
126 : CTransition(KDefaultResolverMatchTransition, aUTContext, aValidator)
131 inline void CDefaultResolver_Match_Transition::TransitMethodL()
133 _LIT(KDefaultResolverMatchTransitMethod, "CDefaultResolver::Match transition");
134 Context().DataLogger().LogInformation(KDefaultResolverMatchTransitMethod);
136 TDefaultResolver_StateAccessor& accessor =
137 REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor());
138 Context().iMatchResult = accessor.Match(*Context().iDefaultResolver,
139 *Context().iImplementationType,
140 *Context().iMatchType,
141 Context().iUseWildcards);
144 inline CDefaultResolver_UnitTestContext& CDefaultResolver_Match_Transition::Context() const
146 return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
149 // ______________________________________________________________________________
151 _LIT(KDefaultResolverResolveTransition,"CDefaultResolver_Resolve_Transition");
153 inline CDefaultResolver_Resolve_Transition::CDefaultResolver_Resolve_Transition(CUnitTestContext& aUTContext,
154 TTransitionValidator& aValidator)
155 : CTransition(KDefaultResolverResolveTransition, aUTContext, aValidator)
160 inline void CDefaultResolver_Resolve_Transition::TransitMethodL()
162 _LIT(KDefaultResolverResolveTransitMethod, "CDefaultResolver::Resolve transition");
163 Context().DataLogger().LogInformation(KDefaultResolverResolveTransitMethod);
165 TDefaultResolver_StateAccessor& accessor =
166 REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor());
167 accessor.Resolve(*Context().iDefaultResolver,
168 Context().iImplementationData,
169 Context().iAdditionalParameters);
172 inline CDefaultResolver_UnitTestContext& CDefaultResolver_Resolve_Transition::Context() const
174 return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
177 // ______________________________________________________________________________
179 inline CDefaultResolver_UnitTestContext::CDefaultResolver_UnitTestContext(CDataLogger& aDataLogger,
180 MStateAccessor& aStateAccessor,
181 MTransitionObserver& aObserver)
182 : CUnitTestContext(aDataLogger, aStateAccessor, aObserver)
187 inline CDefaultResolver_UnitTestContext::~CDefaultResolver_UnitTestContext()
191 iImplementationData.Reset();
193 delete iDefaultResolver;
195 delete iImplementationType;