|
1 /* |
|
2 * Copyright (c) 2006 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: XIMP Framework Test Code |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_PRESENCEGROUPMEMBERMANAGEMENT_H |
|
19 #define T_PRESENCEGROUPMEMBERMANAGEMENT_H |
|
20 |
|
21 |
|
22 |
|
23 // EXTERNAL INCLUDES |
|
24 #include <platform/digia/eunit/ceunittestsuiteclass.h> |
|
25 #include <platform/digia/eunit/EUnitDecorators.h> |
|
26 |
|
27 #include <ximpbase.h> |
|
28 #include <presenceinfo.h> |
|
29 #include "prfwteststatuseventlistener.h" |
|
30 #include "prfwtestmessaging.h" |
|
31 |
|
32 class CXIMPTestContextWrapper; |
|
33 class CXIMPTestContextWrapperMgr; |
|
34 class CXIMPTestMessenger; |
|
35 class CPresentityGroupListEventImp; |
|
36 class CPresentityGroupContentEventImp; |
|
37 |
|
38 class T_PresenceGroupMemberManagement; |
|
39 |
|
40 class CXIMPTestListener; |
|
41 |
|
42 // function pointer to a method |
|
43 typedef void (T_PresenceGroupMemberManagement::* TXIMPCallBack )(); |
|
44 |
|
45 /** |
|
46 * XIMP Framework Eunit tests. |
|
47 * |
|
48 * Tests for XIMP group member management services. |
|
49 * |
|
50 * @since S60 v4.0 |
|
51 */ |
|
52 class T_PresenceGroupMemberManagement : public CEUnitTestSuiteClass |
|
53 { |
|
54 |
|
55 public: |
|
56 static T_PresenceGroupMemberManagement* NewL(); |
|
57 virtual ~T_PresenceGroupMemberManagement(); |
|
58 |
|
59 |
|
60 private: |
|
61 T_PresenceGroupMemberManagement(); |
|
62 void ConstructL(); |
|
63 |
|
64 private: // Test case functions |
|
65 |
|
66 void Setup_L(); |
|
67 void SetupMultiple_L(); |
|
68 void BindAllL(); |
|
69 void Teardown(); |
|
70 |
|
71 // destroy test case support things, which cannot |
|
72 // be known in Setup method. |
|
73 void TeardownTestSupport(); |
|
74 |
|
75 void UnbindAllL(); |
|
76 |
|
77 void T_SubUnsubGroupContent_Single_L(); |
|
78 void T_SubUnsubGroupContent_Multi_L(); |
|
79 void T_SubUnsubGroupContent_One_Multi_L(); |
|
80 void T_SubUnsubGroupContent_All_Multi_L(); |
|
81 void T_SubUnsubGroupContent_Altered_Single_L(); |
|
82 void T_SubUnsubGroupContent_AlteredSame_Single_L(); |
|
83 void T_UnsubscribeNonSubscribed_L(); |
|
84 void T_AddGroupMembers_Single_L(); |
|
85 void T_RemoveGroupMembers_Single_L(); |
|
86 void T_RemoveGroupMembers_NonSub_Single_L(); |
|
87 void T_RemoveGroupMembers_NonExist_Single_L(); |
|
88 void T_UpdateGroupMembers_Single_L(); |
|
89 void T_UpdateGroupMembers_NonSub_Single_L(); |
|
90 void T_UpdateGroupMembers_NonExist_Single_L(); |
|
91 void T_ExpireNonSubscribedData_L(); |
|
92 void T_ExpireNonSubscribedDataUpdateMultiple_L(); |
|
93 |
|
94 // variable test method support |
|
95 void T_GenericSubAndUnsubL( TXIMPCallBack& aCbFuncL ); |
|
96 |
|
97 void T_EmptyFunc(); |
|
98 void T_TestAddMembersL(); |
|
99 void T_TestAddMembers_NonSub_L(); |
|
100 void T_TestRemoveMembersL(); |
|
101 void T_TestRemoveMembers_NonSub_L(); |
|
102 void T_TestRemoveMembers_NonExisting_L(); |
|
103 void T_TestUpdateMembers_L(); |
|
104 void T_TestUpdateMembers_NonSub_L(); |
|
105 void T_TestUpdateMembers_NonExisting_L(); |
|
106 |
|
107 private: // Test helpers |
|
108 |
|
109 void SetupListenerReqCompleteL( CXIMPTestContextWrapper* aWrapper, TXIMPTestStatusEventTemplate aEventType ); |
|
110 void SetupListenerReqCompleteAllowEventsL( CXIMPTestContextWrapper* aWrapper, TXIMPTestStatusEventTemplate aEventTypes ); |
|
111 |
|
112 // sometimes EUnit might eat e.g. an Access violation. |
|
113 // Call this method in the test case to break when it happens, |
|
114 // hopefully you will find the cause. |
|
115 void UseMyOwnExceptionHandler(); |
|
116 |
|
117 private: // Test data |
|
118 |
|
119 /** |
|
120 * Eunit test case table declaration. |
|
121 */ |
|
122 EUNIT_DECLARE_TEST_TABLE; |
|
123 |
|
124 // owned |
|
125 CXIMPTestContextWrapperMgr* iWrapperMgr; |
|
126 |
|
127 CActiveSchedulerWait* iASWait; |
|
128 |
|
129 // current group id |
|
130 // owned. |
|
131 MXIMPIdentity* iCurrentGrId; |
|
132 |
|
133 /** |
|
134 * Last received group content event. |
|
135 * Owned. |
|
136 */ |
|
137 CPresentityGroupContentEventImp* iLastEvent; |
|
138 |
|
139 CXIMPTestListener* iListener2; |
|
140 |
|
141 // ETrue, if you want to skip group content subscription in generic |
|
142 // sub and unsub |
|
143 TBool iSkipSubscribe; |
|
144 |
|
145 // EFalse, if you want to skip group content unsubscription |
|
146 TBool iSkipUnsubscribe; |
|
147 }; |
|
148 |
|
149 |
|
150 #endif // T_PRESENCEGROUPMEMBERMANAGEMENT_H |
|
151 |
|
152 |
|
153 |
|
154 // end of file |
|
155 |
|
156 |
|
157 |
|
158 |