|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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 the License "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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // This file defines the API for tcontactsgetidsprovidertest.dll |
|
20 |
|
21 #ifndef TCONTACTSGETIDSPROVIDERTEST_H |
|
22 #define TCONTACTSGETIDSPROVIDERTEST_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <StifLogger.h> |
|
26 #include <TestScripterInternal.h> |
|
27 #include <StifTestModule.h> |
|
28 #include <f32file.h> |
|
29 #include <TestclassAssert.h> |
|
30 |
|
31 #include <LiwCommon.h> |
|
32 #include <LiwBufferExtension.h> |
|
33 #include <LiwServiceHandler.h> |
|
34 |
|
35 #include <e32base.h> // CBase |
|
36 #include <e32std.h> // TBuf |
|
37 |
|
38 // Constants |
|
39 // Logging path |
|
40 _LIT( KLogPath, "\\logs\\testframework\\" ); |
|
41 // Log file |
|
42 _LIT( KLogFile, "tcontactsgetidsprovidertest.txt" ); |
|
43 _LIT( KLogFileWithTitle, "tcontactsgetidsprovidertest_[%S].txt" ); |
|
44 |
|
45 // MACROS |
|
46 //#define ?macro ?macro_def |
|
47 #define TEST_CLASS_VERSION_MAJOR 0 |
|
48 #define TEST_CLASS_VERSION_MINOR 0 |
|
49 #define TEST_CLASS_VERSION_BUILD 0 |
|
50 |
|
51 // Class Definitions |
|
52 |
|
53 class Ctcontactsgetidsprovidertest : public CScriptBase, public MLiwNotifyCallback |
|
54 { |
|
55 public:// Constructors and destructor |
|
56 enum TFileType |
|
57 { |
|
58 EContacts, |
|
59 EGroups, |
|
60 ENone |
|
61 }; |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 */ |
|
65 static Ctcontactsgetidsprovidertest* NewL( CTestModuleIf& aTestModuleIf ); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~Ctcontactsgetidsprovidertest(); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 Ctcontactsgetidsprovidertest(CTestModuleIf& aTestModuleIf); |
|
78 /** |
|
79 * By default Symbian 2nd phase constructor is private. |
|
80 */ |
|
81 void ConstructL(); |
|
82 /** |
|
83 * Frees all resources allocated from test methods. |
|
84 */ |
|
85 void Delete(); |
|
86 /** |
|
87 * loades the contacts service. |
|
88 * @return MLiwInterface pointer. |
|
89 */ |
|
90 void LoadServiceL(); |
|
91 /** |
|
92 * Test methods are listed below. |
|
93 */ |
|
94 /** |
|
95 * Example test method. |
|
96 * @since ?Series60_version |
|
97 * @param aItem Script line containing parameters. |
|
98 * @return Symbian OS error code. |
|
99 */ |
|
100 TInt GetIdsL(CStifItemParser& aItem); |
|
101 /** |
|
102 * This method parses the input from cfg file and prepare the input list. |
|
103 * @param aItem input list contaning input params from cfg file. |
|
104 * @return Symbian OS error code. |
|
105 */ |
|
106 void ParseStiffInput(CStifItemParser& aItem); |
|
107 /** |
|
108 * This method parses the input from cfg file and prepare the Expected out put list. |
|
109 * @param aItem input list contaning input params from cfg file. |
|
110 * @return Symbian OS error code. |
|
111 */ |
|
112 void SetExpectedOutputMap(CStifItemParser& aItem); |
|
113 /** |
|
114 * Method used to log version of test class |
|
115 */ |
|
116 void SendTestClassVersion(); |
|
117 public: // Functions from base classes |
|
118 |
|
119 /** |
|
120 * From CScriptBase Runs a script line. |
|
121 * @param aItem Script line containing method name and parameters. |
|
122 * @return Symbian OS error code. |
|
123 */ |
|
124 virtual TInt RunMethodL(CStifItemParser& aItem); |
|
125 |
|
126 /** |
|
127 * From the MLiwNotifyCallback interface it is called by the contacts service. |
|
128 * @param aCmdId Script line containing method name and parameters. |
|
129 * @return Symbian OS error code. |
|
130 */ |
|
131 TInt HandleNotifyL(TInt aCmdId, |
|
132 TInt aEventId, |
|
133 CLiwGenericParamList& aEventParamList, |
|
134 const CLiwGenericParamList& aInParamList); |
|
135 |
|
136 private: // Data |
|
137 //An array to hold the expected result maps. |
|
138 RPointerArray <CLiwMap> iExpectedOutPutArray; |
|
139 //the expected output error code |
|
140 TInt iExpErrorCode; |
|
141 //result of the test case. |
|
142 TInt iResult; |
|
143 //input parameter list |
|
144 CLiwGenericParamList* iInList; |
|
145 //output parameter list |
|
146 CLiwGenericParamList* iOutList; |
|
147 //service handler pointer |
|
148 CLiwServiceHandler* iServicehandler; |
|
149 //interface handle |
|
150 MLiwInterface* iIface; |
|
151 //file type |
|
152 TFileType itype; |
|
153 }; |
|
154 |
|
155 #endif // __TCONTACTSGETIDSPROVIDERTEST_H__ |
|
156 |