|
1 /** |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedAll |
|
23 @released |
|
24 */ |
|
25 #ifndef __CONCURRENT_NOTIFIER_STEP_H__ |
|
26 #define __CONCURRENT_NOTIFIER_STEP_H__ |
|
27 #include <test/testexecutestepbase.h> |
|
28 #include "PerformanceFunctionalityBase.h" |
|
29 |
|
30 class CConcurrentNotifierStep : public CPerformanceFunctionalityBase |
|
31 { |
|
32 class CConcurrentNotifierActive; |
|
33 friend class CConcurrentNotifierActive; |
|
34 public: |
|
35 CConcurrentNotifierStep(); |
|
36 ~CConcurrentNotifierStep(); |
|
37 virtual TVerdict doTestStepL(); |
|
38 TVerdict doTestStepPostambleL(); |
|
39 |
|
40 private: |
|
41 void PreTestL(); |
|
42 TInt ReceivedCountL(); |
|
43 void AddEventL(const TInt aEvent); |
|
44 void AddContactL(const TInt aCid); |
|
45 void SetMessageCountL(); |
|
46 void ClearSharedL(); |
|
47 void EndTransactionL(); |
|
48 void ProcessWaitL(); |
|
49 void UpdateTestL(); |
|
50 void CommitTestL(); |
|
51 void AddTestL(); |
|
52 void DeleteTestL(); |
|
53 void OpenTablesTestL(); |
|
54 void CloseTablesTestL(); |
|
55 void OwnCardTestL(); |
|
56 void ChangeOwnCardTestL(); |
|
57 void OwnCardDeleteTestL(); |
|
58 void SpeedDialTestL(); |
|
59 void RemoveSpeedDialTestL(); |
|
60 void DeleteSpeedDialTestL(); |
|
61 void SingleCommitTransactionTestL(); |
|
62 void MultipleChangeTransactionTestL(); |
|
63 void EmptyTransactionTestL(); |
|
64 void UnkownChangeTestL(); |
|
65 |
|
66 private: |
|
67 TInt iManyListeners;//the number of listener threads |
|
68 TInt iNextTest;//index of next consecutive test |
|
69 TInt iMessageCount;//number of expected notifications for this test case |
|
70 TInt iSpeedPosition;//position of speed dial 1 |
|
71 TInt iSpeedPosition2;//position of speed dial 2 |
|
72 TBool iWaiting;//waiting for listener threads to process expected notifications |
|
73 TBool iRevert; //signifies that transaction will be rolledback/reverted, |
|
74 //otherwised it will be commited, applies only to transaction tests |
|
75 TBool iDamage; |
|
76 RArray< void (CConcurrentNotifierStep::*)() > *iTests;//list of tests to be run consecutively |
|
77 TTime iStart;//time test case started |
|
78 TTime iEnd;//current time |
|
79 CConcurrentNotifierStep::CConcurrentNotifierActive *iMyActive; |
|
80 |
|
81 private: |
|
82 class CConcurrentNotifierActive : public virtual CActive |
|
83 { |
|
84 public: |
|
85 CConcurrentNotifierActive(CConcurrentNotifierStep *aStep); |
|
86 void Activate(); |
|
87 private: // From CActive. |
|
88 void RunL(); |
|
89 void DoCancel(); |
|
90 TInt RunError(TInt aError); |
|
91 private: |
|
92 CConcurrentNotifierStep *iStep; |
|
93 }; |
|
94 }; |
|
95 |
|
96 class CConcurrentInitializerStep : public CPerformanceFunctionalityBase |
|
97 { |
|
98 public: |
|
99 CConcurrentInitializerStep(); |
|
100 virtual TVerdict doTestStepL(); |
|
101 private: |
|
102 void PreTestL(){} |
|
103 }; |
|
104 |
|
105 _LIT(KConcurrentNotifierStep,"ConcurrentNotifierStep"); |
|
106 _LIT(KConcurrentInitilizerStep,"ConcurrentInitilizerStep"); |
|
107 |
|
108 #endif |