|
1 /* |
|
2 * Copyright (c) 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: STIF testclass declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CVIMPSTSTORAGECONTACTLIST_UT_H |
|
19 #define CVIMPSTSTORAGECONTACTLIST_UT_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <StifLogger.h> |
|
23 #include <TestScripterInternal.h> |
|
24 #include <StifTestModule.h> |
|
25 #include <TestclassAssert.h> |
|
26 #include "vimpstutils.h" |
|
27 #include "cvimpststoragecontact.h" |
|
28 #include "cvimpststoragecontactsorter.h" |
|
29 #include "cvimpststoragecontactlist.h" |
|
30 #include "tvimpstenums.h" |
|
31 |
|
32 // MACROS |
|
33 //#define ?macro ?macro_def |
|
34 #define TEST_CLASS_VERSION_MAJOR 0 |
|
35 #define TEST_CLASS_VERSION_MINOR 0 |
|
36 #define TEST_CLASS_VERSION_BUILD 0 |
|
37 |
|
38 // Logging path |
|
39 _LIT( KCVIMPSTStorageContactList_UTLogPath, "\\logs\\testframework\\CVIMPSTStorageContactList_UT\\" ); |
|
40 // Log file |
|
41 _LIT( KCVIMPSTStorageContactList_UTLogFile, "CVIMPSTStorageContactList_UT.txt" ); |
|
42 _LIT( KCVIMPSTStorageContactList_UTLogFileWithTitle, "CVIMPSTStorageContactList_UT_[%S].txt" ); |
|
43 |
|
44 // FUNCTION PROTOTYPES |
|
45 //?type ?function_name(?arg_list); |
|
46 |
|
47 // FORWARD DECLARATIONS |
|
48 //class ?FORWARD_CLASSNAME; |
|
49 class CCVIMPSTStorageContactList_UT; |
|
50 |
|
51 // DATA TYPES |
|
52 //enum ?declaration |
|
53 //typedef ?declaration |
|
54 //extern ?data_type; |
|
55 |
|
56 // CLASS DECLARATION |
|
57 |
|
58 /** |
|
59 * CCVIMPSTStorageContactList_UT test class for STIF Test Framework TestScripter. |
|
60 * ?other_description_lines |
|
61 * |
|
62 * @lib ?library |
|
63 * @since ?Series60_version |
|
64 */ |
|
65 NONSHARABLE_CLASS(CCVIMPSTStorageContactList_UT) : public CScriptBase |
|
66 { |
|
67 public: // Constructors and destructor |
|
68 |
|
69 /** |
|
70 * Two-phased constructor. |
|
71 */ |
|
72 static CCVIMPSTStorageContactList_UT* NewL( CTestModuleIf& aTestModuleIf ); |
|
73 |
|
74 /** |
|
75 * Destructor. |
|
76 */ |
|
77 virtual ~CCVIMPSTStorageContactList_UT(); |
|
78 |
|
79 public: // New functions |
|
80 |
|
81 /* |
|
82 * This is a test function. |
|
83 * This tests the NewL function of the CVIMPSTStorageContactList |
|
84 * class. |
|
85 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
86 * @return: integer, indicates the result of the test. If KErrNone |
|
87 * is returned then it indicates that test case is passed. Any other |
|
88 * return value indicates failure of the test. |
|
89 */ |
|
90 TInt Test_NewL( CStifItemParser& aItem ); |
|
91 |
|
92 /* |
|
93 * This is a test function. |
|
94 * This tests the ListId function of the CVIMPSTStorageContactList |
|
95 * class. |
|
96 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
97 * @return: integer, indicates the result of the test. If KErrNone |
|
98 * is returned then it indicates that test case is passed. Any other |
|
99 * return value indicates failure of the test. |
|
100 */ |
|
101 TInt Test_ListId( CStifItemParser& aItem ); |
|
102 |
|
103 /* |
|
104 * This is a test function. |
|
105 * This tests the ListId function of the CVIMPSTStorageContactList |
|
106 * class. |
|
107 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
108 * @return: integer, indicates the result of the test. If KErrNone |
|
109 * is returned then it indicates that test case is passed. Any other |
|
110 * return value indicates failure of the test. |
|
111 */ |
|
112 TInt Test_DisplayName( CStifItemParser& aItem ); |
|
113 |
|
114 /* |
|
115 * This is a test function. |
|
116 * This tests the AddContactToList function of the CVIMPSTStorageContactList |
|
117 * class. |
|
118 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
119 * @return: integer, indicates the result of the test. If KErrNone |
|
120 * is returned then it indicates that test case is passed. Any other |
|
121 * return value indicates failure of the test. |
|
122 */ |
|
123 TInt Test_AddContactToList( CStifItemParser& aItem ); |
|
124 |
|
125 /* |
|
126 * This is a test function. |
|
127 * This tests the RemoveContactFromList function of the CVIMPSTStorageContactList |
|
128 * class. |
|
129 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
130 * @return: integer, indicates the result of the test. If KErrNone |
|
131 * is returned then it indicates that test case is passed. Any other |
|
132 * return value indicates failure of the test. |
|
133 */ |
|
134 TInt Test_RemoveContactFromList( CStifItemParser& aItem ); |
|
135 |
|
136 /* |
|
137 * This is a test function. |
|
138 * This tests the Count function of the CVIMPSTStorageContactList |
|
139 * class. |
|
140 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
141 * @return: integer, indicates the result of the test. If KErrNone |
|
142 * is returned then it indicates that test case is passed. Any other |
|
143 * return value indicates failure of the test. |
|
144 */ |
|
145 TInt Test_Count( CStifItemParser& aItem ); |
|
146 |
|
147 /* |
|
148 * This is a test function. |
|
149 * This tests the FilteredContact function of the CVIMPSTStorageContactList |
|
150 * class. |
|
151 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
152 * @return: integer, indicates the result of the test. If KErrNone |
|
153 * is returned then it indicates that test case is passed. Any other |
|
154 * return value indicates failure of the test. |
|
155 */ |
|
156 TInt Test_FilteredContact( CStifItemParser& aItem ); |
|
157 |
|
158 /* |
|
159 * This is a test function. |
|
160 * This tests the FilteredCount function of the CVIMPSTStorageContactList |
|
161 * class. |
|
162 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
163 * @return: integer, indicates the result of the test. If KErrNone |
|
164 * is returned then it indicates that test case is passed. Any other |
|
165 * return value indicates failure of the test. |
|
166 */ |
|
167 TInt Test_FilteredCount( CStifItemParser& aItem ); |
|
168 |
|
169 /* |
|
170 * This is a test function. |
|
171 * This tests the FilterAllowsContact function of the CVIMPSTStorageContactList |
|
172 * class. |
|
173 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
174 * @return: integer, indicates the result of the test. If KErrNone |
|
175 * is returned then it indicates that test case is passed. Any other |
|
176 * return value indicates failure of the test. |
|
177 */ |
|
178 TInt Test_FilterAllowsContact( CStifItemParser& aItem ); |
|
179 |
|
180 /* |
|
181 * This is a test function. |
|
182 * This tests the FindIndexOfContact function of the CVIMPSTStorageContactList |
|
183 * class. |
|
184 * @param: aItem,stif parser item to fetch parameters passed in the cfg file |
|
185 * @return: integer, indicates the result of the test. If KErrNone |
|
186 * is returned then it indicates that test case is passed. Any other |
|
187 * return value indicates failure of the test. |
|
188 */ |
|
189 TInt Test_FindIndexOfContact( CStifItemParser& aItem ); |
|
190 |
|
191 /* |
|
192 * This is a helper function. |
|
193 * This function returns the desired filtered based on the |
|
194 * integer passed into it. |
|
195 * @param: a integer, indicating the filter. these integers are |
|
196 * defined in the cfg file. |
|
197 * @return: filtertype. |
|
198 */ |
|
199 TVIMPSTEnums::TFilterType GetFilter( TInt aFilter ); |
|
200 |
|
201 /* |
|
202 * This is a helper function. |
|
203 * This function returns the desired presence status |
|
204 * based on the integer passed into it. |
|
205 * @param: a integer, indicating the status. these integers are |
|
206 * defined in the cfg file. |
|
207 * @return: online status. |
|
208 */ |
|
209 TVIMPSTEnums::TOnlineStatus GetStatus( TInt aStatus ); |
|
210 |
|
211 /* |
|
212 * This is a helper function. |
|
213 * This function returns the a contact list with |
|
214 * predefined contacts in it. Tester can change |
|
215 * the contacts at will in this function for test |
|
216 * purposes. |
|
217 * The function does not take any params, because |
|
218 * to create a long list, the param list will be |
|
219 * long. |
|
220 * @return: pointer to the contact list. |
|
221 */ |
|
222 MVIMPSTStorageContactList* GetList( ); |
|
223 public: // Functions from base classes |
|
224 |
|
225 /** |
|
226 * From CScriptBase Runs a script line. |
|
227 * @since ?Series60_version |
|
228 * @param aItem Script line containing method name and parameters |
|
229 * @return Symbian OS error code |
|
230 */ |
|
231 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
232 |
|
233 protected: // New functions |
|
234 |
|
235 /** |
|
236 * ?member_description. |
|
237 * @since ?Series60_version |
|
238 * @param ?arg1 ?description |
|
239 * @return ?description |
|
240 */ |
|
241 //?type ?member_function( ?type ?arg1 ); |
|
242 |
|
243 protected: // Functions from base classes |
|
244 |
|
245 /** |
|
246 * From ?base_class ?member_description |
|
247 */ |
|
248 //?type ?member_function(); |
|
249 |
|
250 private: |
|
251 |
|
252 /** |
|
253 * C++ default constructor. |
|
254 */ |
|
255 CCVIMPSTStorageContactList_UT( CTestModuleIf& aTestModuleIf ); |
|
256 |
|
257 /** |
|
258 * By default Symbian 2nd phase constructor is private. |
|
259 */ |
|
260 void ConstructL(); |
|
261 |
|
262 // Prohibit copy constructor if not deriving from CBase. |
|
263 // ?classname( const ?classname& ); |
|
264 // Prohibit assigment operator if not deriving from CBase. |
|
265 // ?classname& operator=( const ?classname& ); |
|
266 |
|
267 /** |
|
268 * Frees all resources allocated from test methods. |
|
269 * @since ?Series60_version |
|
270 */ |
|
271 void Delete(); |
|
272 |
|
273 /** |
|
274 * Test methods are listed below. |
|
275 */ |
|
276 |
|
277 /** |
|
278 * Method used to log version of test class |
|
279 */ |
|
280 void SendTestClassVersion(); |
|
281 |
|
282 //ADD NEW METHOD DEC HERE |
|
283 //[TestMethods] - Do not remove |
|
284 |
|
285 public: // Data |
|
286 // ?one_line_short_description_of_data |
|
287 //?data_declaration; |
|
288 |
|
289 protected: // Data |
|
290 // ?one_line_short_description_of_data |
|
291 //?data_declaration; |
|
292 |
|
293 private: // Data |
|
294 |
|
295 // ?one_line_short_description_of_data |
|
296 //?data_declaration; |
|
297 |
|
298 // Reserved pointer for future extension |
|
299 //TAny* iReserved; |
|
300 |
|
301 public: // Friend classes |
|
302 //?friend_class_declaration; |
|
303 protected: // Friend classes |
|
304 //?friend_class_declaration; |
|
305 private: // Friend classes |
|
306 //?friend_class_declaration; |
|
307 |
|
308 }; |
|
309 |
|
310 #endif // CVIMPSTSTORAGECONTACTLIST_UT_H |
|
311 |
|
312 // End of File |