os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitions.inl
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // The implementation of the transition classes upon the CUnitTest class methods.
18 // ______________________________________________________________________________
20 _LIT(KUnitTestNewLTransition,"CUnitTest_NewL_Transition");
22 inline CUnitTest_NewL_Transition::CUnitTest_NewL_Transition(CUnitTestContext& aUTContext,
23 TTransitionValidator& aValidator)
24 : CTransitionType(KUnitTestNewLTransition, aUTContext, aValidator)
29 inline void CUnitTest_NewL_Transition::TransitMethodL()
31 _LIT(KUnitTestNewLTransitMethod, "CUnitTest::NewL transition");
32 Context().DataLogger().LogInformation(KUnitTestNewLTransitMethod);
33 TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
34 Context().iUnitTestUnderTest = accessor.CreateUnitTest(*(Context().iUnitTest), *Context().iName, *Context().iDataLogger, *Context().iUnitTestObserver);
37 inline CUnitTest_UnitTestContext& CUnitTest_NewL_Transition::Context() const
39 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
42 // ______________________________________________________________________________
44 _LIT(KUnitTestDtorTransition,"CUnitTest_Dtor_Transition");
46 inline CUnitTest_Dtor_Transition::CUnitTest_Dtor_Transition(CUnitTestContext& aUTContext,
47 TTransitionValidator& aValidator)
48 : CTransition(KUnitTestDtorTransition, aUTContext, aValidator)
53 inline void CUnitTest_Dtor_Transition::TransitMethodL()
55 _LIT(KUnitTestDtorTransitMethod, "CUnitTest::Dtor transition");
56 Context().DataLogger().LogInformation(KUnitTestDtorTransitMethod);
57 delete Context().iUnitTest;
58 Context().iUnitTest = NULL;
61 inline CUnitTest_UnitTestContext& CUnitTest_Dtor_Transition::Context() const
63 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
66 // ______________________________________________________________________________
68 _LIT(KUnitTestTransitionSetLTransition,"CUnitTest_TransitionSetL_Transition");
70 inline CUnitTest_TransitionSetL_Transition::CUnitTest_TransitionSetL_Transition(CUnitTestContext& aUTContext,
71 TTransitionValidator& aValidator)
72 : CTransitionType(KUnitTestTransitionSetLTransition, aUTContext, aValidator)
77 inline void CUnitTest_TransitionSetL_Transition::TransitMethodL()
79 _LIT(KUnitTestTransitionSetLTransitMethod, "CUnitTest::TransitionSetL transition");
80 Context().DataLogger().LogInformation(KUnitTestTransitionSetLTransitMethod);
81 Context().iUnitTestUnderTest->TransitionSetL();
84 inline CUnitTest_UnitTestContext& CUnitTest_TransitionSetL_Transition::Context() const
86 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
89 // ______________________________________________________________________________
91 _LIT(KUnitTestGetCurrentTransitionTransition,"CUnitTest_GetCurrentTransition_Transition");
93 inline CUnitTest_GetCurrentTransition_Transition::CUnitTest_GetCurrentTransition_Transition(CUnitTestContext& aUTContext,
94 TTransitionValidator& aValidator)
95 : CTransition(KUnitTestGetCurrentTransitionTransition, aUTContext, aValidator)
100 inline void CUnitTest_GetCurrentTransition_Transition::TransitMethodL()
102 _LIT(KUnitTestGetCurrentTransitionTransitMethod, "CUnitTest::GetCurrentTransition transition");
103 Context().DataLogger().LogInformation(KUnitTestGetCurrentTransitionTransitMethod);
104 /*Context().iCurrentTransition =*/ Context().iUnitTestUnderTest->GetCurrentTransition();
107 inline CUnitTest_UnitTestContext& CUnitTest_GetCurrentTransition_Transition::Context() const
109 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
112 // ______________________________________________________________________________
114 _LIT(KUnitTestSetCurrentTransitionTransition,"CUnitTest_SetCurrentTransition_Transition");
116 inline CUnitTest_SetCurrentTransition_Transition::CUnitTest_SetCurrentTransition_Transition(CUnitTestContext& aUTContext,
117 TTransitionValidator& aValidator)
118 : CTransition(KUnitTestSetCurrentTransitionTransition, aUTContext, aValidator)
123 inline void CUnitTest_SetCurrentTransition_Transition::TransitMethodL()
125 _LIT(KUnitTestSetCurrentTransitionTransitMethod, "CUnitTest::SetCurrentTransition transition");
126 Context().DataLogger().LogInformation(KUnitTestSetCurrentTransitionTransitMethod);
127 Context().iUnitTest->SetCurrentTransition(*(Context().iTransition));
130 inline CUnitTest_UnitTestContext& CUnitTest_SetCurrentTransition_Transition::Context() const
132 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
135 // ______________________________________________________________________________
137 _LIT(KUnitTestSetParametersLTransition,"CUnitTest_SetParametersL_Transition");
139 inline CUnitTest_SetParametersL_Transition::CUnitTest_SetParametersL_Transition(CUnitTestContext& aUTContext,
140 TTransitionValidator& aValidator)
141 : CTransitionType(KUnitTestSetParametersLTransition, aUTContext, aValidator)
146 inline void CUnitTest_SetParametersL_Transition::TransitMethodL()
148 _LIT(KUnitTestSetParametersLTransitMethod, "CUnitTest::SetParametersL transition");
149 Context().DataLogger().LogInformation(KUnitTestSetParametersLTransitMethod);
150 Context().iUnitTest->SetParametersL(Context().iParams);
153 inline CUnitTest_UnitTestContext& CUnitTest_SetParametersL_Transition::Context() const
155 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
158 // ______________________________________________________________________________
160 _LIT(KUnitTestPrepareUnitTestLTransition,"CUnitTest_PrepareUnitTestL_Transition");
162 inline CUnitTest_PrepareUnitTestL_Transition::CUnitTest_PrepareUnitTestL_Transition(CUnitTestContext& aUTContext,
163 TTransitionValidator& aValidator)
164 : CTransitionType(KUnitTestPrepareUnitTestLTransition, aUTContext, aValidator)
169 inline void CUnitTest_PrepareUnitTestL_Transition::TransitMethodL()
171 _LIT(KUnitTestPrepareUnitTestLTransitMethod, "CUnitTest::PrepareUnitTestL transition");
172 Context().DataLogger().LogInformation(KUnitTestPrepareUnitTestLTransitMethod);
173 Context().iUnitTest->PrepareUnitTestL();
176 inline CUnitTest_UnitTestContext& CUnitTest_PrepareUnitTestL_Transition::Context() const
178 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
181 // ______________________________________________________________________________
183 _LIT(KUnitTestRunTestTransition,"CUnitTest_RunTest_Transition");
185 inline CUnitTest_RunTest_Transition::CUnitTest_RunTest_Transition(CUnitTestContext& aUTContext,
186 TTransitionValidator& aValidator)
187 : CTransition(KUnitTestRunTestTransition, aUTContext, aValidator)
192 inline void CUnitTest_RunTest_Transition::TransitMethodL()
194 _LIT(KUnitTestRunTestTransitMethod, "CUnitTest::RunTest transition");
195 Context().DataLogger().LogInformation(KUnitTestRunTestTransitMethod);
196 Context().iUnitTest->RunTest(Context().iTimeAfter);
199 inline CUnitTest_UnitTestContext& CUnitTest_RunTest_Transition::Context() const
201 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
204 // ______________________________________________________________________________
206 _LIT(KUnitTestAddTransitionLTransition,"CUnitTest_AddTransitionL_Transition");
208 inline CUnitTest_AddTransitionL_Transition::CUnitTest_AddTransitionL_Transition(CUnitTestContext& aUTContext,
209 TTransitionValidator& aValidator)
210 : CTransitionType(KUnitTestAddTransitionLTransition, aUTContext, aValidator)
215 inline void CUnitTest_AddTransitionL_Transition::TransitMethodL()
217 _LIT(KUnitTestAddTransitionLTransitMethod, "CUnitTest::AddTransitionL transition");
218 Context().DataLogger().LogInformation(KUnitTestAddTransitionLTransitMethod);
219 TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
220 accessor.AddTransitionL(*(Context().iUnitTest), (Context().iTransition));
223 inline CUnitTest_UnitTestContext& CUnitTest_AddTransitionL_Transition::Context() const
225 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
228 // ______________________________________________________________________________
230 _LIT(KUnitTestAddBlockingTransitionLTransition,"CUnitTest_AddBlockingTransitionL_Transition");
232 inline CUnitTest_AddBlockingTransitionL_Transition::CUnitTest_AddBlockingTransitionL_Transition(CUnitTestContext& aUTContext,
233 TTransitionValidator& aValidator)
234 : CTransitionType(KUnitTestAddBlockingTransitionLTransition, aUTContext, aValidator)
239 inline void CUnitTest_AddBlockingTransitionL_Transition::TransitMethodL()
241 _LIT(KUnitTestAddBlockingTransitionLTransitMethod, "CUnitTest::AddBlockingTransitionL transition");
242 Context().DataLogger().LogInformation(KUnitTestAddBlockingTransitionLTransitMethod);
243 TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
244 accessor.AddBlockingTransitionL(*(Context().iUnitTest), (Context().iTransition));
247 inline CUnitTest_UnitTestContext& CUnitTest_AddBlockingTransitionL_Transition::Context() const
249 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
252 // ______________________________________________________________________________
254 _LIT(KUnitTestAddLeaveErrorCodeLTransition,"CUnitTest_AddLeaveErrorCodeL_Transition");
256 inline CUnitTest_AddLeaveErrorCodeL_Transition::CUnitTest_AddLeaveErrorCodeL_Transition(CUnitTestContext& aUTContext,
257 TTransitionValidator& aValidator)
258 : CTransitionType(KUnitTestAddLeaveErrorCodeLTransition, aUTContext, aValidator)
263 inline void CUnitTest_AddLeaveErrorCodeL_Transition::TransitMethodL()
265 _LIT(KUnitTestAddLeaveErrorCodeLTransitMethod, "CUnitTest::AddLeaveErrorCodeL transition");
266 Context().DataLogger().LogInformation(KUnitTestAddLeaveErrorCodeLTransitMethod);
267 TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
268 accessor.AddLeaveErrorCodeL(*(Context().iUnitTest), (Context().iLeaveErrorCode));
271 inline CUnitTest_UnitTestContext& CUnitTest_AddLeaveErrorCodeL_Transition::Context() const
273 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
276 // ______________________________________________________________________________
278 _LIT(KUnitTestUnitTestNameTransition,"CUnitTest_UnitTestName_Transition");
280 inline CUnitTest_UnitTestName_Transition::CUnitTest_UnitTestName_Transition(CUnitTestContext& aUTContext,
281 TTransitionValidator& aValidator)
282 : CTransition(KUnitTestUnitTestNameTransition, aUTContext, aValidator)
287 inline void CUnitTest_UnitTestName_Transition::TransitMethodL()
289 _LIT(KUnitTestUnitTestNameTransitMethod, "CUnitTest::UnitTestName transition");
290 Context().DataLogger().LogInformation(KUnitTestUnitTestNameTransitMethod);
291 Context().iUnitTest->UnitTestName();
294 inline CUnitTest_UnitTestContext& CUnitTest_UnitTestName_Transition::Context() const
296 return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
300 // Add additional Transition class Implementations here...