|
1 /* |
|
2 * Copyright (c) 2002-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: NewSoapClasses test module. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 #ifndef NEWSOAPCLASSES_H |
|
29 #define NEWSOAPCLASSES_H |
|
30 |
|
31 // INCLUDES |
|
32 #include "StifTestModule.h" |
|
33 #include <StifLogger.h> |
|
34 |
|
35 #include <SenParser.h> |
|
36 #include <SenSoapEnvelope2.h> |
|
37 #include <SenSoapFault2.h> |
|
38 #include <SenSoapMessage2.h> |
|
39 #include <SenSoapConstants.h> |
|
40 //#include <SenSoapMessageDom2.h> |
|
41 #include <SenWsSecurityHeader2.h> |
|
42 #include <SenIdentityProvider.h> |
|
43 //#include <SenMessageContext.h> |
|
44 #include <SenXmlProperties.h> |
|
45 #include <e32debug.h> |
|
46 #include <e32std.h> |
|
47 #include <e32def.h> |
|
48 #include <SenXmlConstants.h> |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 // FORWARD DECLARATIONS |
|
55 class CSenSoapFault2; |
|
56 class CSenSoapEnvelope2; |
|
57 class CSenSoapMessage2; |
|
58 class CSenWsSecurityHeader2; |
|
59 |
|
60 |
|
61 |
|
62 // Logging path |
|
63 _LIT( KNewSoapClassesLogPath, "\\logs\\testframework\\NewSoapClassesBCTest\\" ); |
|
64 // Log file |
|
65 _LIT( KNewSoapClassesLogFile, "NewSoapClassesBCTest.txt" ); |
|
66 |
|
67 // Function pointer related internal definitions |
|
68 // Visual studio 6.0 (__VC32__) needs different type of handling |
|
69 #ifdef __VC32__ |
|
70 #define GETPTR |
|
71 #else |
|
72 #define GETPTR & |
|
73 #endif |
|
74 #define ENTRY(str,func) {_S(str), GETPTR func,0,0,0} |
|
75 #define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0} |
|
76 #define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c} |
|
77 #define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c} |
|
78 |
|
79 // FUNCTION PROTOTYPES |
|
80 //?type ?function_name(?arg_list); |
|
81 |
|
82 // FORWARD DECLARATIONS |
|
83 //class ?FORWARD_CLASSNAME; |
|
84 class CNewSoapClassesBCTest; |
|
85 |
|
86 // DATA TYPES |
|
87 //enum ?declaration |
|
88 //typedef ?declaration |
|
89 //extern ?data_type; |
|
90 // A typedef for function that does the actual testing, |
|
91 // function is a type |
|
92 // TInt CNewSoapClassesBCTest::<NameOfFunction> ( TTestResult& aResult ) |
|
93 typedef TInt (CNewSoapClassesBCTest::* TestFunction)(TTestResult&); |
|
94 |
|
95 // CLASS DECLARATION |
|
96 |
|
97 /** |
|
98 * An internal structure containing a test case name and |
|
99 * the pointer to function doing the test |
|
100 * |
|
101 * @lib ?library |
|
102 * @since ?Series60_version |
|
103 */ |
|
104 class TCaseInfoInternal |
|
105 { |
|
106 public: |
|
107 const TText* iCaseName; |
|
108 TestFunction iMethod; |
|
109 TBool iIsOOMTest; |
|
110 TInt iFirstMemoryAllocation; |
|
111 TInt iLastMemoryAllocation; |
|
112 }; |
|
113 |
|
114 // CLASS DECLARATION |
|
115 |
|
116 /** |
|
117 * A structure containing a test case name and |
|
118 * the pointer to function doing the test |
|
119 * |
|
120 * @lib ?library |
|
121 * @since ?Series60_version |
|
122 */ |
|
123 class TCaseInfo |
|
124 { |
|
125 public: |
|
126 TPtrC iCaseName; |
|
127 TestFunction iMethod; |
|
128 TBool iIsOOMTest; |
|
129 TInt iFirstMemoryAllocation; |
|
130 TInt iLastMemoryAllocation; |
|
131 |
|
132 TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) |
|
133 { |
|
134 }; |
|
135 |
|
136 }; |
|
137 |
|
138 |
|
139 // CLASS DECLARATION |
|
140 |
|
141 /** |
|
142 * This a NewSoapClasses class. |
|
143 * ?other_description_lines |
|
144 * |
|
145 * @lib ?library |
|
146 * @since ?Series60_version |
|
147 */ |
|
148 NONSHARABLE_CLASS(CNewSoapClassesBCTest) : public CTestModuleBase |
|
149 { |
|
150 public: // Constructors and destructor |
|
151 |
|
152 |
|
153 /** |
|
154 * Two-phased constructor. |
|
155 */ |
|
156 static CNewSoapClassesBCTest* NewL(); |
|
157 |
|
158 /** |
|
159 * Destructor. |
|
160 */ |
|
161 virtual ~CNewSoapClassesBCTest(); |
|
162 |
|
163 public: // New functions |
|
164 |
|
165 /** |
|
166 * ?member_description. |
|
167 * @since ?Series60_version |
|
168 * @param ?arg1 ?description |
|
169 * @return ?description |
|
170 */ |
|
171 //?type ?member_function( ?type ?arg1 ); |
|
172 |
|
173 public: // Functions from base classes |
|
174 |
|
175 /** |
|
176 * From CTestModuleBase InitL is used to initialize the |
|
177 * NewSoapClasses. It is called once for every instance of |
|
178 * TestModuleNewSoapClasses after its creation. |
|
179 * @since ?Series60_version |
|
180 * @param aIniFile Initialization file for the test module (optional) |
|
181 * @param aFirstTime Flag is true when InitL is executed for first |
|
182 * created instance of NewSoapClasses. |
|
183 * @return Symbian OS error code |
|
184 */ |
|
185 TInt InitL( TFileName& aIniFile, TBool aFirstTime ); |
|
186 |
|
187 /** |
|
188 * From CTestModuleBase GetTestCasesL is used to inquiry test cases |
|
189 * from NewSoapClasses. |
|
190 * @since ?Series60_version |
|
191 * @param aTestCaseFile Test case file (optional) |
|
192 * @param aTestCases Array of TestCases returned to test framework |
|
193 * @return Symbian OS error code |
|
194 */ |
|
195 TInt GetTestCasesL( const TFileName& aTestCaseFile, |
|
196 RPointerArray<TTestCaseInfo>& aTestCases ); |
|
197 |
|
198 /** |
|
199 * From CTestModuleBase RunTestCaseL is used to run an individual |
|
200 * test case. |
|
201 * @since ?Series60_version |
|
202 * @param aCaseNumber Test case number |
|
203 * @param aTestCaseFile Test case file (optional) |
|
204 * @param aResult Test case result returned to test framework (PASS/FAIL) |
|
205 * @return Symbian OS error code (test case execution error, which is |
|
206 * not reported in aResult parameter as test case failure). |
|
207 */ |
|
208 TInt RunTestCaseL( const TInt aCaseNumber, |
|
209 const TFileName& aTestCaseFile, |
|
210 TTestResult& aResult ); |
|
211 |
|
212 /** |
|
213 * From CTestModuleBase; OOMTestQueryL is used to specify is particular |
|
214 * test case going to be executed using OOM conditions |
|
215 * @param aTestCaseFile Test case file (optional) |
|
216 * @param aCaseNumber Test case number (optional) |
|
217 * @param aFailureType OOM failure type (optional) |
|
218 * @param aFirstMemFailure The first heap memory allocation failure value (optional) |
|
219 * @param aLastMemFailure The last heap memory allocation failure value (optional) |
|
220 * @return TBool |
|
221 */ |
|
222 virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, |
|
223 const TInt /* aCaseNumber */, |
|
224 TOOMFailureType& aFailureType, |
|
225 TInt& /* aFirstMemFailure */, |
|
226 TInt& /* aLastMemFailure */ ); |
|
227 |
|
228 /** |
|
229 * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM |
|
230 * test environment |
|
231 * @param aTestCaseFile Test case file (optional) |
|
232 * @param aCaseNumber Test case number (optional) |
|
233 * @return None |
|
234 */ |
|
235 virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, |
|
236 const TInt /* aCaseNumber */ ); |
|
237 |
|
238 /** |
|
239 * From CTestModuleBase; OOMHandleWarningL |
|
240 * @param aTestCaseFile Test case file (optional) |
|
241 * @param aCaseNumber Test case number (optional) |
|
242 * @param aFailNextValue FailNextValue for OOM test execution (optional) |
|
243 * @return None |
|
244 * |
|
245 * User may add implementation for OOM test warning handling. Usually no |
|
246 * implementation is required. |
|
247 */ |
|
248 virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, |
|
249 const TInt /* aCaseNumber */, |
|
250 TInt& /* aFailNextValue */); |
|
251 |
|
252 /** |
|
253 * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM |
|
254 * test environment |
|
255 * @param aTestCaseFile Test case file (optional) |
|
256 * @param aCaseNumber Test case number (optional) |
|
257 * @return None |
|
258 * |
|
259 */ |
|
260 virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, |
|
261 const TInt /* aCaseNumber */ ); |
|
262 |
|
263 private: |
|
264 |
|
265 /** |
|
266 * C++ default constructor. |
|
267 */ |
|
268 CNewSoapClassesBCTest(); |
|
269 |
|
270 /** |
|
271 * By default Symbian 2nd phase constructor is private. |
|
272 */ |
|
273 void ConstructL(); |
|
274 |
|
275 // Prohibit copy constructor if not deriving from CBase. |
|
276 // ?classname( const ?classname& ); |
|
277 // Prohibit assigment operator if not deriving from CBase. |
|
278 // ?classname& operator=( const ?classname& ); |
|
279 |
|
280 /** |
|
281 * Function returning test case name and pointer to test case function. |
|
282 * @since ?Series60_version |
|
283 * @param aCaseNumber test case number |
|
284 * @return TCaseInfo |
|
285 */ |
|
286 const TCaseInfo Case ( const TInt aCaseNumber ) const; |
|
287 |
|
288 void SetupL(); |
|
289 void Teardown(); |
|
290 |
|
291 |
|
292 /** |
|
293 * Actual Hardcoded test case functions are listed below. |
|
294 */ |
|
295 TInt MT_CSenSoapEnvelope2_NewLL(TTestResult& aResult); |
|
296 |
|
297 TInt MT_CSenSoapEnvelope2_NewLCL(TTestResult& aResult); |
|
298 |
|
299 TInt MT_CSenSoapEnvelope2_NewL_1L(TTestResult& aResult); |
|
300 |
|
301 TInt MT_CSenSoapEnvelope2_NewLC_1L(TTestResult& aResult); |
|
302 |
|
303 TInt MT_CSenSoapEnvelope2_NewL_2L(TTestResult& aResult); |
|
304 |
|
305 TInt MT_CSenSoapEnvelope2_NewLC_2L(TTestResult& aResult); |
|
306 |
|
307 TInt MT_CSenSoapEnvelope2_TypeL(TTestResult& aResult); |
|
308 |
|
309 TInt MT_CSenSoapEnvelope2_DirectionL(TTestResult& aResult); |
|
310 |
|
311 TInt MT_CSenSoapEnvelope2_TxnIdL(TTestResult& aResult); |
|
312 |
|
313 TInt MT_CSenSoapEnvelope2_CloneL(TTestResult& aResult); |
|
314 |
|
315 TInt MT_CSenSoapEnvelope2_SoapVersionL(TTestResult& aResult); |
|
316 |
|
317 TInt MT_CSenSoapEnvelope2_SetContextL(TTestResult& aResult); |
|
318 |
|
319 TInt MT_CSenSoapEnvelope2_ContextL(TTestResult& aResult); |
|
320 |
|
321 TInt MT_CSenSoapEnvelope2_SetPropertiesL(TTestResult& aResult); |
|
322 |
|
323 TInt MT_CSenSoapEnvelope2_PropertiesL(TTestResult& aResult); |
|
324 |
|
325 TInt MT_CSenSoapEnvelope2_IsSafeToCastL(TTestResult& aResult); |
|
326 |
|
327 |
|
328 TInt MT_CSenSoapEnvelope2_SetBodyLL(TTestResult& aResult); |
|
329 |
|
330 |
|
331 TInt MT_CSenSoapEnvelope2_SetBodyL_1L(TTestResult& aResult); |
|
332 |
|
333 |
|
334 TInt MT_CSenSoapEnvelope2_BodyLL(TTestResult& aResult); |
|
335 |
|
336 |
|
337 TInt MT_CSenSoapEnvelope2_HeaderLL(TTestResult& aResult); |
|
338 |
|
339 |
|
340 TInt MT_CSenSoapEnvelope2_AddHeaderLL(TTestResult& aResult); |
|
341 |
|
342 |
|
343 TInt MT_CSenSoapEnvelope2_BodyAsStringLL(TTestResult& aResult); |
|
344 |
|
345 |
|
346 TInt MT_CSenSoapEnvelope2_IsFaultL(TTestResult& aResult); |
|
347 |
|
348 |
|
349 TInt MT_CSenSoapEnvelope2_DetachFaultLL(TTestResult& aResult); |
|
350 |
|
351 |
|
352 TInt MT_CSenSoapEnvelope2_FaultLL(TTestResult& aResult); |
|
353 |
|
354 |
|
355 TInt MT_CSenSoapEnvelope2_SetSoapActionLL(TTestResult& aResult); |
|
356 |
|
357 |
|
358 TInt MT_CSenSoapEnvelope2_SoapActionL(TTestResult& aResult); |
|
359 |
|
360 |
|
361 TInt MT_CSenSoapEnvelope2_HasHeaderL(TTestResult& aResult); |
|
362 |
|
363 |
|
364 TInt MT_CSenSoapEnvelope2_HasBodyL(TTestResult& aResult); |
|
365 |
|
366 |
|
367 TInt MT_CSenSoapEnvelope2_Parse1L(TTestResult& aResult); |
|
368 |
|
369 |
|
370 TInt MT_CSenSoapEnvelope2_Parse2L(TTestResult& aResult); |
|
371 |
|
372 |
|
373 TInt MT_CSenSoapEnvelope2_Parse3L(TTestResult& aResult); |
|
374 |
|
375 |
|
376 TInt MT_CSenSoapFault2_NewLL(TTestResult& aResult); |
|
377 |
|
378 |
|
379 TInt MT_CSenSoapFault2_NewL_1L(TTestResult& aResult); |
|
380 |
|
381 |
|
382 TInt MT_CSenSoapFault2_NewL_2L(TTestResult& aResult); |
|
383 |
|
384 |
|
385 TInt MT_CSenSoapFault2_FaultCodeL(TTestResult& aResult); |
|
386 |
|
387 |
|
388 TInt MT_CSenSoapFault2_FaultSubcodeL(TTestResult& aResult); |
|
389 |
|
390 |
|
391 TInt MT_CSenSoapFault2_FaultStringL(TTestResult& aResult); |
|
392 |
|
393 |
|
394 TInt MT_CSenSoapFault2_FaultActorL(TTestResult& aResult); |
|
395 |
|
396 |
|
397 TInt MT_CSenSoapFault2_DetailL(TTestResult& aResult); |
|
398 |
|
399 |
|
400 TInt MT_CSenSoapMessage2_NewLL(TTestResult& aResult); |
|
401 |
|
402 TInt MT_CSenSoapMessage2_NewLCL(TTestResult& aResult); |
|
403 |
|
404 |
|
405 TInt MT_CSenSoapMessage2_NewL_1L(TTestResult& aResult); |
|
406 |
|
407 TInt MT_CSenSoapMessage2_NewLC_1L(TTestResult& aResult); |
|
408 |
|
409 |
|
410 TInt MT_CSenSoapMessage2_NewL_2L(TTestResult& aResult); |
|
411 |
|
412 TInt MT_CSenSoapMessage2_NewLC_2L(TTestResult& aResult); |
|
413 |
|
414 TInt MT_CSenSoapMessage2_NewL_3L(TTestResult& aResult); |
|
415 |
|
416 TInt MT_CSenSoapMessage2_NewLC_3L(TTestResult& aResult); |
|
417 |
|
418 TInt MT_CSenSoapMessage2_NewL_4L(TTestResult& aResult); |
|
419 |
|
420 TInt MT_CSenSoapMessage2_NewLC_4L(TTestResult& aResult); |
|
421 |
|
422 TInt MT_CSenSoapMessage2_NewL_5L(TTestResult& aResult); |
|
423 |
|
424 TInt MT_CSenSoapMessage2_NewLC_5L(TTestResult& aResult); |
|
425 |
|
426 TInt MT_CSenSoapMessage2_NewL_6L(TTestResult& aResult); |
|
427 |
|
428 TInt MT_CSenSoapMessage2_NewLC_6L(TTestResult& aResult); |
|
429 |
|
430 TInt MT_CSenSoapMessage2_TypeL(TTestResult& aResult); |
|
431 |
|
432 TInt MT_CSenSoapMessage2_CloneL(TTestResult& aResult); |
|
433 |
|
434 TInt MT_CSenSoapMessage2_Parse1L(TTestResult& aResult); |
|
435 |
|
436 |
|
437 |
|
438 TInt MT_CSenSoapMessage2_SetSecurityHeaderLL(TTestResult& aResult); |
|
439 |
|
440 |
|
441 TInt MT_CSenSoapMessage2_AddSecurityTokenLL(TTestResult& aResult); |
|
442 |
|
443 |
|
444 TInt MT_CSenWsSecurityHeader2_NewLL(TTestResult& aResult); |
|
445 |
|
446 |
|
447 TInt MT_CSenWsSecurityHeader2_NewLCL(TTestResult& aResult); |
|
448 |
|
449 |
|
450 TInt MT_CSenWsSecurityHeader2_NewL_1L(TTestResult& aResult); |
|
451 |
|
452 |
|
453 TInt MT_CSenWsSecurityHeader2_NewLC_1L(TTestResult& aResult); |
|
454 |
|
455 |
|
456 TInt MT_CSenWsSecurityHeader2_NewL_2L(TTestResult& aResult); |
|
457 |
|
458 |
|
459 TInt MT_CSenWsSecurityHeader2_NewLC_2L(TTestResult& aResult); |
|
460 |
|
461 |
|
462 TInt MT_CSenWsSecurityHeader2_UsernameTokenLL(TTestResult& aResult); |
|
463 |
|
464 |
|
465 TInt MT_CSenWsSecurityHeader2_UsernameTokenL_1L(TTestResult& aResult); |
|
466 |
|
467 |
|
468 TInt MT_CSenWsSecurityHeader2_UsernameTokenL_2L(TTestResult& aResult); |
|
469 |
|
470 |
|
471 TInt MT_CSenWsSecurityHeader2_UsernameTokenL_3L(TTestResult& aResult); |
|
472 |
|
473 |
|
474 TInt MT_CSenWsSecurityHeader2_UsernameTokenL_4L(TTestResult& aResult); |
|
475 |
|
476 |
|
477 TInt MT_CSenWsSecurityHeader2_TimestampLL(TTestResult& aResult); |
|
478 |
|
479 |
|
480 TInt MT_CSenWsSecurityHeader2_TimestampL_1L(TTestResult& aResult); |
|
481 |
|
482 |
|
483 TInt MT_CSenWsSecurityHeader2_XmlNsL(TTestResult& aResult); |
|
484 |
|
485 |
|
486 TInt MT_CSenWsSecurityHeader2_XmlNsPrefixL(TTestResult& aResult); |
|
487 |
|
488 TInt MT_CTestMSenMessage_Type(TTestResult& aResult); |
|
489 TInt MT_CTestMSenMessage_Direction(TTestResult& aResult); |
|
490 TInt MT_CTestMSenMessage_Context(TTestResult& aResult); |
|
491 TInt MT_CTestMSenMessage_SetContext(TTestResult& aResult); |
|
492 TInt MT_CTestMSenMessage_Properties(TTestResult& aResult); |
|
493 TInt MT_CTestMSenMessage_SetProperties(TTestResult& aResult); |
|
494 TInt MT_CTestMSenMessage_IsSafeToCast(TTestResult& aResult); |
|
495 TInt MT_CTestMSenMessage_TxnId(TTestResult& aResult); |
|
496 TInt MT_CTestMSenMessage_CloneL(TTestResult& aResult); |
|
497 public: // Data |
|
498 // ?one_line_short_description_of_data |
|
499 //?data_declaration; |
|
500 |
|
501 protected: // Data |
|
502 // ?one_line_short_description_of_data |
|
503 //?data_declaration; |
|
504 |
|
505 private: // Data |
|
506 // Pointer to test (function) to be executed |
|
507 TestFunction iMethod; |
|
508 |
|
509 // Pointer to logger |
|
510 CStifLogger * iLog; |
|
511 |
|
512 CSenXmlReader* iXmlReader; |
|
513 // ?one_line_short_description_of_data |
|
514 //?data_declaration; |
|
515 |
|
516 // Reserved pointer for future extension |
|
517 //TAny* iReserved; |
|
518 |
|
519 public: // Friend classes |
|
520 //?friend_class_declaration; |
|
521 protected: // Friend classes |
|
522 //?friend_class_declaration; |
|
523 private: // Friend classes |
|
524 //?friend_class_declaration; |
|
525 |
|
526 }; |
|
527 |
|
528 #endif // NewSoapClasses_H |
|
529 |
|
530 // End of File |