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 CResolver test transition class implementations sl@0: // sl@0: // sl@0: sl@0: #include "ResolverStateAccessor.h" sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KDefaultResolverNewLTransition,"CDefaultResolver_NewL_Transition"); sl@0: sl@0: inline CDefaultResolver_NewL_Transition::CDefaultResolver_NewL_Transition(CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator) sl@0: : CTransitionType(KDefaultResolverNewLTransition, aUTContext, aValidator) sl@0: { sl@0: // Do nothing here. sl@0: } sl@0: sl@0: inline void CDefaultResolver_NewL_Transition::TransitMethodL() sl@0: { sl@0: _LIT(KDefaultResolverNewLTransitMethod, "CDefaultResolver::NewL transition"); sl@0: Context().DataLogger().LogInformation(KDefaultResolverNewLTransitMethod); sl@0: sl@0: Context().iDefaultResolver = CDefaultResolver::NewL(*Context().iRegistry); sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext& CDefaultResolver_NewL_Transition::Context() const sl@0: { sl@0: return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KDefaultResolverDtorTransition,"CDefaultResolver_Dtor_Transition"); sl@0: sl@0: inline CDefaultResolver_Dtor_Transition::CDefaultResolver_Dtor_Transition(CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator) sl@0: : CTransition(KDefaultResolverDtorTransition, aUTContext, aValidator) sl@0: { sl@0: // Do nothing here. sl@0: } sl@0: sl@0: inline void CDefaultResolver_Dtor_Transition::TransitMethodL() sl@0: { sl@0: _LIT(KDefaultResolverDtorTransitMethod, "CDefaultResolver::Dtor transition"); sl@0: Context().DataLogger().LogInformation(KDefaultResolverDtorTransitMethod); sl@0: sl@0: delete Context().iDefaultResolver; sl@0: Context().iDefaultResolver = 0; sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext& CDefaultResolver_Dtor_Transition::Context() const sl@0: { sl@0: return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KDefaultResolverIdentifyImplementationLTransition,"CDefaultResolver_IdentifyImplementationL_Transition"); sl@0: sl@0: inline CDefaultResolver_IdentifyImplementationL_Transition::CDefaultResolver_IdentifyImplementationL_Transition(CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator) sl@0: : CTransitionType(KDefaultResolverIdentifyImplementationLTransition, aUTContext, aValidator) sl@0: { sl@0: // Do nothing here. sl@0: } sl@0: sl@0: inline void CDefaultResolver_IdentifyImplementationL_Transition::TransitMethodL() sl@0: { sl@0: _LIT(KDefaultResolverIdentifyImplementationLTransitMethod, "CDefaultResolver::IdentifyImplementationL transition"); sl@0: Context().DataLogger().LogInformation(KDefaultResolverIdentifyImplementationLTransitMethod); sl@0: sl@0: Context().iResolvedImpUid = sl@0: Context().iDefaultResolver->IdentifyImplementationL(Context().iInterfaceUid, sl@0: Context().iAdditionalParameters); sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext& CDefaultResolver_IdentifyImplementationL_Transition::Context() const sl@0: { sl@0: return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KDefaultResolverListAllLTransition,"CDefaultResolver_ListAllL_Transition"); sl@0: sl@0: inline CDefaultResolver_ListAllL_Transition::CDefaultResolver_ListAllL_Transition(CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator) sl@0: : CTransitionType(KDefaultResolverListAllLTransition, aUTContext, aValidator) sl@0: { sl@0: // Do nothing here. sl@0: } sl@0: sl@0: inline void CDefaultResolver_ListAllL_Transition::TransitMethodL() sl@0: { sl@0: _LIT(KDefaultResolverListAllLTransitMethod, "CDefaultResolver::ListAllL transition"); sl@0: Context().DataLogger().LogInformation(KDefaultResolverListAllLTransitMethod); sl@0: sl@0: Context().iDefaultResolver->ListAllL(Context().iInterfaceUid, sl@0: Context().iAdditionalParameters); sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext& CDefaultResolver_ListAllL_Transition::Context() const sl@0: { sl@0: return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KDefaultResolverMatchTransition,"CDefaultResolver_Match_Transition"); sl@0: sl@0: inline CDefaultResolver_Match_Transition::CDefaultResolver_Match_Transition(CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator) sl@0: : CTransition(KDefaultResolverMatchTransition, aUTContext, aValidator) sl@0: { sl@0: // Do nothing here. sl@0: } sl@0: sl@0: inline void CDefaultResolver_Match_Transition::TransitMethodL() sl@0: { sl@0: _LIT(KDefaultResolverMatchTransitMethod, "CDefaultResolver::Match transition"); sl@0: Context().DataLogger().LogInformation(KDefaultResolverMatchTransitMethod); sl@0: sl@0: TDefaultResolver_StateAccessor& accessor = sl@0: REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor()); sl@0: Context().iMatchResult = accessor.Match(*Context().iDefaultResolver, sl@0: *Context().iImplementationType, sl@0: *Context().iMatchType, sl@0: Context().iUseWildcards); sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext& CDefaultResolver_Match_Transition::Context() const sl@0: { sl@0: return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KDefaultResolverResolveTransition,"CDefaultResolver_Resolve_Transition"); sl@0: sl@0: inline CDefaultResolver_Resolve_Transition::CDefaultResolver_Resolve_Transition(CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator) sl@0: : CTransition(KDefaultResolverResolveTransition, aUTContext, aValidator) sl@0: { sl@0: // Do nothing here. sl@0: } sl@0: sl@0: inline void CDefaultResolver_Resolve_Transition::TransitMethodL() sl@0: { sl@0: _LIT(KDefaultResolverResolveTransitMethod, "CDefaultResolver::Resolve transition"); sl@0: Context().DataLogger().LogInformation(KDefaultResolverResolveTransitMethod); sl@0: sl@0: TDefaultResolver_StateAccessor& accessor = sl@0: REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor()); sl@0: accessor.Resolve(*Context().iDefaultResolver, sl@0: Context().iImplementationData, sl@0: Context().iAdditionalParameters); sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext& CDefaultResolver_Resolve_Transition::Context() const sl@0: { sl@0: return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline CDefaultResolver_UnitTestContext::CDefaultResolver_UnitTestContext(CDataLogger& aDataLogger, sl@0: MStateAccessor& aStateAccessor, sl@0: MTransitionObserver& aObserver) sl@0: : CUnitTestContext(aDataLogger, aStateAccessor, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: inline CDefaultResolver_UnitTestContext::~CDefaultResolver_UnitTestContext() sl@0: { sl@0: iFs.Close(); sl@0: sl@0: iImplementationData.Reset(); sl@0: sl@0: delete iDefaultResolver; sl@0: delete iRegistry; sl@0: delete iImplementationType; sl@0: delete iMatchType; sl@0: } sl@0: