|
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 definitions of the Unit tests upon the CLoadManager class |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __LOADMANAGERUNITTEST_H__ |
|
19 #define __LOADMANAGERUNITTEST_H__ |
|
20 |
|
21 |
|
22 #include <ecom/test_bed/testbeddefinitions.h> |
|
23 #include "LoadManagerStateAccessor.h" |
|
24 #include "LoadManagerTransitionValidation.h" |
|
25 #include "LoadManagerTransitions.h" |
|
26 |
|
27 // ______________________________________________________________________________ |
|
28 // |
|
29 /** |
|
30 @internalComponent |
|
31 Comments : Unit Test for CreateAndDestroy on CLoadManager, the class under test. |
|
32 */ |
|
33 class CLoadManager_CreateAndDestroy_UnitTest : public CUnitTest |
|
34 { |
|
35 public: |
|
36 /** |
|
37 @fn NewL(CDataLogger& aDataLogger, |
|
38 MUnitTestObserver& aObserver) |
|
39 Intended Usage : Standard two-phase construction which leaves nothing on the |
|
40 cleanup stack. |
|
41 Error Condition : Leaves with the error code. |
|
42 @leave KErrNoMemory |
|
43 @since 7.0 |
|
44 @param aDataLogger The output logging object. |
|
45 @param aObserver The observer of this UnitTest. |
|
46 @return CLoadManager_CreateAndDestroy_UnitTest* The constructed object. |
|
47 @pre None. |
|
48 @post CLoadManager_CreateAndDestroy_UnitTest is fully constructed, and initialised. |
|
49 */ |
|
50 static CLoadManager_CreateAndDestroy_UnitTest* NewL(CDataLogger& aDataLogger, |
|
51 MUnitTestObserver& aObserver); |
|
52 |
|
53 /** |
|
54 @fn RunError(TInt aError) |
|
55 Intended Usage : Intercept the panic caused by a RunL leave, |
|
56 to restore the CLoadManager_CreateAndDestroy_UnitTest |
|
57 object to a sensible state. |
|
58 (called by the Active Scheduler immediately before the Panic). |
|
59 Error Condition : @see CUnitTest::RunError(). |
|
60 @since 7.0 |
|
61 @return TInt KErrNone if cleanup successful, otherwise |
|
62 @see CUnitTest::RunError() |
|
63 @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed, and initialised. |
|
64 @post The object has been restored to a sensible state. |
|
65 */ |
|
66 inline TInt RunError(TInt aError); |
|
67 |
|
68 /** |
|
69 @fn ~CLoadManager_CreateAndDestroy_UnitTest() |
|
70 Intended Usage : Standard Destructor. |
|
71 Error Condition : None. |
|
72 @since 7.0 |
|
73 @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed. |
|
74 @post CLoadManager_CreateAndDestroy_UnitTest is fully destroyed. |
|
75 */ |
|
76 ~CLoadManager_CreateAndDestroy_UnitTest(); |
|
77 |
|
78 /** |
|
79 @fn PrepareUnitTestL() |
|
80 Intended Usage : Called by test framework just before test is run to allow |
|
81 any test preparation to take place. |
|
82 Error Condition : |
|
83 @since 7.0 |
|
84 @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed. |
|
85 @post This unit test is ready to run. |
|
86 */ |
|
87 void PrepareUnitTestL(); |
|
88 |
|
89 private: |
|
90 /** |
|
91 @fn CLoadManager_CreateAndDestroy_UnitTest(CDataLogger& aDataLogger, |
|
92 MUnitTestObserver& aObserver) |
|
93 Intended Usage : Default constructor. |
|
94 Error Condition : None. |
|
95 @since 7.0 |
|
96 @param aDataLogger The output logging object. |
|
97 @param aObserver The observer of this UnitTest. |
|
98 @param aStateAccessor WhiteBox state access to the CLoadManager class. |
|
99 @pre None. |
|
100 @post CLoadManager_CreateAndDestroy_UnitTest is fully constructed. |
|
101 */ |
|
102 inline CLoadManager_CreateAndDestroy_UnitTest(CDataLogger& aDataLogger, |
|
103 MUnitTestObserver& aObserver); |
|
104 |
|
105 /** |
|
106 @fn void ConstructL() |
|
107 Intended Usage : Second phase of safe two phase construction, |
|
108 to complete the object initialisation. |
|
109 Error Condition : Leaves with an error code. |
|
110 @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). |
|
111 @since 7.0 |
|
112 @return None |
|
113 @pre CLoadManager_CreateAndDestroy_UnitTest is fully constructed. |
|
114 @post CLoadManager_CreateAndDestroy_UnitTest is fully initialised. |
|
115 */ |
|
116 inline void ConstructL(); |
|
117 |
|
118 /** |
|
119 The context of the Unit Test. |
|
120 i.e The CLoadManager class tested by this UnitTest's transitions. |
|
121 */ |
|
122 CLoadManager_UnitTestContext* iUTContext; |
|
123 TLoadManager_StateAccessor* iStateAccessor; |
|
124 /* Example c'tor and d'tor transition validators */ |
|
125 TLoadManager_Ctor_TransitionValidator* iCtorValidator; |
|
126 TLoadManager_Dtor_TransitionValidator* iDtorValidator; |
|
127 }; // CLoadManager_CreateAndDestroy_UnitTest |
|
128 |
|
129 // ______________________________________________________________________________ |
|
130 // |
|
131 /** |
|
132 @internalComponent |
|
133 Comments : Unit Test for FindInstantiationAndDestroy on CLoadManager, the class under test. |
|
134 */ |
|
135 class CLoadManager_FindInstantiationAndDestroy_UnitTest : public CUnitTest |
|
136 { |
|
137 public: |
|
138 /** |
|
139 @fn NewL(CDataLogger& aDataLogger, |
|
140 MUnitTestObserver& aObserver) |
|
141 Intended Usage : Standard two-phase construction which leaves nothing on the |
|
142 cleanup stack. |
|
143 Error Condition : Leaves with the error code. |
|
144 @leave KErrNoMemory |
|
145 @since 7.0 |
|
146 @param aDataLogger The output logging object. |
|
147 @param aObserver The observer of this UnitTest. |
|
148 @return CLoadManager_FindInstantiationAndDestroy_UnitTest* The constructed object. |
|
149 @pre None. |
|
150 @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed, and initialised. |
|
151 */ |
|
152 static CLoadManager_FindInstantiationAndDestroy_UnitTest* NewL(CDataLogger& aDataLogger, |
|
153 MUnitTestObserver& aObserver); |
|
154 |
|
155 /** |
|
156 @fn RunError(TInt aError) |
|
157 Intended Usage : Intercept the panic caused by a RunL leave, |
|
158 to restore the CLoadManager_FindInstantiationAndDestroy_UnitTest |
|
159 object to a sensible state. |
|
160 (called by the Active Scheduler immediately before the Panic). |
|
161 Error Condition : @see CUnitTest::RunError(). |
|
162 @since 7.0 |
|
163 @return TInt KErrNone if cleanup successful, otherwise |
|
164 @see CUnitTest::RunError() |
|
165 @pre CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed, and initialised. |
|
166 @post The object has been restored to a sensible state. |
|
167 */ |
|
168 inline TInt RunError(TInt aError); |
|
169 |
|
170 /** |
|
171 @fn ~CLoadManager_FindInstantiationAndDestroy_UnitTest() |
|
172 Intended Usage : Standard Destructor. |
|
173 Error Condition : None. |
|
174 @since 7.0 |
|
175 @pre CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. |
|
176 @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully destroyed. |
|
177 */ |
|
178 ~CLoadManager_FindInstantiationAndDestroy_UnitTest(); |
|
179 |
|
180 void PrepareUnitTestL(); |
|
181 |
|
182 private: |
|
183 /** |
|
184 @fn CLoadManager_FindInstantiationAndDestroy_UnitTest(CDataLogger& aDataLogger, |
|
185 MUnitTestObserver& aObserver) |
|
186 Intended Usage : Default constructor. |
|
187 Error Condition : None. |
|
188 @since 7.0 |
|
189 @param aDataLogger The output logging object. |
|
190 @param aObserver The observer of this UnitTest. |
|
191 @param aStateAccessor WhiteBox state access to the CLoadManager class. |
|
192 @pre None. |
|
193 @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. |
|
194 */ |
|
195 inline CLoadManager_FindInstantiationAndDestroy_UnitTest(CDataLogger& aDataLogger, |
|
196 MUnitTestObserver& aObserver); |
|
197 |
|
198 /** |
|
199 @fn void ConstructL() |
|
200 Intended Usage : Second phase of safe two phase construction, |
|
201 to complete the object initialisation. |
|
202 Error Condition : Leaves with an error code. |
|
203 @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). |
|
204 @since 7.0 |
|
205 @return None |
|
206 @pre CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. |
|
207 @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully initialised. |
|
208 */ |
|
209 void ConstructL(); |
|
210 |
|
211 /** |
|
212 The context of the Unit Test. |
|
213 i.e The CLoadManager class tested by this UnitTest's transitions. |
|
214 */ |
|
215 CLoadManager_UnitTestContext* iUTContext; |
|
216 TLoadManager_StateAccessor* iStateAccessor; |
|
217 /* C'tor, d'tor, and method transition validators */ |
|
218 TLoadManager_Ctor_TransitionValidator* iCtorValidator; |
|
219 TLoadManager_InstantiationMethod_TransitionValidator* iInstantiationMethodValidator; |
|
220 TLoadManager_DestroyThis_TransitionValidator* iDestroyThisValidator; |
|
221 TLoadManager_Dtor_TransitionValidator* iDtorValidator; |
|
222 }; // CLoadManager_FindInstantiationAndDestroy_UnitTest |
|
223 |
|
224 // ______________________________________________________________________________ |
|
225 // |
|
226 /** |
|
227 @internalComponent |
|
228 Comments : Unit Test for Find Instantiation failure UnitTest on CLoadManager, the class under test. |
|
229 */ |
|
230 class CLoadManager_FindInstantiationFailure_UnitTest : public CUnitTest |
|
231 { |
|
232 public: |
|
233 /** |
|
234 @fn NewL(CDataLogger& aDataLogger, |
|
235 MUnitTestObserver& aObserver) |
|
236 Intended Usage : Standard two-phase construction which leaves nothing on the |
|
237 cleanup stack. |
|
238 Error Condition : Leaves with the error code. |
|
239 @leave KErrNoMemory |
|
240 @since 7.0 |
|
241 @param aDataLogger The output logging object. |
|
242 @param aObserver The observer of this UnitTest. |
|
243 @return CLoadManager_FindInstantiationAndDestroy_UnitTest* The constructed object. |
|
244 @pre None. |
|
245 @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed, and initialised. |
|
246 */ |
|
247 static CLoadManager_FindInstantiationFailure_UnitTest* NewL(CDataLogger& aDataLogger, |
|
248 MUnitTestObserver& aObserver); |
|
249 |
|
250 /** |
|
251 @fn RunError(TInt aError) |
|
252 Intended Usage : Intercept the panic caused by a RunL leave, |
|
253 to restore the CLoadManager_FindInstantiationAndDestroy_UnitTest |
|
254 object to a sensible state. |
|
255 (called by the Active Scheduler immediately before the Panic). |
|
256 Error Condition : @see CUnitTest::RunError(). |
|
257 @since 7.0 |
|
258 @return TInt KErrNone if cleanup successful, otherwise |
|
259 @see CUnitTest::RunError() |
|
260 @pre CLoadManager_FindInstantiationFailure_UnitTest is fully constructed, and initialised. |
|
261 @post The object has been restored to a sensible state. |
|
262 */ |
|
263 inline TInt RunError(TInt aError); |
|
264 |
|
265 /** |
|
266 @fn ~CLoadManager_FindInstantiationFailure_UnitTest() |
|
267 Intended Usage : Standard Destructor. |
|
268 Error Condition : None. |
|
269 @since 7.0 |
|
270 @pre CLoadManager_FindInstantiationFailure_UnitTest is fully constructed. |
|
271 @post CLoadManager_FindInstantiationFailure_UnitTest is fully destroyed. |
|
272 */ |
|
273 ~CLoadManager_FindInstantiationFailure_UnitTest(); |
|
274 |
|
275 private: |
|
276 /** |
|
277 @fn CLoadManager_FindInstantiationFailure_UnitTest(CDataLogger& aDataLogger, |
|
278 MUnitTestObserver& aObserver) |
|
279 Intended Usage : Default constructor. |
|
280 Error Condition : None. |
|
281 @since 7.0 |
|
282 @param aDataLogger The output logging object. |
|
283 @param aObserver The observer of this UnitTest. |
|
284 @param aStateAccessor WhiteBox state access to the CLoadManager class. |
|
285 @pre None. |
|
286 @post CLoadManager_FindInstantiationAndDestroy_UnitTest is fully constructed. |
|
287 */ |
|
288 inline CLoadManager_FindInstantiationFailure_UnitTest(CDataLogger& aDataLogger, |
|
289 MUnitTestObserver& aObserver); |
|
290 |
|
291 /** |
|
292 @fn void ConstructL() |
|
293 Intended Usage : Second phase of safe two phase construction, |
|
294 to complete the object initialisation. |
|
295 Error Condition : Leaves with an error code. |
|
296 @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). |
|
297 @since 7.0 |
|
298 @return None |
|
299 @pre CLoadManager_FindInstantiationFailure_UnitTest is fully constructed. |
|
300 @post CLoadManager_FindInstantiationFailure_UnitTest is fully initialised. |
|
301 */ |
|
302 void ConstructL(); |
|
303 |
|
304 /** |
|
305 The context of the Unit Test. |
|
306 i.e The CLoadManager class tested by this UnitTest's transitions. |
|
307 */ |
|
308 CLoadManager_UnitTestContext* iUTContext; |
|
309 TLoadManager_StateAccessor* iStateAccessor; |
|
310 /* C'tor, d'tor, and method transition validators */ |
|
311 TLoadManager_Ctor_TransitionValidator* iCtorValidator; |
|
312 TLoadManager_InstantiationFailure_TransitionValidator* iInstantiationMethodValidator; |
|
313 TLoadManager_Dtor_TransitionValidator* iDtorValidator; |
|
314 }; // CLoadManager_FindInstantiationFailure_UnitTest |
|
315 |
|
316 // ______________________________________________________________________________ |
|
317 // |
|
318 /** |
|
319 @internalComponent |
|
320 Comments : |
|
321 */ |
|
322 class CLoadManager_DefectFOT56ULPM_UnitTest : public CUnitTest |
|
323 { |
|
324 public: |
|
325 /** |
|
326 @fn NewL(CDataLogger& aDataLogger, |
|
327 MUnitTestObserver& aObserver) |
|
328 Intended Usage : Standard two-phase construction which leaves nothing on the |
|
329 cleanup stack. |
|
330 Error Condition : Leaves with the error code. |
|
331 @leave KErrNoMemory |
|
332 @since 7.0 |
|
333 @param aDataLogger The output logging object. |
|
334 @param aObserver The observer of this UnitTest. |
|
335 @return CLoadManager_DefectFOT56ULPM_UnitTest* The constructed object. |
|
336 @pre None. |
|
337 @post CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed, and initialised. |
|
338 */ |
|
339 static CLoadManager_DefectFOT56ULPM_UnitTest* NewL(CDataLogger& aDataLogger, |
|
340 MUnitTestObserver& aObserver); |
|
341 |
|
342 /** |
|
343 @fn RunError(TInt aError) |
|
344 Intended Usage : Intercept the panic caused by a RunL leave, |
|
345 to restore the CLoadManager_FindInstantiationAndDestroy_UnitTest |
|
346 object to a sensible state. |
|
347 (called by the Active Scheduler immediately before the Panic). |
|
348 Error Condition : @see CUnitTest::RunError(). |
|
349 @since 7.0 |
|
350 @return TInt KErrNone if cleanup successful, otherwise |
|
351 @see CUnitTest::RunError() |
|
352 @pre CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed, and initialised. |
|
353 @post The object has been restored to a sensible state. |
|
354 */ |
|
355 inline TInt RunError(TInt aError); |
|
356 |
|
357 /** |
|
358 @fn ~CLoadManager_DefectFOT56ULPM_UnitTest() |
|
359 Intended Usage : Standard Destructor. |
|
360 Error Condition : None. |
|
361 @since 7.0 |
|
362 @pre CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed. |
|
363 @post CLoadManager_DefectFOT56ULPM_UnitTest is fully destroyed. |
|
364 */ |
|
365 ~CLoadManager_DefectFOT56ULPM_UnitTest(); |
|
366 |
|
367 private: |
|
368 /** |
|
369 @fn CLoadManager_DefectFOT56ULPM_UnitTest(CDataLogger& aDataLogger, |
|
370 MUnitTestObserver& aObserver) |
|
371 Intended Usage : Default constructor. |
|
372 Error Condition : None. |
|
373 @since 7.0 |
|
374 @param aDataLogger The output logging object. |
|
375 @param aObserver The observer of this UnitTest. |
|
376 @param aStateAccessor WhiteBox state access to the CLoadManager class. |
|
377 @pre None. |
|
378 @post CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed. |
|
379 */ |
|
380 inline CLoadManager_DefectFOT56ULPM_UnitTest(CDataLogger& aDataLogger, |
|
381 MUnitTestObserver& aObserver); |
|
382 |
|
383 /** |
|
384 @fn void ConstructL() |
|
385 Intended Usage : Second phase of safe two phase construction, |
|
386 to complete the object initialisation. |
|
387 Error Condition : Leaves with an error code. |
|
388 @leave KErrNoMemory, and @see CUnitTest::BaseNewL(). |
|
389 @since 7.0 |
|
390 @return None |
|
391 @pre CLoadManager_DefectFOT56ULPM_UnitTest is fully constructed. |
|
392 @post CLoadManager_DefectFOT56ULPM_UnitTest is fully initialised. |
|
393 */ |
|
394 void ConstructL(); |
|
395 |
|
396 /** |
|
397 The context of the Unit Test. |
|
398 i.e The CLoadManager class tested by this UnitTest's transitions. |
|
399 */ |
|
400 CLoadManager_UnitTestContext* iUTContext; |
|
401 TLoadManager_StateAccessor* iStateAccessor; |
|
402 /* C'tor, d'tor, and method transition validators */ |
|
403 TLoadManager_Ctor_TransitionValidator* iCtorValidator; |
|
404 TLoadManager_InstantiationMethod_TransitionValidator* iInstantiationMethodValidator; |
|
405 TLoadManager_DestroyThis_TransitionValidator* iDestroyThisValidator; |
|
406 TLoadManager_Dtor_TransitionValidator* iDtorValidator; |
|
407 }; // CLoadManager_DefectFOT56ULPM_UnitTest |
|
408 |
|
409 #include "LoadManagerUnitTest.inl" |
|
410 |
|
411 #endif // __LOADMANAGERUNITTEST_H__ |