|
1 // Copyright (c) 2002-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 // |
|
15 |
|
16 #if !(defined __QUEUETESTS_H__) |
|
17 #define __QUEUETESTS_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include "TestBases.h" |
|
21 |
|
22 // forward declaration |
|
23 class CNifAgentBase; |
|
24 |
|
25 // |
|
26 // Test Case NC-1-1 |
|
27 // |
|
28 class CNetConTest0101 : public CQueueTestBase |
|
29 { |
|
30 public: |
|
31 static CNetConTest0101* NewLC(); |
|
32 |
|
33 // implement pure virtual from MNetConTest |
|
34 const TDesC& Name() const; |
|
35 |
|
36 // override implementations from CQueueTestBase |
|
37 virtual void SelectComplete(const TDesC& aName); |
|
38 virtual void SelectComplete(TInt aError); |
|
39 |
|
40 protected: |
|
41 void StartTestL(); |
|
42 }; |
|
43 |
|
44 |
|
45 // |
|
46 // Test Case NC-1-2 |
|
47 // |
|
48 class CNetConTest0102 : public CQueueTestBase |
|
49 { |
|
50 public: |
|
51 static CNetConTest0102* NewLC(); |
|
52 |
|
53 // implement pure virtual from MNetConTest |
|
54 const TDesC& Name() const; |
|
55 |
|
56 // override implementations from CQueueTestBase |
|
57 virtual void SelectComplete(const TDesC& aName); |
|
58 virtual void SelectComplete(TInt aError); |
|
59 |
|
60 protected: |
|
61 void StartTestL(); |
|
62 }; |
|
63 |
|
64 |
|
65 // |
|
66 // Test Case NC-1-3 |
|
67 // |
|
68 class CNetConTest0103 : public CQueueTestBase |
|
69 { |
|
70 public: |
|
71 static CNetConTest0103* NewLC(); |
|
72 |
|
73 // implement pure virtual from MNetConTest |
|
74 const TDesC& Name() const; |
|
75 |
|
76 // override implementations from CQueueTestBase |
|
77 virtual void ReconnectComplete(TInt aError); |
|
78 |
|
79 protected: |
|
80 void StartTestL(); |
|
81 }; |
|
82 |
|
83 |
|
84 // |
|
85 // Test Case NC-1-4 |
|
86 // |
|
87 class CNetConTest0104 : public CQueueTestBase |
|
88 { |
|
89 public: |
|
90 static CNetConTest0104* NewLC(); |
|
91 |
|
92 // implement pure virtual from MNetConTest |
|
93 const TDesC& Name() const; |
|
94 |
|
95 // override implementations from CQueueTestBase |
|
96 virtual void ReconnectComplete(TInt aError); |
|
97 |
|
98 protected: |
|
99 void StartTestL(); |
|
100 }; |
|
101 |
|
102 |
|
103 // |
|
104 // Test Case NC-1-5 |
|
105 // |
|
106 class CNetConTest0105 : public CQueueTestBase |
|
107 { |
|
108 public: |
|
109 static CNetConTest0105* NewLC(); |
|
110 |
|
111 // implement pure virtual from MNetConTest |
|
112 const TDesC& Name() const; |
|
113 |
|
114 // override implementations from CQueueTestBase |
|
115 virtual void SelectComplete(const TDesC& aName); |
|
116 virtual void SelectComplete(TInt aError); |
|
117 |
|
118 protected: |
|
119 void StartTestL(); |
|
120 }; |
|
121 |
|
122 |
|
123 // |
|
124 // Test Case NC-1-6 |
|
125 // |
|
126 class CNetConTest0106 : public CQueueTestBase |
|
127 { |
|
128 public: |
|
129 virtual ~CNetConTest0106(); |
|
130 static CNetConTest0106* NewLC(); |
|
131 |
|
132 // implement pure virtual from MNetConTest |
|
133 const TDesC& Name() const; |
|
134 |
|
135 // override implementations from CQueueTestBase |
|
136 virtual void SelectComplete(const TDesC& aName); |
|
137 virtual void SelectComplete(TInt aError); |
|
138 |
|
139 protected: |
|
140 CNetConTest0106(); |
|
141 void ConstructL(); |
|
142 |
|
143 void StartTestL(); |
|
144 |
|
145 private: |
|
146 static TInt CancelCb(TAny* aThisPtr); |
|
147 void CancelCbComplete(); |
|
148 |
|
149 private: |
|
150 CAsyncCallBack* iCancelCb; |
|
151 }; |
|
152 |
|
153 |
|
154 // |
|
155 // Test Case NC-1-7 |
|
156 // |
|
157 class CNetConTest0107 : public CQueueTestBase |
|
158 { |
|
159 public: |
|
160 static CNetConTest0107* NewLC(); |
|
161 |
|
162 // implement pure virtual from MNetConTest |
|
163 const TDesC& Name() const; |
|
164 |
|
165 // override implementation from CQueueTestBase |
|
166 virtual void ReconnectComplete(TInt aError); |
|
167 |
|
168 protected: |
|
169 void StartTestL(); |
|
170 }; |
|
171 |
|
172 |
|
173 // |
|
174 // Test Case NC-1-8 |
|
175 // |
|
176 class CNetConTest0108 : public CQueueTestBase |
|
177 { |
|
178 public: |
|
179 virtual ~CNetConTest0108(); |
|
180 static CNetConTest0108* NewLC(); |
|
181 |
|
182 // implement pure virtual from MNetConTest |
|
183 const TDesC& Name() const; |
|
184 |
|
185 // override implementation from CQueueTestBase |
|
186 virtual void ReconnectComplete(TInt aError); |
|
187 |
|
188 protected: |
|
189 CNetConTest0108(); |
|
190 void ConstructL(); |
|
191 |
|
192 void StartTestL(); |
|
193 |
|
194 private: |
|
195 static TInt CancelCb(TAny* aThisPtr); |
|
196 void CancelCbComplete(); |
|
197 |
|
198 private: |
|
199 CAsyncCallBack* iCancelCb; |
|
200 }; |
|
201 |
|
202 |
|
203 // |
|
204 // Test Case NC-1-9 |
|
205 // |
|
206 |
|
207 class CTestControllerObserver : public CBase, public MNetworkControllerObserver |
|
208 // |
|
209 // Utility class used by NC-1-9 and NC-1-10 |
|
210 // |
|
211 { |
|
212 public: |
|
213 CTestControllerObserver(CQueueTestBase* aTestCase); |
|
214 ~CTestControllerObserver(); |
|
215 |
|
216 // from MNetworkControllerObserver |
|
217 virtual void SelectComplete(const TDesC& aName); |
|
218 virtual void SelectComplete(TInt aError); |
|
219 virtual void ReconnectComplete(TInt aError); |
|
220 |
|
221 private: |
|
222 CQueueTestBase* iTestCase; |
|
223 }; |
|
224 |
|
225 const TInt KNumRequests = 5; |
|
226 |
|
227 class CNetConTest0109 : public CQueueTestBase |
|
228 { |
|
229 public: |
|
230 virtual ~CNetConTest0109(); |
|
231 static CNetConTest0109* NewLC(); |
|
232 |
|
233 // implement pure virtual from MNetConTest |
|
234 const TDesC& Name() const; |
|
235 |
|
236 // override implementations from CQueueTestBase |
|
237 virtual void SelectComplete(const TDesC& aName); |
|
238 virtual void SelectComplete(TInt aError); |
|
239 virtual void ReconnectComplete(TInt aError); |
|
240 |
|
241 protected: |
|
242 void StartTestL(); |
|
243 |
|
244 private: |
|
245 CNetConTest0109(); |
|
246 void ConstructL(); |
|
247 |
|
248 private: |
|
249 enum TRequestType |
|
250 { |
|
251 ESelection, |
|
252 EReconnect |
|
253 }; |
|
254 |
|
255 RPointerArray<CTestControllerObserver> iObservers; |
|
256 TFixedArray<TInt, KNumRequests> iExpectedRequest; |
|
257 TInt iNumRequestsOutstanding; |
|
258 }; |
|
259 |
|
260 |
|
261 // |
|
262 // Test Case NC-1-10 |
|
263 // |
|
264 class CNetConTest0110 : public CQueueTestBase |
|
265 { |
|
266 public: |
|
267 virtual ~CNetConTest0110(); |
|
268 static CNetConTest0110* NewLC(); |
|
269 |
|
270 // implement pure virtual from MNetConTest |
|
271 const TDesC& Name() const; |
|
272 |
|
273 // override implementations from CQueueTestBase |
|
274 virtual void SelectComplete(const TDesC& aName); |
|
275 virtual void SelectComplete(TInt aError); |
|
276 virtual void ReconnectComplete(TInt aError); |
|
277 |
|
278 protected: |
|
279 void StartTestL(); |
|
280 |
|
281 private: |
|
282 CNetConTest0110(); |
|
283 void ConstructL(); |
|
284 |
|
285 private: |
|
286 enum TRequestType |
|
287 { |
|
288 ESelection, |
|
289 EReconnect |
|
290 }; |
|
291 |
|
292 RPointerArray<CTestControllerObserver> iObservers; |
|
293 TFixedArray<TInt, KNumRequests> iExpectedRequest; |
|
294 TInt iNumRequestsOutstanding; |
|
295 }; |
|
296 |
|
297 // |
|
298 // Test Case NC-1-11 |
|
299 // |
|
300 class CNetConTest0111 : public CQueueTestBase |
|
301 { |
|
302 public: |
|
303 virtual ~CNetConTest0111(); |
|
304 static CNetConTest0111* NewLC(); |
|
305 |
|
306 // implement pure virtual from MNetConTest |
|
307 const TDesC& Name() const; |
|
308 |
|
309 protected: |
|
310 void StartTestL(); |
|
311 |
|
312 private: |
|
313 CNetConTest0111(); |
|
314 void ConstructL(); |
|
315 |
|
316 private: |
|
317 CNifAgentBase* iAgent; |
|
318 }; |
|
319 |
|
320 |
|
321 // |
|
322 // Test Case NC-1-12 |
|
323 // |
|
324 class CNetConTest0112 : public CQueueTestBase |
|
325 { |
|
326 public: |
|
327 virtual ~CNetConTest0112(); |
|
328 static CNetConTest0112* NewLC(); |
|
329 |
|
330 // implement pure virtual from MNetConTest |
|
331 const TDesC& Name() const; |
|
332 |
|
333 protected: |
|
334 void StartTestL(); |
|
335 |
|
336 private: |
|
337 CNetConTest0112(); |
|
338 void ConstructL(); |
|
339 |
|
340 private: |
|
341 CNifAgentBase* iAgent; |
|
342 CNifAgentBase* iAnotherAgent; |
|
343 }; |
|
344 |
|
345 |
|
346 // |
|
347 // Test Case NC-1-13 |
|
348 // |
|
349 class CNetConTest0113 : public CQueueTestBase |
|
350 { |
|
351 public: |
|
352 virtual ~CNetConTest0113(); |
|
353 static CNetConTest0113* NewLC(); |
|
354 |
|
355 // implement pure virtual from MNetConTest |
|
356 const TDesC& Name() const; |
|
357 |
|
358 protected: |
|
359 void StartTestL(); |
|
360 |
|
361 private: |
|
362 CNetConTest0113(); |
|
363 void ConstructL(); |
|
364 |
|
365 private: |
|
366 CNifAgentBase* iAgent; |
|
367 }; |
|
368 |
|
369 |
|
370 // |
|
371 // Test Case NC-1-14 |
|
372 // |
|
373 class CNetConTest0114 : public CQueueTestBase |
|
374 { |
|
375 public: |
|
376 static CNetConTest0114* NewLC(); |
|
377 |
|
378 // implement pure virtual from MNetConTest |
|
379 const TDesC& Name() const; |
|
380 |
|
381 // override implementations from CQueueTestBase |
|
382 virtual void SelectComplete(const TDesC& aName); |
|
383 virtual void SelectComplete(TInt aError); |
|
384 |
|
385 protected: |
|
386 void StartTestL(); |
|
387 |
|
388 protected: |
|
389 TCommDbMultiConnPref iMultiPref; |
|
390 TInt iAnswerNo; |
|
391 }; |
|
392 |
|
393 |
|
394 // |
|
395 // Test Case NC-1-15 |
|
396 // |
|
397 class CNetConTest0115 : public CQueueTestBase |
|
398 { |
|
399 public: |
|
400 static CNetConTest0115* NewLC(); |
|
401 |
|
402 // implement pure virtual from MNetConTest |
|
403 const TDesC& Name() const; |
|
404 |
|
405 // override implementations from CQueueTestBase |
|
406 virtual void SelectComplete(const TDesC& aName); |
|
407 virtual void SelectComplete(TInt aError); |
|
408 |
|
409 protected: |
|
410 void StartTestL(); |
|
411 |
|
412 protected: |
|
413 TCommDbMultiConnPref iMultiPref; |
|
414 TInt iAnswerNo; |
|
415 }; |
|
416 |
|
417 |
|
418 // |
|
419 // Test Case NC-1-16 |
|
420 // |
|
421 class CNetConTest0116 : public CQueueTestBase |
|
422 { |
|
423 public: |
|
424 static CNetConTest0116* NewLC(); |
|
425 |
|
426 // implement pure virtual from MNetConTest |
|
427 const TDesC& Name() const; |
|
428 |
|
429 // override implementations from CQueueTestBase |
|
430 virtual void SelectComplete(const TDesC& aName); |
|
431 virtual void SelectComplete(TInt aError); |
|
432 |
|
433 protected: |
|
434 void StartTestL(); |
|
435 |
|
436 protected: |
|
437 TCommDbMultiConnPref iMultiPref; |
|
438 TInt iAnswerNo; |
|
439 }; |
|
440 |
|
441 |
|
442 #endif // __QUEUETESTS_H__ |
|
443 |