os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistryDataTest/RegistryDataTransitions.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 implementation of the transition classes for the CRegistryData tests.
    15 // 
    16 //
    17 
    18 // ______________________________________________________________________________
    19 //
    20 _LIT(KRegistryDataNewLTransition,"CRegistryData_NewL_Transition");
    21 
    22 inline CRegistryData_NewL_Transition::CRegistryData_NewL_Transition(CUnitTestContext& aUTContext,
    23 													TTransitionValidator& aValidator)
    24 : CTransition(KRegistryDataNewLTransition, aUTContext, aValidator)
    25 	{
    26 	// Do nothing here.
    27 	}
    28 
    29 inline void CRegistryData_NewL_Transition::TransitMethodL()
    30 	{
    31 	Context().iRegistryData = CRegistryData::NewL(Context().iFs);
    32 	}
    33 
    34 inline CRegistryData_UnitTestContext& CRegistryData_NewL_Transition::Context() const
    35 	{
    36 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
    37 	}
    38 
    39 // ______________________________________________________________________________
    40 //
    41 _LIT(KRegistryDataDtorTransition,"CRegistryData_Dtor_Transition");
    42 
    43 inline CRegistryData_Dtor_Transition::CRegistryData_Dtor_Transition(CUnitTestContext& aUTContext,
    44 													TTransitionValidator& aValidator)
    45 : CTransition(KRegistryDataDtorTransition, aUTContext, aValidator)
    46 	{
    47 	// Do nothing here.
    48 	}
    49 
    50 inline void CRegistryData_Dtor_Transition::TransitMethodL()
    51 	{
    52 	delete Context().iRegistryData;
    53 	Context().iRegistryData = NULL;
    54 	}
    55 
    56 inline CRegistryData_UnitTestContext& CRegistryData_Dtor_Transition::Context() const
    57 	{
    58 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
    59 	}
    60 
    61 // ______________________________________________________________________________
    62 //
    63 _LIT(KRegistryDataAddDllDataLTransition,"CRegistryData_AddDllDataL_Transition");
    64 
    65 inline CRegistryData_AddDllDataL_Transition::CRegistryData_AddDllDataL_Transition(CUnitTestContext& aUTContext,
    66 													TTransitionValidator& aValidator)
    67 : CTransitionType(KRegistryDataAddDllDataLTransition, aUTContext, aValidator)
    68 	{
    69 	// Do nothing here.
    70 	}
    71 
    72 inline void CRegistryData_AddDllDataL_Transition::TransitMethodL()
    73 	{
    74 	_LIT(KRegistryDataAddDllDataLTransitMethod, "CRegistryData::AddDllDataL transition");
    75 	Context().DataLogger().LogInformation(KRegistryDataAddDllDataLTransitMethod);
    76 	Context().iRegistryData->AddDllDataL(Context().iDriveUnit, 
    77 										 Context().iFoundDriveIndex,
    78 										 Context().iDllData);
    79 
    80 	Context().iDllData = NULL;
    81 	}
    82 
    83 inline CRegistryData_UnitTestContext& CRegistryData_AddDllDataL_Transition::Context() const
    84 	{
    85 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
    86 	}
    87 
    88 // ______________________________________________________________________________
    89 //
    90 _LIT(KRegistryDataGetImplementationInformationLTransition,"CRegistryData_GetImplementationInformationL_Transition");
    91 
    92 inline CRegistryData_GetImplementationInformationL_Transition::CRegistryData_GetImplementationInformationL_Transition(CUnitTestContext& aUTContext,
    93 													TTransitionValidator& aValidator)
    94 : CTransitionType(KRegistryDataGetImplementationInformationLTransition, aUTContext, aValidator)
    95 	{
    96 	// Do nothing here.
    97 	}
    98 
    99 inline void CRegistryData_GetImplementationInformationL_Transition::TransitMethodL()
   100 	{
   101 	_LIT(KRegistryDataGetImplementationInformationLTransitMethod, "CRegistryData::GetImplementationInformationL transition");
   102 	Context().DataLogger().LogInformation(KRegistryDataGetImplementationInformationLTransitMethod);
   103 	Context().iImplementationRef = &(Context().iRegistryData->GetImplementationDataL(Context().iImplementationUid));
   104 	}
   105 
   106 inline CRegistryData_UnitTestContext& CRegistryData_GetImplementationInformationL_Transition::Context() const
   107 	{
   108 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   109 	}
   110 
   111 // ______________________________________________________________________________
   112 //
   113 _LIT(KRegistryDataIsRegisteredWithDateLTransition,"CRegistryData_IsRegisteredWithDateL_Transition");
   114 
   115 inline CRegistryData_IsRegisteredWithDateL_Transition::CRegistryData_IsRegisteredWithDateL_Transition(CUnitTestContext& aUTContext,
   116 													TTransitionValidator& aValidator)
   117 : CTransitionType(KRegistryDataIsRegisteredWithDateLTransition, aUTContext, aValidator)
   118 	{
   119 	// Do nothing here.
   120 	}
   121 
   122 inline void CRegistryData_IsRegisteredWithDateL_Transition::TransitMethodL()
   123 	{
   124 	_LIT(KRegistryDataIsRegisteredWithDateLTransitMethod, "CRegistryData::IsRegisteredWithDateL transition");
   125 	Context().DataLogger().LogInformation(KRegistryDataIsRegisteredWithDateLTransitMethod);
   126 	Context().iRegistryData->IsRegisteredWithDateL(Context().iDriveUnit,
   127 												   Context().iDllEntry[2], 
   128 												   Context().iDllEntry.iModified, 
   129 												   Context().iUpdate,
   130 												   Context().iFoundDriveIndex);
   131 	}
   132 
   133 inline CRegistryData_UnitTestContext& CRegistryData_IsRegisteredWithDateL_Transition::Context() const
   134 	{
   135 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   136 	}
   137 
   138 // ______________________________________________________________________________
   139 //
   140 _LIT(KRegistryDataListImplementationsLTransition,"CRegistryData_ListImplementationsL_Transition");
   141 
   142 inline CRegistryData_ListImplementationsL_Transition::CRegistryData_ListImplementationsL_Transition(CUnitTestContext& aUTContext,
   143 													TTransitionValidator& aValidator)
   144 : CTransitionType(KRegistryDataListImplementationsLTransition, aUTContext, aValidator)
   145 	{
   146 	// Do nothing here.
   147 	}
   148 
   149 inline void CRegistryData_ListImplementationsL_Transition::TransitMethodL()
   150 	{
   151 	_LIT(KRegistryDataListImplementationsLTransitMethod, "CRegistryData::ListImplementationsL transition");
   152 	Context().DataLogger().LogInformation(KRegistryDataListImplementationsLTransitMethod);
   153 	Context().iUidList = &Context().iRegistryData->ListImplementationsL(Context().iInterfaceUid);
   154 	}
   155 
   156 inline CRegistryData_UnitTestContext& CRegistryData_ListImplementationsL_Transition::Context() const
   157 	{
   158 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   159 	}
   160 
   161 // ______________________________________________________________________________
   162 //
   163 _LIT(KRegistryDataSetEnabledStateTransition,"CRegistryData_SetEnabledState_Transition");
   164 
   165 inline CRegistryData_SetEnabledState_Transition::CRegistryData_SetEnabledState_Transition(CUnitTestContext& aUTContext,
   166 													TTransitionValidator& aValidator)
   167 : CTransitionType(KRegistryDataSetEnabledStateTransition, aUTContext, aValidator)
   168 	{
   169 	// Do nothing here.
   170 	}
   171 
   172 inline void CRegistryData_SetEnabledState_Transition::TransitMethodL()
   173 	{
   174 	_LIT(KRegistryDataSetEnabledStateTransitMethod, "CRegistryData::SetEnabledState transition");
   175 	Context().DataLogger().LogInformation(KRegistryDataSetEnabledStateTransitMethod);
   176 	Context().iMethodCompletionStatus = Context().iRegistryData->SetEnabledState(Context().iImplementationUid, Context().iEnabledState);
   177 	}
   178 
   179 inline CRegistryData_UnitTestContext& CRegistryData_SetEnabledState_Transition::Context() const
   180 	{
   181 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   182 	}
   183 
   184 // ______________________________________________________________________________
   185 //
   186 _LIT(KRegistryDataPersistNowLTransition,"CRegistryData_PersistNowL_Transition");
   187 
   188 inline CRegistryData_PersistNowL_Transition::CRegistryData_PersistNowL_Transition(CUnitTestContext& aUTContext,
   189 													TTransitionValidator& aValidator)
   190 : CTransitionType(KRegistryDataPersistNowLTransition, aUTContext, aValidator)
   191 	{
   192 	// Do nothing here.
   193 	}
   194 
   195 inline void CRegistryData_PersistNowL_Transition::TransitMethodL()
   196 	{
   197 	_LIT(KRegistryDataPersistNowLTransitMethod, "CRegistryData::PersistNowL transition");
   198 	Context().DataLogger().LogInformation(KRegistryDataPersistNowLTransitMethod);
   199 	Context().iRegistryData->PersistNowL();
   200 	}
   201 
   202 inline CRegistryData_UnitTestContext& CRegistryData_PersistNowL_Transition::Context() const
   203 	{
   204 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   205 	}
   206 
   207 // ______________________________________________________________________________
   208 //
   209 _LIT(KRegistryDataTemporaryUninstallLTransition,"CRegistryData_TemporaryUninstallL_Transition");
   210 
   211 inline CRegistryData_TemporaryUninstallL_Transition::CRegistryData_TemporaryUninstallL_Transition(CUnitTestContext& aUTContext,
   212 													TTransitionValidator& aValidator)
   213 : CTransitionType(KRegistryDataTemporaryUninstallLTransition, aUTContext, aValidator)
   214 	{
   215 	// Do nothing here.
   216 	}
   217 
   218 inline void CRegistryData_TemporaryUninstallL_Transition::TransitMethodL()
   219 	{
   220 	_LIT(KRegistryDataTemporaryUninstallLTransitMethod, "CRegistryData::TemporaryUninstallL transition");
   221 	Context().DataLogger().LogInformation(KRegistryDataTemporaryUninstallLTransitMethod);
   222 	Context().iRegistryData->TemporaryUninstallL(Context().iDriveUnit);
   223 	}
   224 
   225 inline CRegistryData_UnitTestContext& CRegistryData_TemporaryUninstallL_Transition::Context() const
   226 	{
   227 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   228 	}
   229 
   230 // ______________________________________________________________________________
   231 //
   232 _LIT(KRegistryDataUndoTemporaryUninstallLTransition,"CRegistryData_UndoTemporaryUninstallL_Transition");
   233 
   234 inline CRegistryData_UndoTemporaryUninstallL_Transition::CRegistryData_UndoTemporaryUninstallL_Transition(CUnitTestContext& aUTContext,
   235 													TTransitionValidator& aValidator)
   236 : CTransitionType(KRegistryDataUndoTemporaryUninstallLTransition, aUTContext, aValidator)
   237 	{
   238 	// Do nothing here.
   239 	}
   240 
   241 inline void CRegistryData_UndoTemporaryUninstallL_Transition::TransitMethodL()
   242 	{
   243 	_LIT(KRegistryDataUndoTemporaryUninstallLTransitMethod, "CRegistryData::UndoTemporaryUninstallL transition");
   244 	Context().DataLogger().LogInformation(KRegistryDataUndoTemporaryUninstallLTransitMethod);
   245 	Context().iRegistryData->UndoTemporaryUninstallL(Context().iDriveUnit);
   246 	}
   247 
   248 inline CRegistryData_UnitTestContext& CRegistryData_UndoTemporaryUninstallL_Transition::Context() const
   249 	{
   250 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   251 	}
   252 
   253 // ______________________________________________________________________________
   254 //
   255 _LIT(KRegistryDataUpdateDllDataLTransition,"CRegistryData_UpdateDllDataL_Transition");
   256 
   257 inline CRegistryData_UpdateDllDataL_Transition::CRegistryData_UpdateDllDataL_Transition(CUnitTestContext& aUTContext,
   258 													TTransitionValidator& aValidator)
   259 : CTransitionType(KRegistryDataUpdateDllDataLTransition, aUTContext, aValidator)
   260 	{
   261 	// Do nothing here.
   262 	}
   263 
   264 inline void CRegistryData_UpdateDllDataL_Transition::TransitMethodL()
   265 	{
   266 	_LIT(KRegistryDataUpdateDllDataLTransitMethod, "CRegistryData::UpdateDllDataL transition");
   267 	Context().DataLogger().LogInformation(KRegistryDataUpdateDllDataLTransitMethod);
   268 	Context().iRegistryData->UpdateDllDataL(Context().iFoundDriveIndex, Context().iNewDllData);
   269 	
   270 	Context().iNewDllData = NULL;
   271 	}
   272 
   273 inline CRegistryData_UnitTestContext& CRegistryData_UpdateDllDataL_Transition::Context() const
   274 	{
   275 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   276 	}
   277 
   278 // ______________________________________________________________________________
   279 //
   280 _LIT(KRegistryDataBuildIndexesLTransition,"CRegistryData_BuildIndexesL_Transition");
   281 
   282 inline CRegistryData_BuildIndexesL_Transition::CRegistryData_BuildIndexesL_Transition(CUnitTestContext& aUTContext,
   283 													TTransitionValidator& aValidator)
   284 : CTransitionType(KRegistryDataBuildIndexesLTransition, aUTContext, aValidator)
   285 	{
   286 	// Do nothing here.
   287 	}
   288 
   289 inline void CRegistryData_BuildIndexesL_Transition::TransitMethodL()
   290 	{
   291 	_LIT(KRegistryDataBuildIndexesLTransitMethod, "CRegistryData::BuildIndexesL transition");
   292 	Context().DataLogger().LogInformation(KRegistryDataBuildIndexesLTransitMethod);
   293 	TRegistryData_StateAccessor& accessor = 
   294 		REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
   295 		accessor.BuildIndexesL(*Context().iRegistryData);
   296 	}
   297 
   298 inline CRegistryData_UnitTestContext& CRegistryData_BuildIndexesL_Transition::Context() const
   299 	{
   300 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   301 	}
   302 
   303 // ______________________________________________________________________________
   304 //
   305 _LIT(KRegistryDataIndexedFindTransition,"CRegistryData_IndexedFind_Transition");
   306 
   307 inline CRegistryData_IndexedFind_Transition::CRegistryData_IndexedFind_Transition(CUnitTestContext& aUTContext,
   308 													TTransitionValidator& aValidator)
   309 : CTransitionType(KRegistryDataIndexedFindTransition, aUTContext, aValidator)
   310 	{
   311 	// Do nothing here.
   312 	}
   313 
   314 inline void CRegistryData_IndexedFind_Transition::TransitMethodL()
   315 	{
   316 	_LIT(KRegistryDataIndexedFindTransitMethod, "CRegistryData::IndexedFind transition");
   317 	Context().DataLogger().LogInformation(KRegistryDataIndexedFindTransitMethod);
   318 	TRegistryData_StateAccessor& accessor = 
   319 		REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
   320 		accessor.IndexedFind(*Context().iRegistryData, Context().iImplementationUid);
   321 	}
   322 
   323 inline CRegistryData_UnitTestContext& CRegistryData_IndexedFind_Transition::Context() const
   324 	{
   325 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   326 	}
   327 
   328 // ______________________________________________________________________________
   329 //
   330 _LIT(KRegistryDataRestoreLTransition,"CRegistryData_RestoreL_Transition");
   331 
   332 inline CRegistryData_RestoreL_Transition::CRegistryData_RestoreL_Transition(CUnitTestContext& aUTContext,
   333 													TTransitionValidator& aValidator)
   334 : CTransitionType(KRegistryDataRestoreLTransition, aUTContext, aValidator)
   335 	{
   336 	// Do nothing here.
   337 	}
   338 
   339 inline void CRegistryData_RestoreL_Transition::TransitMethodL()
   340 	{
   341 	_LIT(KRegistryDataRestoreLTransitMethod, "CRegistryData::RestoreL transition");
   342 	Context().DataLogger().LogInformation(KRegistryDataRestoreLTransitMethod);
   343 	TRegistryData_StateAccessor& accessor = 
   344 		REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
   345 		accessor.RestoreL(*Context().iRegistryData, Context().iReadStream);
   346 	}
   347 
   348 inline CRegistryData_UnitTestContext& CRegistryData_RestoreL_Transition::Context() const
   349 	{
   350 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   351 	}
   352 
   353 // ______________________________________________________________________________
   354 //
   355 _LIT(KRegistryDataStoreLTransition,"CRegistryData_StoreL_Transition");
   356 
   357 inline CRegistryData_StoreL_Transition::CRegistryData_StoreL_Transition(CUnitTestContext& aUTContext,
   358 													TTransitionValidator& aValidator)
   359 : CTransitionType(KRegistryDataStoreLTransition, aUTContext, aValidator)
   360 	{
   361 	// Do nothing here.
   362 	}
   363 
   364 inline void CRegistryData_StoreL_Transition::TransitMethodL()
   365 	{
   366 	_LIT(KRegistryDataStoreLTransitMethod, "CRegistryData::StoreL transition");
   367 	Context().DataLogger().LogInformation(KRegistryDataStoreLTransitMethod);
   368 	TRegistryData_StateAccessor& accessor = 
   369 		REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
   370 	accessor.StoreL(*Context().iRegistryData, Context().iWriteStream);
   371 	}
   372 
   373 inline CRegistryData_UnitTestContext& CRegistryData_StoreL_Transition::Context() const
   374 	{
   375 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   376 	}
   377 
   378 // ______________________________________________________________________________
   379 //
   380 _LIT(KRegistryDataMatchOnUidTransition,"CRegistryData_MatchOnUid_Transition");
   381 
   382 inline CRegistryData_MatchOnUid_Transition::CRegistryData_MatchOnUid_Transition(CUnitTestContext& aUTContext,
   383 													TTransitionValidator& aValidator)
   384 : CTransitionType(KRegistryDataMatchOnUidTransition, aUTContext, aValidator)
   385 	{
   386 	// Do nothing here.
   387 	}
   388 
   389 inline void CRegistryData_MatchOnUid_Transition::TransitMethodL()
   390 	{
   391 	_LIT(KRegistryDataMatchOnUidTransitMethod, "CRegistryData::MatchOnUid transition");
   392 	Context().DataLogger().LogInformation(KRegistryDataMatchOnUidTransitMethod);
   393 	TRegistryData_StateAccessor& accessor = 
   394 		REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
   395 		accessor.MatchOnUid();
   396 	}
   397 
   398 inline CRegistryData_UnitTestContext& CRegistryData_MatchOnUid_Transition::Context() const
   399 	{
   400 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   401 	}
   402 
   403 // ______________________________________________________________________________
   404 //
   405 _LIT(KRegistryDataDiscoveriesBeginningTransition,"CRegistryData_DiscoveriesBeginning_Transition");
   406 
   407 inline CRegistryData_DiscoveriesBeginning_Transition::CRegistryData_DiscoveriesBeginning_Transition(CUnitTestContext& aUTContext,
   408 													TTransitionValidator& aValidator)
   409 : CTransition(KRegistryDataDiscoveriesBeginningTransition, aUTContext, aValidator)
   410 	{
   411 	// Do nothing here.
   412 	}
   413 
   414 inline void CRegistryData_DiscoveriesBeginning_Transition::TransitMethodL()
   415 	{
   416 	_LIT(KRegistryDataDiscoveriesBeginningTransitMethod, "CRegistryData::DiscoveriesBeginning transition");
   417 	Context().DataLogger().LogInformation(KRegistryDataDiscoveriesBeginningTransitMethod);
   418 
   419 	Context().iRegistryData->DiscoveriesBeginning();
   420 	}
   421 
   422 inline CRegistryData_UnitTestContext& CRegistryData_DiscoveriesBeginning_Transition::Context() const
   423 	{
   424 	return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
   425 	}
   426