os/ossrv/lowlevellibsandfws/pluginfw/Framework/ResolverTest/ResolverTransitions.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/ResolverTest/ResolverTransitions.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,198 @@
     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 CResolver test transition class implementations
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "ResolverStateAccessor.h"
    1.22 +
    1.23 +// ______________________________________________________________________________
    1.24 +//
    1.25 +_LIT(KDefaultResolverNewLTransition,"CDefaultResolver_NewL_Transition");
    1.26 +
    1.27 +inline CDefaultResolver_NewL_Transition::CDefaultResolver_NewL_Transition(CUnitTestContext& aUTContext,
    1.28 +													TTransitionValidator& aValidator)
    1.29 +: CTransitionType(KDefaultResolverNewLTransition, aUTContext, aValidator)
    1.30 +	{
    1.31 +	// Do nothing here.
    1.32 +	}
    1.33 +
    1.34 +inline void CDefaultResolver_NewL_Transition::TransitMethodL()
    1.35 +	{
    1.36 +	_LIT(KDefaultResolverNewLTransitMethod, "CDefaultResolver::NewL transition");
    1.37 +	Context().DataLogger().LogInformation(KDefaultResolverNewLTransitMethod);
    1.38 +
    1.39 +	Context().iDefaultResolver = CDefaultResolver::NewL(*Context().iRegistry);
    1.40 +	}
    1.41 +
    1.42 +inline CDefaultResolver_UnitTestContext& CDefaultResolver_NewL_Transition::Context() const
    1.43 +	{
    1.44 +	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
    1.45 +	}
    1.46 +
    1.47 +// ______________________________________________________________________________
    1.48 +//
    1.49 +_LIT(KDefaultResolverDtorTransition,"CDefaultResolver_Dtor_Transition");
    1.50 +
    1.51 +inline CDefaultResolver_Dtor_Transition::CDefaultResolver_Dtor_Transition(CUnitTestContext& aUTContext,
    1.52 +													TTransitionValidator& aValidator)
    1.53 +: CTransition(KDefaultResolverDtorTransition, aUTContext, aValidator)
    1.54 +	{
    1.55 +	// Do nothing here.
    1.56 +	}
    1.57 +
    1.58 +inline void CDefaultResolver_Dtor_Transition::TransitMethodL()
    1.59 +	{
    1.60 +	_LIT(KDefaultResolverDtorTransitMethod, "CDefaultResolver::Dtor transition");
    1.61 +	Context().DataLogger().LogInformation(KDefaultResolverDtorTransitMethod);
    1.62 +
    1.63 +	delete Context().iDefaultResolver;
    1.64 +	Context().iDefaultResolver = 0;
    1.65 +	}
    1.66 +
    1.67 +inline CDefaultResolver_UnitTestContext& CDefaultResolver_Dtor_Transition::Context() const
    1.68 +	{
    1.69 +	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
    1.70 +	}
    1.71 +
    1.72 +// ______________________________________________________________________________
    1.73 +//
    1.74 +_LIT(KDefaultResolverIdentifyImplementationLTransition,"CDefaultResolver_IdentifyImplementationL_Transition");
    1.75 +
    1.76 +inline CDefaultResolver_IdentifyImplementationL_Transition::CDefaultResolver_IdentifyImplementationL_Transition(CUnitTestContext& aUTContext,
    1.77 +													TTransitionValidator& aValidator)
    1.78 +: CTransitionType(KDefaultResolverIdentifyImplementationLTransition, aUTContext, aValidator)
    1.79 +	{
    1.80 +	// Do nothing here.
    1.81 +	}
    1.82 +
    1.83 +inline void CDefaultResolver_IdentifyImplementationL_Transition::TransitMethodL()
    1.84 +	{
    1.85 +	_LIT(KDefaultResolverIdentifyImplementationLTransitMethod, "CDefaultResolver::IdentifyImplementationL transition");
    1.86 +	Context().DataLogger().LogInformation(KDefaultResolverIdentifyImplementationLTransitMethod);
    1.87 +
    1.88 +	Context().iResolvedImpUid = 
    1.89 +		Context().iDefaultResolver->IdentifyImplementationL(Context().iInterfaceUid,
    1.90 +															Context().iAdditionalParameters);
    1.91 +	}
    1.92 +
    1.93 +inline CDefaultResolver_UnitTestContext& CDefaultResolver_IdentifyImplementationL_Transition::Context() const
    1.94 +	{
    1.95 +	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
    1.96 +	}
    1.97 +
    1.98 +// ______________________________________________________________________________
    1.99 +//
   1.100 +_LIT(KDefaultResolverListAllLTransition,"CDefaultResolver_ListAllL_Transition");
   1.101 +
   1.102 +inline CDefaultResolver_ListAllL_Transition::CDefaultResolver_ListAllL_Transition(CUnitTestContext& aUTContext,
   1.103 +													TTransitionValidator& aValidator)
   1.104 +: CTransitionType(KDefaultResolverListAllLTransition, aUTContext, aValidator)
   1.105 +	{
   1.106 +	// Do nothing here.
   1.107 +	}
   1.108 +
   1.109 +inline void CDefaultResolver_ListAllL_Transition::TransitMethodL()
   1.110 +	{
   1.111 +	_LIT(KDefaultResolverListAllLTransitMethod, "CDefaultResolver::ListAllL transition");
   1.112 +	Context().DataLogger().LogInformation(KDefaultResolverListAllLTransitMethod);
   1.113 +
   1.114 +	Context().iDefaultResolver->ListAllL(Context().iInterfaceUid,
   1.115 +										 Context().iAdditionalParameters);
   1.116 +	}
   1.117 +
   1.118 +inline CDefaultResolver_UnitTestContext& CDefaultResolver_ListAllL_Transition::Context() const
   1.119 +	{
   1.120 +	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
   1.121 +	}
   1.122 +
   1.123 +// ______________________________________________________________________________
   1.124 +//
   1.125 +_LIT(KDefaultResolverMatchTransition,"CDefaultResolver_Match_Transition");
   1.126 +
   1.127 +inline CDefaultResolver_Match_Transition::CDefaultResolver_Match_Transition(CUnitTestContext& aUTContext,
   1.128 +													TTransitionValidator& aValidator)
   1.129 +: CTransition(KDefaultResolverMatchTransition, aUTContext, aValidator)
   1.130 +	{
   1.131 +	// Do nothing here.
   1.132 +	}
   1.133 +
   1.134 +inline void CDefaultResolver_Match_Transition::TransitMethodL()
   1.135 +	{
   1.136 +	_LIT(KDefaultResolverMatchTransitMethod, "CDefaultResolver::Match transition");
   1.137 +	Context().DataLogger().LogInformation(KDefaultResolverMatchTransitMethod);
   1.138 +
   1.139 +	TDefaultResolver_StateAccessor& accessor = 
   1.140 +		REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor());
   1.141 +	Context().iMatchResult = accessor.Match(*Context().iDefaultResolver, 
   1.142 +											*Context().iImplementationType,
   1.143 +											*Context().iMatchType,
   1.144 +											 Context().iUseWildcards);
   1.145 +	}
   1.146 +
   1.147 +inline CDefaultResolver_UnitTestContext& CDefaultResolver_Match_Transition::Context() const
   1.148 +	{
   1.149 +	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
   1.150 +	}
   1.151 +
   1.152 +// ______________________________________________________________________________
   1.153 +//
   1.154 +_LIT(KDefaultResolverResolveTransition,"CDefaultResolver_Resolve_Transition");
   1.155 +
   1.156 +inline CDefaultResolver_Resolve_Transition::CDefaultResolver_Resolve_Transition(CUnitTestContext& aUTContext,
   1.157 +													TTransitionValidator& aValidator)
   1.158 +: CTransition(KDefaultResolverResolveTransition, aUTContext, aValidator)
   1.159 +	{
   1.160 +	// Do nothing here.
   1.161 +	}
   1.162 +
   1.163 +inline void CDefaultResolver_Resolve_Transition::TransitMethodL()
   1.164 +	{
   1.165 +	_LIT(KDefaultResolverResolveTransitMethod, "CDefaultResolver::Resolve transition");
   1.166 +	Context().DataLogger().LogInformation(KDefaultResolverResolveTransitMethod);
   1.167 +
   1.168 +	TDefaultResolver_StateAccessor& accessor = 
   1.169 +		REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor());
   1.170 +	accessor.Resolve(*Context().iDefaultResolver, 
   1.171 +					  Context().iImplementationData, 
   1.172 +					  Context().iAdditionalParameters);
   1.173 +	}
   1.174 +
   1.175 +inline CDefaultResolver_UnitTestContext& CDefaultResolver_Resolve_Transition::Context() const
   1.176 +	{
   1.177 +	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
   1.178 +	}
   1.179 +
   1.180 +// ______________________________________________________________________________
   1.181 +//
   1.182 +inline CDefaultResolver_UnitTestContext::CDefaultResolver_UnitTestContext(CDataLogger& aDataLogger,
   1.183 +												MStateAccessor& aStateAccessor,
   1.184 +												MTransitionObserver& aObserver)
   1.185 +: CUnitTestContext(aDataLogger, aStateAccessor, aObserver)
   1.186 +	{
   1.187 +	//Do nothing
   1.188 +	}
   1.189 +
   1.190 +inline CDefaultResolver_UnitTestContext::~CDefaultResolver_UnitTestContext()
   1.191 +	{
   1.192 +	iFs.Close();
   1.193 +
   1.194 +	iImplementationData.Reset();
   1.195 +
   1.196 +	delete iDefaultResolver;
   1.197 +	delete iRegistry;
   1.198 +	delete iImplementationType;
   1.199 +	delete iMatchType;
   1.200 +	}
   1.201 +