os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistryDataTest/RegistryDataTransitions.inl
First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // The implementation of the transition classes for the CRegistryData tests.
18 // ______________________________________________________________________________
20 _LIT(KRegistryDataNewLTransition,"CRegistryData_NewL_Transition");
22 inline CRegistryData_NewL_Transition::CRegistryData_NewL_Transition(CUnitTestContext& aUTContext,
23 TTransitionValidator& aValidator)
24 : CTransition(KRegistryDataNewLTransition, aUTContext, aValidator)
29 inline void CRegistryData_NewL_Transition::TransitMethodL()
31 Context().iRegistryData = CRegistryData::NewL(Context().iFs);
34 inline CRegistryData_UnitTestContext& CRegistryData_NewL_Transition::Context() const
36 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
39 // ______________________________________________________________________________
41 _LIT(KRegistryDataDtorTransition,"CRegistryData_Dtor_Transition");
43 inline CRegistryData_Dtor_Transition::CRegistryData_Dtor_Transition(CUnitTestContext& aUTContext,
44 TTransitionValidator& aValidator)
45 : CTransition(KRegistryDataDtorTransition, aUTContext, aValidator)
50 inline void CRegistryData_Dtor_Transition::TransitMethodL()
52 delete Context().iRegistryData;
53 Context().iRegistryData = NULL;
56 inline CRegistryData_UnitTestContext& CRegistryData_Dtor_Transition::Context() const
58 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
61 // ______________________________________________________________________________
63 _LIT(KRegistryDataAddDllDataLTransition,"CRegistryData_AddDllDataL_Transition");
65 inline CRegistryData_AddDllDataL_Transition::CRegistryData_AddDllDataL_Transition(CUnitTestContext& aUTContext,
66 TTransitionValidator& aValidator)
67 : CTransitionType(KRegistryDataAddDllDataLTransition, aUTContext, aValidator)
72 inline void CRegistryData_AddDllDataL_Transition::TransitMethodL()
74 _LIT(KRegistryDataAddDllDataLTransitMethod, "CRegistryData::AddDllDataL transition");
75 Context().DataLogger().LogInformation(KRegistryDataAddDllDataLTransitMethod);
76 Context().iRegistryData->AddDllDataL(Context().iDriveUnit,
77 Context().iFoundDriveIndex,
80 Context().iDllData = NULL;
83 inline CRegistryData_UnitTestContext& CRegistryData_AddDllDataL_Transition::Context() const
85 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
88 // ______________________________________________________________________________
90 _LIT(KRegistryDataGetImplementationInformationLTransition,"CRegistryData_GetImplementationInformationL_Transition");
92 inline CRegistryData_GetImplementationInformationL_Transition::CRegistryData_GetImplementationInformationL_Transition(CUnitTestContext& aUTContext,
93 TTransitionValidator& aValidator)
94 : CTransitionType(KRegistryDataGetImplementationInformationLTransition, aUTContext, aValidator)
99 inline void CRegistryData_GetImplementationInformationL_Transition::TransitMethodL()
101 _LIT(KRegistryDataGetImplementationInformationLTransitMethod, "CRegistryData::GetImplementationInformationL transition");
102 Context().DataLogger().LogInformation(KRegistryDataGetImplementationInformationLTransitMethod);
103 Context().iImplementationRef = &(Context().iRegistryData->GetImplementationDataL(Context().iImplementationUid));
106 inline CRegistryData_UnitTestContext& CRegistryData_GetImplementationInformationL_Transition::Context() const
108 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
111 // ______________________________________________________________________________
113 _LIT(KRegistryDataIsRegisteredWithDateLTransition,"CRegistryData_IsRegisteredWithDateL_Transition");
115 inline CRegistryData_IsRegisteredWithDateL_Transition::CRegistryData_IsRegisteredWithDateL_Transition(CUnitTestContext& aUTContext,
116 TTransitionValidator& aValidator)
117 : CTransitionType(KRegistryDataIsRegisteredWithDateLTransition, aUTContext, aValidator)
122 inline void CRegistryData_IsRegisteredWithDateL_Transition::TransitMethodL()
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,
130 Context().iFoundDriveIndex);
133 inline CRegistryData_UnitTestContext& CRegistryData_IsRegisteredWithDateL_Transition::Context() const
135 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
138 // ______________________________________________________________________________
140 _LIT(KRegistryDataListImplementationsLTransition,"CRegistryData_ListImplementationsL_Transition");
142 inline CRegistryData_ListImplementationsL_Transition::CRegistryData_ListImplementationsL_Transition(CUnitTestContext& aUTContext,
143 TTransitionValidator& aValidator)
144 : CTransitionType(KRegistryDataListImplementationsLTransition, aUTContext, aValidator)
149 inline void CRegistryData_ListImplementationsL_Transition::TransitMethodL()
151 _LIT(KRegistryDataListImplementationsLTransitMethod, "CRegistryData::ListImplementationsL transition");
152 Context().DataLogger().LogInformation(KRegistryDataListImplementationsLTransitMethod);
153 Context().iUidList = &Context().iRegistryData->ListImplementationsL(Context().iInterfaceUid);
156 inline CRegistryData_UnitTestContext& CRegistryData_ListImplementationsL_Transition::Context() const
158 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
161 // ______________________________________________________________________________
163 _LIT(KRegistryDataSetEnabledStateTransition,"CRegistryData_SetEnabledState_Transition");
165 inline CRegistryData_SetEnabledState_Transition::CRegistryData_SetEnabledState_Transition(CUnitTestContext& aUTContext,
166 TTransitionValidator& aValidator)
167 : CTransitionType(KRegistryDataSetEnabledStateTransition, aUTContext, aValidator)
172 inline void CRegistryData_SetEnabledState_Transition::TransitMethodL()
174 _LIT(KRegistryDataSetEnabledStateTransitMethod, "CRegistryData::SetEnabledState transition");
175 Context().DataLogger().LogInformation(KRegistryDataSetEnabledStateTransitMethod);
176 Context().iMethodCompletionStatus = Context().iRegistryData->SetEnabledState(Context().iImplementationUid, Context().iEnabledState);
179 inline CRegistryData_UnitTestContext& CRegistryData_SetEnabledState_Transition::Context() const
181 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
184 // ______________________________________________________________________________
186 _LIT(KRegistryDataPersistNowLTransition,"CRegistryData_PersistNowL_Transition");
188 inline CRegistryData_PersistNowL_Transition::CRegistryData_PersistNowL_Transition(CUnitTestContext& aUTContext,
189 TTransitionValidator& aValidator)
190 : CTransitionType(KRegistryDataPersistNowLTransition, aUTContext, aValidator)
195 inline void CRegistryData_PersistNowL_Transition::TransitMethodL()
197 _LIT(KRegistryDataPersistNowLTransitMethod, "CRegistryData::PersistNowL transition");
198 Context().DataLogger().LogInformation(KRegistryDataPersistNowLTransitMethod);
199 Context().iRegistryData->PersistNowL();
202 inline CRegistryData_UnitTestContext& CRegistryData_PersistNowL_Transition::Context() const
204 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
207 // ______________________________________________________________________________
209 _LIT(KRegistryDataTemporaryUninstallLTransition,"CRegistryData_TemporaryUninstallL_Transition");
211 inline CRegistryData_TemporaryUninstallL_Transition::CRegistryData_TemporaryUninstallL_Transition(CUnitTestContext& aUTContext,
212 TTransitionValidator& aValidator)
213 : CTransitionType(KRegistryDataTemporaryUninstallLTransition, aUTContext, aValidator)
218 inline void CRegistryData_TemporaryUninstallL_Transition::TransitMethodL()
220 _LIT(KRegistryDataTemporaryUninstallLTransitMethod, "CRegistryData::TemporaryUninstallL transition");
221 Context().DataLogger().LogInformation(KRegistryDataTemporaryUninstallLTransitMethod);
222 Context().iRegistryData->TemporaryUninstallL(Context().iDriveUnit);
225 inline CRegistryData_UnitTestContext& CRegistryData_TemporaryUninstallL_Transition::Context() const
227 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
230 // ______________________________________________________________________________
232 _LIT(KRegistryDataUndoTemporaryUninstallLTransition,"CRegistryData_UndoTemporaryUninstallL_Transition");
234 inline CRegistryData_UndoTemporaryUninstallL_Transition::CRegistryData_UndoTemporaryUninstallL_Transition(CUnitTestContext& aUTContext,
235 TTransitionValidator& aValidator)
236 : CTransitionType(KRegistryDataUndoTemporaryUninstallLTransition, aUTContext, aValidator)
241 inline void CRegistryData_UndoTemporaryUninstallL_Transition::TransitMethodL()
243 _LIT(KRegistryDataUndoTemporaryUninstallLTransitMethod, "CRegistryData::UndoTemporaryUninstallL transition");
244 Context().DataLogger().LogInformation(KRegistryDataUndoTemporaryUninstallLTransitMethod);
245 Context().iRegistryData->UndoTemporaryUninstallL(Context().iDriveUnit);
248 inline CRegistryData_UnitTestContext& CRegistryData_UndoTemporaryUninstallL_Transition::Context() const
250 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
253 // ______________________________________________________________________________
255 _LIT(KRegistryDataUpdateDllDataLTransition,"CRegistryData_UpdateDllDataL_Transition");
257 inline CRegistryData_UpdateDllDataL_Transition::CRegistryData_UpdateDllDataL_Transition(CUnitTestContext& aUTContext,
258 TTransitionValidator& aValidator)
259 : CTransitionType(KRegistryDataUpdateDllDataLTransition, aUTContext, aValidator)
264 inline void CRegistryData_UpdateDllDataL_Transition::TransitMethodL()
266 _LIT(KRegistryDataUpdateDllDataLTransitMethod, "CRegistryData::UpdateDllDataL transition");
267 Context().DataLogger().LogInformation(KRegistryDataUpdateDllDataLTransitMethod);
268 Context().iRegistryData->UpdateDllDataL(Context().iFoundDriveIndex, Context().iNewDllData);
270 Context().iNewDllData = NULL;
273 inline CRegistryData_UnitTestContext& CRegistryData_UpdateDllDataL_Transition::Context() const
275 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
278 // ______________________________________________________________________________
280 _LIT(KRegistryDataBuildIndexesLTransition,"CRegistryData_BuildIndexesL_Transition");
282 inline CRegistryData_BuildIndexesL_Transition::CRegistryData_BuildIndexesL_Transition(CUnitTestContext& aUTContext,
283 TTransitionValidator& aValidator)
284 : CTransitionType(KRegistryDataBuildIndexesLTransition, aUTContext, aValidator)
289 inline void CRegistryData_BuildIndexesL_Transition::TransitMethodL()
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);
298 inline CRegistryData_UnitTestContext& CRegistryData_BuildIndexesL_Transition::Context() const
300 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
303 // ______________________________________________________________________________
305 _LIT(KRegistryDataIndexedFindTransition,"CRegistryData_IndexedFind_Transition");
307 inline CRegistryData_IndexedFind_Transition::CRegistryData_IndexedFind_Transition(CUnitTestContext& aUTContext,
308 TTransitionValidator& aValidator)
309 : CTransitionType(KRegistryDataIndexedFindTransition, aUTContext, aValidator)
314 inline void CRegistryData_IndexedFind_Transition::TransitMethodL()
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);
323 inline CRegistryData_UnitTestContext& CRegistryData_IndexedFind_Transition::Context() const
325 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
328 // ______________________________________________________________________________
330 _LIT(KRegistryDataRestoreLTransition,"CRegistryData_RestoreL_Transition");
332 inline CRegistryData_RestoreL_Transition::CRegistryData_RestoreL_Transition(CUnitTestContext& aUTContext,
333 TTransitionValidator& aValidator)
334 : CTransitionType(KRegistryDataRestoreLTransition, aUTContext, aValidator)
339 inline void CRegistryData_RestoreL_Transition::TransitMethodL()
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);
348 inline CRegistryData_UnitTestContext& CRegistryData_RestoreL_Transition::Context() const
350 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
353 // ______________________________________________________________________________
355 _LIT(KRegistryDataStoreLTransition,"CRegistryData_StoreL_Transition");
357 inline CRegistryData_StoreL_Transition::CRegistryData_StoreL_Transition(CUnitTestContext& aUTContext,
358 TTransitionValidator& aValidator)
359 : CTransitionType(KRegistryDataStoreLTransition, aUTContext, aValidator)
364 inline void CRegistryData_StoreL_Transition::TransitMethodL()
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);
373 inline CRegistryData_UnitTestContext& CRegistryData_StoreL_Transition::Context() const
375 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
378 // ______________________________________________________________________________
380 _LIT(KRegistryDataMatchOnUidTransition,"CRegistryData_MatchOnUid_Transition");
382 inline CRegistryData_MatchOnUid_Transition::CRegistryData_MatchOnUid_Transition(CUnitTestContext& aUTContext,
383 TTransitionValidator& aValidator)
384 : CTransitionType(KRegistryDataMatchOnUidTransition, aUTContext, aValidator)
389 inline void CRegistryData_MatchOnUid_Transition::TransitMethodL()
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();
398 inline CRegistryData_UnitTestContext& CRegistryData_MatchOnUid_Transition::Context() const
400 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
403 // ______________________________________________________________________________
405 _LIT(KRegistryDataDiscoveriesBeginningTransition,"CRegistryData_DiscoveriesBeginning_Transition");
407 inline CRegistryData_DiscoveriesBeginning_Transition::CRegistryData_DiscoveriesBeginning_Transition(CUnitTestContext& aUTContext,
408 TTransitionValidator& aValidator)
409 : CTransition(KRegistryDataDiscoveriesBeginningTransition, aUTContext, aValidator)
414 inline void CRegistryData_DiscoveriesBeginning_Transition::TransitMethodL()
416 _LIT(KRegistryDataDiscoveriesBeginningTransitMethod, "CRegistryData::DiscoveriesBeginning transition");
417 Context().DataLogger().LogInformation(KRegistryDataDiscoveriesBeginningTransitMethod);
419 Context().iRegistryData->DiscoveriesBeginning();
422 inline CRegistryData_UnitTestContext& CRegistryData_DiscoveriesBeginning_Transition::Context() const
424 return REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);