os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistryDataTest/RegistryDataTransitions.inl
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistryDataTest/RegistryDataTransitions.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,426 @@
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 implementation of the transition classes for the CRegistryData tests.
1.18 +//
1.19 +//
1.20 +
1.21 +// ______________________________________________________________________________
1.22 +//
1.23 +_LIT(KRegistryDataNewLTransition,"CRegistryData_NewL_Transition");
1.24 +
1.25 +inline CRegistryData_NewL_Transition::CRegistryData_NewL_Transition(CUnitTestContext& aUTContext,
1.26 + TTransitionValidator& aValidator)
1.27 +: CTransition(KRegistryDataNewLTransition, aUTContext, aValidator)
1.28 + {
1.29 + // Do nothing here.
1.30 + }
1.31 +
1.32 +inline void CRegistryData_NewL_Transition::TransitMethodL()
1.33 + {
1.34 + Context().iRegistryData = CRegistryData::NewL(Context().iFs);
1.35 + }
1.36 +
1.37 +inline CRegistryData_UnitTestContext& CRegistryData_NewL_Transition::Context() const
1.38 + {
1.39 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.40 + }
1.41 +
1.42 +// ______________________________________________________________________________
1.43 +//
1.44 +_LIT(KRegistryDataDtorTransition,"CRegistryData_Dtor_Transition");
1.45 +
1.46 +inline CRegistryData_Dtor_Transition::CRegistryData_Dtor_Transition(CUnitTestContext& aUTContext,
1.47 + TTransitionValidator& aValidator)
1.48 +: CTransition(KRegistryDataDtorTransition, aUTContext, aValidator)
1.49 + {
1.50 + // Do nothing here.
1.51 + }
1.52 +
1.53 +inline void CRegistryData_Dtor_Transition::TransitMethodL()
1.54 + {
1.55 + delete Context().iRegistryData;
1.56 + Context().iRegistryData = NULL;
1.57 + }
1.58 +
1.59 +inline CRegistryData_UnitTestContext& CRegistryData_Dtor_Transition::Context() const
1.60 + {
1.61 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.62 + }
1.63 +
1.64 +// ______________________________________________________________________________
1.65 +//
1.66 +_LIT(KRegistryDataAddDllDataLTransition,"CRegistryData_AddDllDataL_Transition");
1.67 +
1.68 +inline CRegistryData_AddDllDataL_Transition::CRegistryData_AddDllDataL_Transition(CUnitTestContext& aUTContext,
1.69 + TTransitionValidator& aValidator)
1.70 +: CTransitionType(KRegistryDataAddDllDataLTransition, aUTContext, aValidator)
1.71 + {
1.72 + // Do nothing here.
1.73 + }
1.74 +
1.75 +inline void CRegistryData_AddDllDataL_Transition::TransitMethodL()
1.76 + {
1.77 + _LIT(KRegistryDataAddDllDataLTransitMethod, "CRegistryData::AddDllDataL transition");
1.78 + Context().DataLogger().LogInformation(KRegistryDataAddDllDataLTransitMethod);
1.79 + Context().iRegistryData->AddDllDataL(Context().iDriveUnit,
1.80 + Context().iFoundDriveIndex,
1.81 + Context().iDllData);
1.82 +
1.83 + Context().iDllData = NULL;
1.84 + }
1.85 +
1.86 +inline CRegistryData_UnitTestContext& CRegistryData_AddDllDataL_Transition::Context() const
1.87 + {
1.88 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.89 + }
1.90 +
1.91 +// ______________________________________________________________________________
1.92 +//
1.93 +_LIT(KRegistryDataGetImplementationInformationLTransition,"CRegistryData_GetImplementationInformationL_Transition");
1.94 +
1.95 +inline CRegistryData_GetImplementationInformationL_Transition::CRegistryData_GetImplementationInformationL_Transition(CUnitTestContext& aUTContext,
1.96 + TTransitionValidator& aValidator)
1.97 +: CTransitionType(KRegistryDataGetImplementationInformationLTransition, aUTContext, aValidator)
1.98 + {
1.99 + // Do nothing here.
1.100 + }
1.101 +
1.102 +inline void CRegistryData_GetImplementationInformationL_Transition::TransitMethodL()
1.103 + {
1.104 + _LIT(KRegistryDataGetImplementationInformationLTransitMethod, "CRegistryData::GetImplementationInformationL transition");
1.105 + Context().DataLogger().LogInformation(KRegistryDataGetImplementationInformationLTransitMethod);
1.106 + Context().iImplementationRef = &(Context().iRegistryData->GetImplementationDataL(Context().iImplementationUid));
1.107 + }
1.108 +
1.109 +inline CRegistryData_UnitTestContext& CRegistryData_GetImplementationInformationL_Transition::Context() const
1.110 + {
1.111 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.112 + }
1.113 +
1.114 +// ______________________________________________________________________________
1.115 +//
1.116 +_LIT(KRegistryDataIsRegisteredWithDateLTransition,"CRegistryData_IsRegisteredWithDateL_Transition");
1.117 +
1.118 +inline CRegistryData_IsRegisteredWithDateL_Transition::CRegistryData_IsRegisteredWithDateL_Transition(CUnitTestContext& aUTContext,
1.119 + TTransitionValidator& aValidator)
1.120 +: CTransitionType(KRegistryDataIsRegisteredWithDateLTransition, aUTContext, aValidator)
1.121 + {
1.122 + // Do nothing here.
1.123 + }
1.124 +
1.125 +inline void CRegistryData_IsRegisteredWithDateL_Transition::TransitMethodL()
1.126 + {
1.127 + _LIT(KRegistryDataIsRegisteredWithDateLTransitMethod, "CRegistryData::IsRegisteredWithDateL transition");
1.128 + Context().DataLogger().LogInformation(KRegistryDataIsRegisteredWithDateLTransitMethod);
1.129 + Context().iRegistryData->IsRegisteredWithDateL(Context().iDriveUnit,
1.130 + Context().iDllEntry[2],
1.131 + Context().iDllEntry.iModified,
1.132 + Context().iUpdate,
1.133 + Context().iFoundDriveIndex);
1.134 + }
1.135 +
1.136 +inline CRegistryData_UnitTestContext& CRegistryData_IsRegisteredWithDateL_Transition::Context() const
1.137 + {
1.138 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.139 + }
1.140 +
1.141 +// ______________________________________________________________________________
1.142 +//
1.143 +_LIT(KRegistryDataListImplementationsLTransition,"CRegistryData_ListImplementationsL_Transition");
1.144 +
1.145 +inline CRegistryData_ListImplementationsL_Transition::CRegistryData_ListImplementationsL_Transition(CUnitTestContext& aUTContext,
1.146 + TTransitionValidator& aValidator)
1.147 +: CTransitionType(KRegistryDataListImplementationsLTransition, aUTContext, aValidator)
1.148 + {
1.149 + // Do nothing here.
1.150 + }
1.151 +
1.152 +inline void CRegistryData_ListImplementationsL_Transition::TransitMethodL()
1.153 + {
1.154 + _LIT(KRegistryDataListImplementationsLTransitMethod, "CRegistryData::ListImplementationsL transition");
1.155 + Context().DataLogger().LogInformation(KRegistryDataListImplementationsLTransitMethod);
1.156 + Context().iUidList = &Context().iRegistryData->ListImplementationsL(Context().iInterfaceUid);
1.157 + }
1.158 +
1.159 +inline CRegistryData_UnitTestContext& CRegistryData_ListImplementationsL_Transition::Context() const
1.160 + {
1.161 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.162 + }
1.163 +
1.164 +// ______________________________________________________________________________
1.165 +//
1.166 +_LIT(KRegistryDataSetEnabledStateTransition,"CRegistryData_SetEnabledState_Transition");
1.167 +
1.168 +inline CRegistryData_SetEnabledState_Transition::CRegistryData_SetEnabledState_Transition(CUnitTestContext& aUTContext,
1.169 + TTransitionValidator& aValidator)
1.170 +: CTransitionType(KRegistryDataSetEnabledStateTransition, aUTContext, aValidator)
1.171 + {
1.172 + // Do nothing here.
1.173 + }
1.174 +
1.175 +inline void CRegistryData_SetEnabledState_Transition::TransitMethodL()
1.176 + {
1.177 + _LIT(KRegistryDataSetEnabledStateTransitMethod, "CRegistryData::SetEnabledState transition");
1.178 + Context().DataLogger().LogInformation(KRegistryDataSetEnabledStateTransitMethod);
1.179 + Context().iMethodCompletionStatus = Context().iRegistryData->SetEnabledState(Context().iImplementationUid, Context().iEnabledState);
1.180 + }
1.181 +
1.182 +inline CRegistryData_UnitTestContext& CRegistryData_SetEnabledState_Transition::Context() const
1.183 + {
1.184 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.185 + }
1.186 +
1.187 +// ______________________________________________________________________________
1.188 +//
1.189 +_LIT(KRegistryDataPersistNowLTransition,"CRegistryData_PersistNowL_Transition");
1.190 +
1.191 +inline CRegistryData_PersistNowL_Transition::CRegistryData_PersistNowL_Transition(CUnitTestContext& aUTContext,
1.192 + TTransitionValidator& aValidator)
1.193 +: CTransitionType(KRegistryDataPersistNowLTransition, aUTContext, aValidator)
1.194 + {
1.195 + // Do nothing here.
1.196 + }
1.197 +
1.198 +inline void CRegistryData_PersistNowL_Transition::TransitMethodL()
1.199 + {
1.200 + _LIT(KRegistryDataPersistNowLTransitMethod, "CRegistryData::PersistNowL transition");
1.201 + Context().DataLogger().LogInformation(KRegistryDataPersistNowLTransitMethod);
1.202 + Context().iRegistryData->PersistNowL();
1.203 + }
1.204 +
1.205 +inline CRegistryData_UnitTestContext& CRegistryData_PersistNowL_Transition::Context() const
1.206 + {
1.207 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.208 + }
1.209 +
1.210 +// ______________________________________________________________________________
1.211 +//
1.212 +_LIT(KRegistryDataTemporaryUninstallLTransition,"CRegistryData_TemporaryUninstallL_Transition");
1.213 +
1.214 +inline CRegistryData_TemporaryUninstallL_Transition::CRegistryData_TemporaryUninstallL_Transition(CUnitTestContext& aUTContext,
1.215 + TTransitionValidator& aValidator)
1.216 +: CTransitionType(KRegistryDataTemporaryUninstallLTransition, aUTContext, aValidator)
1.217 + {
1.218 + // Do nothing here.
1.219 + }
1.220 +
1.221 +inline void CRegistryData_TemporaryUninstallL_Transition::TransitMethodL()
1.222 + {
1.223 + _LIT(KRegistryDataTemporaryUninstallLTransitMethod, "CRegistryData::TemporaryUninstallL transition");
1.224 + Context().DataLogger().LogInformation(KRegistryDataTemporaryUninstallLTransitMethod);
1.225 + Context().iRegistryData->TemporaryUninstallL(Context().iDriveUnit);
1.226 + }
1.227 +
1.228 +inline CRegistryData_UnitTestContext& CRegistryData_TemporaryUninstallL_Transition::Context() const
1.229 + {
1.230 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.231 + }
1.232 +
1.233 +// ______________________________________________________________________________
1.234 +//
1.235 +_LIT(KRegistryDataUndoTemporaryUninstallLTransition,"CRegistryData_UndoTemporaryUninstallL_Transition");
1.236 +
1.237 +inline CRegistryData_UndoTemporaryUninstallL_Transition::CRegistryData_UndoTemporaryUninstallL_Transition(CUnitTestContext& aUTContext,
1.238 + TTransitionValidator& aValidator)
1.239 +: CTransitionType(KRegistryDataUndoTemporaryUninstallLTransition, aUTContext, aValidator)
1.240 + {
1.241 + // Do nothing here.
1.242 + }
1.243 +
1.244 +inline void CRegistryData_UndoTemporaryUninstallL_Transition::TransitMethodL()
1.245 + {
1.246 + _LIT(KRegistryDataUndoTemporaryUninstallLTransitMethod, "CRegistryData::UndoTemporaryUninstallL transition");
1.247 + Context().DataLogger().LogInformation(KRegistryDataUndoTemporaryUninstallLTransitMethod);
1.248 + Context().iRegistryData->UndoTemporaryUninstallL(Context().iDriveUnit);
1.249 + }
1.250 +
1.251 +inline CRegistryData_UnitTestContext& CRegistryData_UndoTemporaryUninstallL_Transition::Context() const
1.252 + {
1.253 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.254 + }
1.255 +
1.256 +// ______________________________________________________________________________
1.257 +//
1.258 +_LIT(KRegistryDataUpdateDllDataLTransition,"CRegistryData_UpdateDllDataL_Transition");
1.259 +
1.260 +inline CRegistryData_UpdateDllDataL_Transition::CRegistryData_UpdateDllDataL_Transition(CUnitTestContext& aUTContext,
1.261 + TTransitionValidator& aValidator)
1.262 +: CTransitionType(KRegistryDataUpdateDllDataLTransition, aUTContext, aValidator)
1.263 + {
1.264 + // Do nothing here.
1.265 + }
1.266 +
1.267 +inline void CRegistryData_UpdateDllDataL_Transition::TransitMethodL()
1.268 + {
1.269 + _LIT(KRegistryDataUpdateDllDataLTransitMethod, "CRegistryData::UpdateDllDataL transition");
1.270 + Context().DataLogger().LogInformation(KRegistryDataUpdateDllDataLTransitMethod);
1.271 + Context().iRegistryData->UpdateDllDataL(Context().iFoundDriveIndex, Context().iNewDllData);
1.272 +
1.273 + Context().iNewDllData = NULL;
1.274 + }
1.275 +
1.276 +inline CRegistryData_UnitTestContext& CRegistryData_UpdateDllDataL_Transition::Context() const
1.277 + {
1.278 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.279 + }
1.280 +
1.281 +// ______________________________________________________________________________
1.282 +//
1.283 +_LIT(KRegistryDataBuildIndexesLTransition,"CRegistryData_BuildIndexesL_Transition");
1.284 +
1.285 +inline CRegistryData_BuildIndexesL_Transition::CRegistryData_BuildIndexesL_Transition(CUnitTestContext& aUTContext,
1.286 + TTransitionValidator& aValidator)
1.287 +: CTransitionType(KRegistryDataBuildIndexesLTransition, aUTContext, aValidator)
1.288 + {
1.289 + // Do nothing here.
1.290 + }
1.291 +
1.292 +inline void CRegistryData_BuildIndexesL_Transition::TransitMethodL()
1.293 + {
1.294 + _LIT(KRegistryDataBuildIndexesLTransitMethod, "CRegistryData::BuildIndexesL transition");
1.295 + Context().DataLogger().LogInformation(KRegistryDataBuildIndexesLTransitMethod);
1.296 + TRegistryData_StateAccessor& accessor =
1.297 + REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
1.298 + accessor.BuildIndexesL(*Context().iRegistryData);
1.299 + }
1.300 +
1.301 +inline CRegistryData_UnitTestContext& CRegistryData_BuildIndexesL_Transition::Context() const
1.302 + {
1.303 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.304 + }
1.305 +
1.306 +// ______________________________________________________________________________
1.307 +//
1.308 +_LIT(KRegistryDataIndexedFindTransition,"CRegistryData_IndexedFind_Transition");
1.309 +
1.310 +inline CRegistryData_IndexedFind_Transition::CRegistryData_IndexedFind_Transition(CUnitTestContext& aUTContext,
1.311 + TTransitionValidator& aValidator)
1.312 +: CTransitionType(KRegistryDataIndexedFindTransition, aUTContext, aValidator)
1.313 + {
1.314 + // Do nothing here.
1.315 + }
1.316 +
1.317 +inline void CRegistryData_IndexedFind_Transition::TransitMethodL()
1.318 + {
1.319 + _LIT(KRegistryDataIndexedFindTransitMethod, "CRegistryData::IndexedFind transition");
1.320 + Context().DataLogger().LogInformation(KRegistryDataIndexedFindTransitMethod);
1.321 + TRegistryData_StateAccessor& accessor =
1.322 + REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
1.323 + accessor.IndexedFind(*Context().iRegistryData, Context().iImplementationUid);
1.324 + }
1.325 +
1.326 +inline CRegistryData_UnitTestContext& CRegistryData_IndexedFind_Transition::Context() const
1.327 + {
1.328 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.329 + }
1.330 +
1.331 +// ______________________________________________________________________________
1.332 +//
1.333 +_LIT(KRegistryDataRestoreLTransition,"CRegistryData_RestoreL_Transition");
1.334 +
1.335 +inline CRegistryData_RestoreL_Transition::CRegistryData_RestoreL_Transition(CUnitTestContext& aUTContext,
1.336 + TTransitionValidator& aValidator)
1.337 +: CTransitionType(KRegistryDataRestoreLTransition, aUTContext, aValidator)
1.338 + {
1.339 + // Do nothing here.
1.340 + }
1.341 +
1.342 +inline void CRegistryData_RestoreL_Transition::TransitMethodL()
1.343 + {
1.344 + _LIT(KRegistryDataRestoreLTransitMethod, "CRegistryData::RestoreL transition");
1.345 + Context().DataLogger().LogInformation(KRegistryDataRestoreLTransitMethod);
1.346 + TRegistryData_StateAccessor& accessor =
1.347 + REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
1.348 + accessor.RestoreL(*Context().iRegistryData, Context().iReadStream);
1.349 + }
1.350 +
1.351 +inline CRegistryData_UnitTestContext& CRegistryData_RestoreL_Transition::Context() const
1.352 + {
1.353 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.354 + }
1.355 +
1.356 +// ______________________________________________________________________________
1.357 +//
1.358 +_LIT(KRegistryDataStoreLTransition,"CRegistryData_StoreL_Transition");
1.359 +
1.360 +inline CRegistryData_StoreL_Transition::CRegistryData_StoreL_Transition(CUnitTestContext& aUTContext,
1.361 + TTransitionValidator& aValidator)
1.362 +: CTransitionType(KRegistryDataStoreLTransition, aUTContext, aValidator)
1.363 + {
1.364 + // Do nothing here.
1.365 + }
1.366 +
1.367 +inline void CRegistryData_StoreL_Transition::TransitMethodL()
1.368 + {
1.369 + _LIT(KRegistryDataStoreLTransitMethod, "CRegistryData::StoreL transition");
1.370 + Context().DataLogger().LogInformation(KRegistryDataStoreLTransitMethod);
1.371 + TRegistryData_StateAccessor& accessor =
1.372 + REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
1.373 + accessor.StoreL(*Context().iRegistryData, Context().iWriteStream);
1.374 + }
1.375 +
1.376 +inline CRegistryData_UnitTestContext& CRegistryData_StoreL_Transition::Context() const
1.377 + {
1.378 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.379 + }
1.380 +
1.381 +// ______________________________________________________________________________
1.382 +//
1.383 +_LIT(KRegistryDataMatchOnUidTransition,"CRegistryData_MatchOnUid_Transition");
1.384 +
1.385 +inline CRegistryData_MatchOnUid_Transition::CRegistryData_MatchOnUid_Transition(CUnitTestContext& aUTContext,
1.386 + TTransitionValidator& aValidator)
1.387 +: CTransitionType(KRegistryDataMatchOnUidTransition, aUTContext, aValidator)
1.388 + {
1.389 + // Do nothing here.
1.390 + }
1.391 +
1.392 +inline void CRegistryData_MatchOnUid_Transition::TransitMethodL()
1.393 + {
1.394 + _LIT(KRegistryDataMatchOnUidTransitMethod, "CRegistryData::MatchOnUid transition");
1.395 + Context().DataLogger().LogInformation(KRegistryDataMatchOnUidTransitMethod);
1.396 + TRegistryData_StateAccessor& accessor =
1.397 + REINTERPRET_CAST(TRegistryData_StateAccessor&, Context().StateAccessor());
1.398 + accessor.MatchOnUid();
1.399 + }
1.400 +
1.401 +inline CRegistryData_UnitTestContext& CRegistryData_MatchOnUid_Transition::Context() const
1.402 + {
1.403 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.404 + }
1.405 +
1.406 +// ______________________________________________________________________________
1.407 +//
1.408 +_LIT(KRegistryDataDiscoveriesBeginningTransition,"CRegistryData_DiscoveriesBeginning_Transition");
1.409 +
1.410 +inline CRegistryData_DiscoveriesBeginning_Transition::CRegistryData_DiscoveriesBeginning_Transition(CUnitTestContext& aUTContext,
1.411 + TTransitionValidator& aValidator)
1.412 +: CTransition(KRegistryDataDiscoveriesBeginningTransition, aUTContext, aValidator)
1.413 + {
1.414 + // Do nothing here.
1.415 + }
1.416 +
1.417 +inline void CRegistryData_DiscoveriesBeginning_Transition::TransitMethodL()
1.418 + {
1.419 + _LIT(KRegistryDataDiscoveriesBeginningTransitMethod, "CRegistryData::DiscoveriesBeginning transition");
1.420 + Context().DataLogger().LogInformation(KRegistryDataDiscoveriesBeginningTransitMethod);
1.421 +
1.422 + Context().iRegistryData->DiscoveriesBeginning();
1.423 + }
1.424 +
1.425 +inline CRegistryData_UnitTestContext& CRegistryData_DiscoveriesBeginning_Transition::Context() const
1.426 + {
1.427 + return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.428 + }
1.429 +