56 /** |
55 /** |
57 * Destructor. |
56 * Destructor. |
58 */ |
57 */ |
59 virtual ~CPsClientTestSuite(); |
58 virtual ~CPsClientTestSuite(); |
60 |
59 |
61 |
60 public: // Functions from base classes |
62 |
|
63 public: // Functions from base classes |
|
64 |
61 |
65 /** |
62 /** |
66 * From CScriptBase Runs a script line. |
63 * From CScriptBase Runs a script line. |
67 * |
64 * |
68 * @param aItem Script line containing method name and parameters |
65 * @param aItem Script line containing method name and parameters |
69 * @return Symbian OS error code |
66 * @return Symbian OS error code |
70 */ |
67 */ |
71 virtual TInt RunMethodL( CStifItemParser& aItem ); |
68 virtual TInt RunMethodL( CStifItemParser& aItem ); |
72 |
69 |
73 public: // Function from base class MPsResultsObserver |
70 public: // Function from base class MPsResultsObserver |
74 /** |
71 |
75 * HandlePsResultsUpdateL. |
72 /** |
76 * Handle updates from the Ps server. |
73 * HandlePsResultsUpdateL. |
77 * |
74 * Handle updates from the Ps server. |
78 * @param searchResults Search results returned from the server. |
75 * |
79 * @param searchSeqs List of matching character sequences. |
76 * @param searchResults Search results returned from the server. |
80 */ |
77 * @param searchSeqs List of matching character sequences. |
81 void HandlePsResultsUpdate(RPointerArray<CPsClientData>& searchResults, |
78 */ |
82 RPointerArray<CPsPattern>& searchSeqs); |
79 void HandlePsResultsUpdate(RPointerArray<CPsClientData>& searchResults, |
83 |
80 RPointerArray<CPsPattern>& searchSeqs); |
84 /** |
81 |
85 * HandlePsError. |
82 /** |
86 * Handle errors from the server. |
83 * HandlePsError. |
87 * |
84 * Handle errors from the server. |
88 * @param aErrorCode Search errors returned from the server. |
85 * |
89 */ |
86 * @param aErrorCode Search errors returned from the server. |
90 void HandlePsError(TInt aErrorCode); |
87 */ |
91 |
88 void HandlePsError(TInt aErrorCode); |
|
89 |
92 /** |
90 /** |
93 * CachingStatus |
91 * CachingStatus |
94 * Gets called when caching is completed. |
92 * Gets called when caching is completed. |
95 * Observers need to implement this function accordingly |
93 * Observers need to implement this function accordingly |
96 * to take action after cache completion |
94 * to take action after cache completion |
97 * |
95 * |
98 * @param aStatus - caching status, |
96 * @param aStatus - caching status, |
99 * 20 - Caching completes succesfully, |
97 * 20 - Caching completes succesfully, |
100 * 30 - Caching completed with errors |
98 * 30 - Caching completed with errors |
101 * @param aError - Any error that occurred while caching. KErrNone if no error else the error code |
99 * @param aError - Any error that occurred while caching. KErrNone if no error else the error code |
102 */ |
100 */ |
103 void CachingStatus(TCachingStatus& aStatus, TInt& aError); |
101 void CachingStatus(TCachingStatus& aStatus, TInt& aError); |
104 |
102 |
105 |
103 private: |
106 |
|
107 private: |
|
108 |
104 |
109 /** |
105 /** |
110 * C++ default constructor. |
106 * C++ default constructor. |
111 */ |
107 */ |
112 CPsClientTestSuite( CTestModuleIf& aTestModuleIf ); |
108 CPsClientTestSuite( CTestModuleIf& aTestModuleIf ); |
116 */ |
112 */ |
117 void ConstructL(); |
113 void ConstructL(); |
118 |
114 |
119 /** |
115 /** |
120 * Frees all resources allocated from test methods. |
116 * Frees all resources allocated from test methods. |
121 * |
|
122 */ |
117 */ |
123 void Delete(); |
118 void Delete(); |
124 |
119 |
125 |
120 private: //Test cases |
126 |
121 |
127 private: //Test cases |
|
128 |
|
129 /** |
122 /** |
130 * This method writes the test case title to the log file |
123 * This method writes the test case title to the log file |
131 */ |
124 */ |
132 TInt WriteTitleToLog( ); |
125 TInt WriteTitleToLog( ); |
133 |
126 |
134 /** |
127 /** |
135 * This test case creates contacts in the phonebook |
128 * This test case creates contacts in the phonebook |
136 * |
129 * |
137 * @param aItem Script line containing parameters. |
130 * @param aItem Script line containing parameters. |
138 */ |
131 */ |
139 TInt CreateContactsL( CStifItemParser& aItem ); |
132 TInt CreateContactsL( CStifItemParser& aItem ); |
140 |
133 |
141 /** |
134 /** |
142 * This test case creates groups in the phonebook. It creats only |
135 * This test case creates groups in the phonebook. It creats only |
143 * empty groups, i.e the groups do not have any members. |
136 * empty groups, i.e the groups do not have any members. |
144 * |
137 * |
145 * @param aItem Script line containing parameters. |
138 * @param aItem Script line containing parameters. |
146 */ |
139 */ |
147 TInt CreateGroupsInPhoneL( CStifItemParser& aItem ); |
140 TInt CreateGroupsInPhoneL( CStifItemParser& aItem ); |
148 |
141 |
149 /** |
142 /** |
150 * This test case fires a search query to the psengine |
143 * This test case fires a search query to the psengine |
151 * |
144 * |
152 * @param aItem Script line containing parameters. |
145 * @param aItem Script line containing parameters. |
153 * @return - error status - KErrNone if test case is successful |
146 * @return - error status - KErrNone if test case is successful |
154 */ |
147 */ |
155 TInt SearchCacheL( CStifItemParser& aItem ); |
148 TInt SearchCacheL( CStifItemParser& aItem ); |
156 |
149 |
157 /** |
150 /** |
158 * This test case cancels a search query to the psengine |
151 * This test case cancels a search query to the psengine |
159 * |
152 * |
160 * |
153 * @param aItem Script line containing parameters. |
161 * @param aItem Script line containing parameters. |
154 * @return - error status - KErrNone if test case is successful |
162 * @return - error status - KErrNone if test case is successful |
155 */ |
163 */ |
|
164 TInt CancelSearchL( CStifItemParser& aItem ); |
156 TInt CancelSearchL( CStifItemParser& aItem ); |
165 |
157 |
166 /** |
158 /** |
167 * This test case searches for a query in the given input string |
159 * This test case searches for a query in the given input string |
168 * |
160 * |
169 * @param aItem Script line containing parameters. |
161 * @param aItem Script line containing parameters. |
170 * @return - error status - KErrNone if test case is successful |
162 * @return - error status - KErrNone if test case is successful |
171 */ |
163 */ |
172 TInt SearchOnInputStringL(CStifItemParser& aItem); |
164 TInt SearchOnInputStringL(CStifItemParser& aItem); |
173 |
165 |
174 /** |
166 /** |
175 * This test case searches for a query with LookupMatch |
167 * This test case searches for a query with LookupMatch |
176 * and ensures the result string is correct |
168 * and ensures the result string is correct |
177 * |
169 * |
178 * @param aItem Script line containing parameters. |
170 * @param aItem Script line containing parameters. |
179 * @return - error status - KErrNone if test case is successful |
171 * @return - error status - KErrNone if test case is successful |
180 */ |
172 */ |
181 TInt SearchLookupMatchStringL(CStifItemParser& aItem); |
173 TInt SearchLookupMatchStringL(CStifItemParser& aItem); |
182 |
174 |
183 /** |
175 /** |
184 * This method deletes all the contacts in the phonebook |
176 * This test case requests the Adaptive Grid |
185 * |
177 * and ensures the result string is correct |
186 * @param aItem Script line containing parameters. |
178 * |
187 * @return - error status - KErrNone if test case is successful |
179 * @param aItem Script line containing parameters. |
188 */ |
180 * @return - error status - KErrNone if test case is successful |
189 TInt DeleteAllContactsInPhonebookL(CStifItemParser& aItem); |
181 */ |
190 |
182 TInt CheckAdaptiveStringL(CStifItemParser& aItem); |
191 /** |
183 |
192 * This method checks the caching status |
184 /** |
193 * |
185 * This method deletes all the contacts in the phonebook |
194 * @return - error status - KErrNone if test case is successful |
186 * |
195 */ |
187 * @param aItem Script line containing parameters. |
196 TInt CheckCachingStatusL(); |
188 * @return - error status - KErrNone if test case is successful |
197 |
189 */ |
198 |
190 TInt DeleteAllContactsInPhonebookL(CStifItemParser& aItem); |
199 /** |
191 |
200 * This method checks the version of the ps server |
192 /** |
201 * |
193 * This method checks the caching status |
202 * @return - error status - KErrNone if test case is successful |
194 * |
203 */ |
195 * @return - error status - KErrNone if test case is successful |
204 TInt CheckVersion(); |
196 */ |
205 |
197 TInt CheckCachingStatusL(); |
206 /** |
198 |
207 * This method checks if a particular language is supported by the ps server |
199 /** |
208 * |
200 * This method checks the version of the ps server |
209 * @return - error status - KErrNone if test case is successful |
201 * |
210 */ |
202 * @return - error status - KErrNone if test case is successful |
211 TInt TestIsLanguageSupportedL(CStifItemParser& aItem); |
203 */ |
212 |
204 TInt CheckVersion(); |
213 /** |
205 |
214 * This method waits for time equal to the input parameter |
206 /** |
215 * @param aInterval The wait interval |
207 * This method checks if a particular language is supported by the ps server |
216 */ |
208 * |
217 void RTimerWait(TTimeIntervalMicroSeconds32 aInterval); |
209 * @return - error status - KErrNone if test case is successful |
218 |
210 */ |
219 /** |
211 TInt TestIsLanguageSupportedL(CStifItemParser& aItem); |
220 * This method checks gets all the contents from a particular URI (as specified in the configuration) |
212 |
221 * |
213 /** |
222 * @return - error status - KErrNone if test case is successful |
214 * This method waits for time equal to the input parameter |
223 */ |
215 * |
224 TInt GetAllContentsL( CStifItemParser& aItem ); |
216 * @param aInterval The wait interval |
225 |
217 */ |
226 /** |
218 void RTimerWait(TTimeIntervalMicroSeconds32 aInterval); |
227 * This method searches in a particular group. The group name is given as a |
219 |
228 * configuration parameter. |
220 /** |
229 * |
221 * This method checks gets all the contents from a particular URI (as specified in the configuration) |
230 * @return - error status - KErrNone if test case is successful |
222 * |
231 */ |
223 * @return - error status - KErrNone if test case is successful |
232 TInt SearchWithInGroupL(CStifItemParser& aItem ); |
224 */ |
233 |
225 TInt GetAllContentsL( CStifItemParser& aItem ); |
234 |
226 |
235 /** |
227 /** |
236 * This method tests the sort order |
228 * This method searches in a particular group. The group name is given as a |
237 * |
229 * configuration parameter. |
238 * @return - error status - KErrNone if test case is successful |
230 * |
239 */ |
231 * @return - error status - KErrNone if test case is successful |
240 TInt TestSortOrderL( CStifItemParser& aItem ); |
232 */ |
241 |
233 TInt SearchWithInGroupL(CStifItemParser& aItem ); |
242 /** |
234 |
243 * This method tests the sort order for error case |
235 /** |
244 * |
236 * This method tests the sort order |
245 * @return - error status - KErrNone if test case is successful |
237 * |
246 */ |
238 * @return - error status - KErrNone if test case is successful |
247 TInt TestSortOrderErrCaseL( CStifItemParser& aItem ); |
239 */ |
248 /** |
240 TInt TestSortOrderL( CStifItemParser& aItem ); |
249 * This method removes the observer from ps searchengine |
241 |
250 * |
242 /** |
251 * @return - error status - KErrNone if test case is successful |
243 * This method tests the sort order for error case |
252 */ |
244 * |
253 TInt RemoveObserverL(CStifItemParser& aItem); |
245 * @return - error status - KErrNone if test case is successful |
254 |
246 */ |
255 /** |
247 TInt TestSortOrderErrCaseL( CStifItemParser& aItem ); |
256 * Tests if contact Id returns correct vpbklink |
248 |
|
249 /** |
|
250 * This method removes the observer from ps searchengine |
|
251 * |
|
252 * @return - error status - KErrNone if test case is successful |
|
253 */ |
|
254 TInt RemoveObserverL(CStifItemParser& aItem); |
|
255 |
|
256 /** |
|
257 * Tests if contact Id returns correct vpbklink |
257 * |
258 * |
258 * @return - - error status - KErrNone if test case is successful |
259 * @return - - error status - KErrNone if test case is successful |
259 */ |
260 */ |
260 TInt ConvertToVpbkLinkL(CStifItemParser& aItem); |
261 TInt ConvertToVpbkLinkL(CStifItemParser& aItem); |
261 |
262 |
262 /** |
263 /** |
263 * Tests for bookmarked contacts |
264 * Tests for bookmarked contacts |
264 * |
265 * |
265 * @return error status - KErrNone if test case is successful |
266 * @return error status - KErrNone if test case is successful |
266 */ |
267 */ |
267 TInt AddMarkedContactsTestL(CStifItemParser& aItem); |
268 TInt AddMarkedContactsTestL(CStifItemParser& aItem); |
268 |
269 |
269 /** |
270 /** |
270 * Tests for data order |
271 * Tests for data order |
271 * |
272 * |
272 * @return error status - KErrNone if test case is successful |
273 * @return error status - KErrNone if test case is successful |
273 */ |
274 */ |
274 TInt TestDataOrderL(CStifItemParser& aItem); |
275 TInt TestDataOrderL(CStifItemParser& aItem); |
275 |
276 |
276 /** |
277 /** |
277 * Tests for data order |
278 * Tests for data order |
278 * |
279 * |
279 * @return error status - KErrNone if test case is successful |
280 * @return error status - KErrNone if test case is successful |
280 */ |
281 */ |
281 TInt TestDataOrderForErrL(CStifItemParser& aItem); |
282 TInt TestDataOrderForErrL(CStifItemParser& aItem); |
282 |
283 |
283 |
284 /** |
284 /** |
285 * This method shuts the server down |
285 * This method shuts the server down |
286 * |
286 * |
287 * @return - error status - KErrNone if test case is successful |
287 * @return - error status - KErrNone if test case is successful |
288 */ |
288 */ |
289 TInt ShutDownL(); |
289 TInt ShutDownL(); |
290 |
290 |
291 private: // Data |
291 private: // Data |
292 |
292 |
293 /** |
293 /** |
294 * The input data parser |
294 * The input data parser |
295 * own |
295 * own |
296 */ |
296 */ |
297 CTestSuiteInputData* iInputParsedData; |
297 CTestSuiteInputData* iInputParsedData; |
298 |
298 |
299 /** |
299 /** |
300 * The search query |
300 * The search query |
301 */ |
301 */ |
302 CPsQuery *iPsQuery; |
302 CPsQuery *iPsQuery; |
303 |
303 |
304 /** |
304 /** |
305 * The CPSRequestHandler instance |
305 * The CPSRequestHandler instance |
306 */ |
306 */ |
307 CPSRequestHandler* iPsClientHandler; |
307 CPSRequestHandler* iPsClientHandler; |
308 |
308 |
309 /** |
309 /** |
310 * The search settings |
310 * The search settings |
311 */ |
311 */ |
312 CPsSettings* iSettings ; |
312 CPsSettings* iSettings ; |
313 |
313 |
314 /** |
314 /** |
315 * The error return status |
315 * The error return status |
316 */ |
316 */ |
317 TInt iReturnStatus; |
317 TInt iReturnStatus; |
318 |
318 |
319 /** |
319 /** |
320 * The group Id of the group name entered in the configuration file |
320 * The group Id of the group name entered in the configuration file |
321 */ |
321 */ |
322 TInt iGroupToBeSearchedId; |
322 TInt iGroupToBeSearchedId; |
323 |
323 |
324 /** |
324 /** |
325 * The current operation being performed |
325 * The current operation being performed |
326 */ |
326 */ |
327 TTestCase iCurrentOperation; |
327 TTestCase iCurrentOperation; |
328 |
328 |
329 /** |
329 /** |
330 * RTimer variable to set the timer before RunL calls any function. |
330 * RTimer variable to set the timer before RunL calls any function. |
331 * This is required to allow other threads to run since contact fetch |
331 * This is required to allow other threads to run since contact fetch |
332 * is CPU intensive task. |
332 * is CPU intensive task. |
333 */ |
333 */ |
334 RTimer iTimer; |
334 RTimer iTimer; |
335 |
335 |
336 /** |
336 /** |
337 * The caching status of the psengine |
337 * The caching status of the psengine |
338 */ |
338 */ |
339 TCachingStatus iCachingStatus; |
339 TCachingStatus iCachingStatus; |
340 |
340 |
341 /** |
341 /** |
342 * The marked contacts |
342 * The marked contacts |
343 */ |
343 */ |
344 RPointerArray<CPsClientData> iMarkedContacts; |
344 RPointerArray<CPsClientData> iMarkedContacts; |
|
345 |
|
346 }; |
345 }; |
347 |
346 |
348 #endif // PS_CLIENT_TEST_SUITE_H |
347 #endif // PS_CLIENT_TEST_SUITE_H |
349 |
348 |
350 // End of File |
349 // End of File |