os/ossrv/lowlevellibsandfws/pluginfw/Framework/ResolverTest/ResolverTransitions.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // The CResolver test transition class implementations
    15 // 
    16 //
    17 
    18 #include "ResolverStateAccessor.h"
    19 
    20 // ______________________________________________________________________________
    21 //
    22 _LIT(KDefaultResolverNewLTransition,"CDefaultResolver_NewL_Transition");
    23 
    24 inline CDefaultResolver_NewL_Transition::CDefaultResolver_NewL_Transition(CUnitTestContext& aUTContext,
    25 													TTransitionValidator& aValidator)
    26 : CTransitionType(KDefaultResolverNewLTransition, aUTContext, aValidator)
    27 	{
    28 	// Do nothing here.
    29 	}
    30 
    31 inline void CDefaultResolver_NewL_Transition::TransitMethodL()
    32 	{
    33 	_LIT(KDefaultResolverNewLTransitMethod, "CDefaultResolver::NewL transition");
    34 	Context().DataLogger().LogInformation(KDefaultResolverNewLTransitMethod);
    35 
    36 	Context().iDefaultResolver = CDefaultResolver::NewL(*Context().iRegistry);
    37 	}
    38 
    39 inline CDefaultResolver_UnitTestContext& CDefaultResolver_NewL_Transition::Context() const
    40 	{
    41 	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
    42 	}
    43 
    44 // ______________________________________________________________________________
    45 //
    46 _LIT(KDefaultResolverDtorTransition,"CDefaultResolver_Dtor_Transition");
    47 
    48 inline CDefaultResolver_Dtor_Transition::CDefaultResolver_Dtor_Transition(CUnitTestContext& aUTContext,
    49 													TTransitionValidator& aValidator)
    50 : CTransition(KDefaultResolverDtorTransition, aUTContext, aValidator)
    51 	{
    52 	// Do nothing here.
    53 	}
    54 
    55 inline void CDefaultResolver_Dtor_Transition::TransitMethodL()
    56 	{
    57 	_LIT(KDefaultResolverDtorTransitMethod, "CDefaultResolver::Dtor transition");
    58 	Context().DataLogger().LogInformation(KDefaultResolverDtorTransitMethod);
    59 
    60 	delete Context().iDefaultResolver;
    61 	Context().iDefaultResolver = 0;
    62 	}
    63 
    64 inline CDefaultResolver_UnitTestContext& CDefaultResolver_Dtor_Transition::Context() const
    65 	{
    66 	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
    67 	}
    68 
    69 // ______________________________________________________________________________
    70 //
    71 _LIT(KDefaultResolverIdentifyImplementationLTransition,"CDefaultResolver_IdentifyImplementationL_Transition");
    72 
    73 inline CDefaultResolver_IdentifyImplementationL_Transition::CDefaultResolver_IdentifyImplementationL_Transition(CUnitTestContext& aUTContext,
    74 													TTransitionValidator& aValidator)
    75 : CTransitionType(KDefaultResolverIdentifyImplementationLTransition, aUTContext, aValidator)
    76 	{
    77 	// Do nothing here.
    78 	}
    79 
    80 inline void CDefaultResolver_IdentifyImplementationL_Transition::TransitMethodL()
    81 	{
    82 	_LIT(KDefaultResolverIdentifyImplementationLTransitMethod, "CDefaultResolver::IdentifyImplementationL transition");
    83 	Context().DataLogger().LogInformation(KDefaultResolverIdentifyImplementationLTransitMethod);
    84 
    85 	Context().iResolvedImpUid = 
    86 		Context().iDefaultResolver->IdentifyImplementationL(Context().iInterfaceUid,
    87 															Context().iAdditionalParameters);
    88 	}
    89 
    90 inline CDefaultResolver_UnitTestContext& CDefaultResolver_IdentifyImplementationL_Transition::Context() const
    91 	{
    92 	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
    93 	}
    94 
    95 // ______________________________________________________________________________
    96 //
    97 _LIT(KDefaultResolverListAllLTransition,"CDefaultResolver_ListAllL_Transition");
    98 
    99 inline CDefaultResolver_ListAllL_Transition::CDefaultResolver_ListAllL_Transition(CUnitTestContext& aUTContext,
   100 													TTransitionValidator& aValidator)
   101 : CTransitionType(KDefaultResolverListAllLTransition, aUTContext, aValidator)
   102 	{
   103 	// Do nothing here.
   104 	}
   105 
   106 inline void CDefaultResolver_ListAllL_Transition::TransitMethodL()
   107 	{
   108 	_LIT(KDefaultResolverListAllLTransitMethod, "CDefaultResolver::ListAllL transition");
   109 	Context().DataLogger().LogInformation(KDefaultResolverListAllLTransitMethod);
   110 
   111 	Context().iDefaultResolver->ListAllL(Context().iInterfaceUid,
   112 										 Context().iAdditionalParameters);
   113 	}
   114 
   115 inline CDefaultResolver_UnitTestContext& CDefaultResolver_ListAllL_Transition::Context() const
   116 	{
   117 	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
   118 	}
   119 
   120 // ______________________________________________________________________________
   121 //
   122 _LIT(KDefaultResolverMatchTransition,"CDefaultResolver_Match_Transition");
   123 
   124 inline CDefaultResolver_Match_Transition::CDefaultResolver_Match_Transition(CUnitTestContext& aUTContext,
   125 													TTransitionValidator& aValidator)
   126 : CTransition(KDefaultResolverMatchTransition, aUTContext, aValidator)
   127 	{
   128 	// Do nothing here.
   129 	}
   130 
   131 inline void CDefaultResolver_Match_Transition::TransitMethodL()
   132 	{
   133 	_LIT(KDefaultResolverMatchTransitMethod, "CDefaultResolver::Match transition");
   134 	Context().DataLogger().LogInformation(KDefaultResolverMatchTransitMethod);
   135 
   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);
   142 	}
   143 
   144 inline CDefaultResolver_UnitTestContext& CDefaultResolver_Match_Transition::Context() const
   145 	{
   146 	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
   147 	}
   148 
   149 // ______________________________________________________________________________
   150 //
   151 _LIT(KDefaultResolverResolveTransition,"CDefaultResolver_Resolve_Transition");
   152 
   153 inline CDefaultResolver_Resolve_Transition::CDefaultResolver_Resolve_Transition(CUnitTestContext& aUTContext,
   154 													TTransitionValidator& aValidator)
   155 : CTransition(KDefaultResolverResolveTransition, aUTContext, aValidator)
   156 	{
   157 	// Do nothing here.
   158 	}
   159 
   160 inline void CDefaultResolver_Resolve_Transition::TransitMethodL()
   161 	{
   162 	_LIT(KDefaultResolverResolveTransitMethod, "CDefaultResolver::Resolve transition");
   163 	Context().DataLogger().LogInformation(KDefaultResolverResolveTransitMethod);
   164 
   165 	TDefaultResolver_StateAccessor& accessor = 
   166 		REINTERPRET_CAST(TDefaultResolver_StateAccessor&, Context().StateAccessor());
   167 	accessor.Resolve(*Context().iDefaultResolver, 
   168 					  Context().iImplementationData, 
   169 					  Context().iAdditionalParameters);
   170 	}
   171 
   172 inline CDefaultResolver_UnitTestContext& CDefaultResolver_Resolve_Transition::Context() const
   173 	{
   174 	return REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
   175 	}
   176 
   177 // ______________________________________________________________________________
   178 //
   179 inline CDefaultResolver_UnitTestContext::CDefaultResolver_UnitTestContext(CDataLogger& aDataLogger,
   180 												MStateAccessor& aStateAccessor,
   181 												MTransitionObserver& aObserver)
   182 : CUnitTestContext(aDataLogger, aStateAccessor, aObserver)
   183 	{
   184 	//Do nothing
   185 	}
   186 
   187 inline CDefaultResolver_UnitTestContext::~CDefaultResolver_UnitTestContext()
   188 	{
   189 	iFs.Close();
   190 
   191 	iImplementationData.Reset();
   192 
   193 	delete iDefaultResolver;
   194 	delete iRegistry;
   195 	delete iImplementationType;
   196 	delete iMatchType;
   197 	}
   198