|
1 /* |
|
2 * Copyright (c) 2008-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 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @test |
|
22 @internalComponent |
|
23 */ |
|
24 #ifndef __TSTSTESTSUITESTEP_H__ |
|
25 #define __TSTSTESTSUITESTEP_H__ |
|
26 #include <test/testexecutestepbase.h> |
|
27 #include "tststestsuitestepcommon.h" |
|
28 #include <scs/oomteststep.h> |
|
29 |
|
30 class CStsTestServer; |
|
31 |
|
32 class CStsBaseTestStep : public COomTestStep |
|
33 { |
|
34 public: |
|
35 CStsBaseTestStep(CStsTestServer &aStsTestServer); |
|
36 |
|
37 protected: |
|
38 CStsTestServer& Server(); |
|
39 //ini access functions |
|
40 TInt GetIntFromConfigL(const TDesC& aName); |
|
41 TInt GetTransactionSlotFromConfigL(); |
|
42 TInt GetTransactionSlotToReuseTransactionIdFromConfigL(); |
|
43 TInt GetTransactionIdFromConfigL(); |
|
44 TPtrC GetStringFromConfigL(const TDesC& aName); |
|
45 TPtrC GetTargetFilePathFromConfigL(); |
|
46 |
|
47 //file handling |
|
48 void WriteToFileL(RFile &aFile, TDesC& aString); |
|
49 TBool FileExistsL(const TDesC &aFileName); |
|
50 void DeleteFileL(const TDesC &aFileName); |
|
51 void CopyFileL(const TDesC& aSourceFile, const TDesC& aDestinationFile); |
|
52 void RmDirL(const TDesC& aFileName); |
|
53 void MkDirAllL(const TDesC& aFileName); |
|
54 void DeleteL(const TDesC& aFileName); |
|
55 HBufC* CreateDataForNewFileCreatedByStsServerLC(const TDesC& aTestStepName, TNewFileType aType); |
|
56 void SetReadOnlyL(const TDesC& aFileName, TInt aSetReadOnly); |
|
57 protected: |
|
58 CStsTestServer &iStsTestServer; |
|
59 }; |
|
60 |
|
61 |
|
62 class CCreateTransactionStep : public CStsBaseTestStep |
|
63 { |
|
64 public: |
|
65 CCreateTransactionStep(CStsTestServer &aStsTestServer); |
|
66 protected: |
|
67 virtual void ImplTestStepPreambleL(); |
|
68 virtual void ImplTestStepPostambleL(); |
|
69 virtual void ImplTestStepL(); |
|
70 }; |
|
71 |
|
72 class COpenTransactionStep : public CStsBaseTestStep |
|
73 { |
|
74 public: |
|
75 COpenTransactionStep(CStsTestServer &aStsTestServer); |
|
76 protected: |
|
77 virtual void ImplTestStepPreambleL(); |
|
78 virtual void ImplTestStepPostambleL(); |
|
79 virtual void ImplTestStepL(); |
|
80 }; |
|
81 |
|
82 class CCloseTransactionStep : public CStsBaseTestStep |
|
83 { |
|
84 public: |
|
85 CCloseTransactionStep(CStsTestServer &aStsTestServer); |
|
86 protected: |
|
87 virtual void ImplTestStepPreambleL(); |
|
88 virtual void ImplTestStepPostambleL(); |
|
89 virtual void ImplTestStepL(); |
|
90 }; |
|
91 |
|
92 class CRegisterNewFileStep : public CStsBaseTestStep |
|
93 { |
|
94 public: |
|
95 CRegisterNewFileStep(CStsTestServer &aStsTestServer); |
|
96 protected: |
|
97 virtual void ImplTestStepPreambleL(); |
|
98 virtual void ImplTestStepPostambleL(); |
|
99 virtual void ImplTestStepL(); |
|
100 }; |
|
101 |
|
102 class CCreateNewFileStep : public CStsBaseTestStep |
|
103 { |
|
104 public: |
|
105 CCreateNewFileStep(CStsTestServer &aStsTestServer); |
|
106 protected: |
|
107 virtual void ImplTestStepPreambleL(); |
|
108 virtual void ImplTestStepPostambleL(); |
|
109 virtual void ImplTestStepL(); |
|
110 }; |
|
111 |
|
112 class CRemoveStep : public CStsBaseTestStep |
|
113 { |
|
114 public: |
|
115 CRemoveStep(CStsTestServer &aStsTestServer); |
|
116 protected: |
|
117 virtual void ImplTestStepPreambleL(); |
|
118 virtual void ImplTestStepPostambleL(); |
|
119 virtual void ImplTestStepL(); |
|
120 }; |
|
121 |
|
122 class CRegisterTemporaryStep : public CStsBaseTestStep |
|
123 { |
|
124 public: |
|
125 CRegisterTemporaryStep(CStsTestServer &aStsTestServer); |
|
126 protected: |
|
127 virtual void ImplTestStepPreambleL(); |
|
128 virtual void ImplTestStepPostambleL(); |
|
129 virtual void ImplTestStepL(); |
|
130 }; |
|
131 |
|
132 class CCreateTemporaryStep : public CStsBaseTestStep |
|
133 { |
|
134 public: |
|
135 CCreateTemporaryStep(CStsTestServer &aStsTestServer); |
|
136 protected: |
|
137 virtual void ImplTestStepPreambleL(); |
|
138 virtual void ImplTestStepPostambleL(); |
|
139 virtual void ImplTestStepL(); |
|
140 }; |
|
141 |
|
142 class COverwriteStep : public CStsBaseTestStep |
|
143 { |
|
144 public: |
|
145 COverwriteStep(CStsTestServer &aStsTestServer); |
|
146 protected: |
|
147 virtual void ImplTestStepPreambleL(); |
|
148 virtual void ImplTestStepPostambleL(); |
|
149 virtual void ImplTestStepL(); |
|
150 }; |
|
151 |
|
152 class CCommitStep : public CStsBaseTestStep |
|
153 { |
|
154 public: |
|
155 CCommitStep(CStsTestServer &aStsTestServer); |
|
156 protected: |
|
157 virtual void ImplTestStepPreambleL(); |
|
158 virtual void ImplTestStepPostambleL(); |
|
159 virtual void ImplTestStepL(); |
|
160 }; |
|
161 |
|
162 class CRollbackStep : public CStsBaseTestStep |
|
163 { |
|
164 public: |
|
165 CRollbackStep(CStsTestServer &aStsTestServer); |
|
166 protected: |
|
167 virtual void ImplTestStepPreambleL(); |
|
168 virtual void ImplTestStepPostambleL(); |
|
169 virtual void ImplTestStepL(); |
|
170 }; |
|
171 |
|
172 class CRollbackAllPendingStep : public CStsBaseTestStep |
|
173 { |
|
174 public: |
|
175 CRollbackAllPendingStep(CStsTestServer &aStsTestServer); |
|
176 protected: |
|
177 virtual void ImplTestStepPreambleL(); |
|
178 virtual void ImplTestStepPostambleL(); |
|
179 virtual void ImplTestStepL(); |
|
180 }; |
|
181 |
|
182 class CCheckFilesStep : public CStsBaseTestStep |
|
183 { |
|
184 public: |
|
185 CCheckFilesStep(CStsTestServer &aStsTestServer); |
|
186 protected: |
|
187 virtual void ImplTestStepPreambleL(); |
|
188 virtual void ImplTestStepPostambleL(); |
|
189 virtual void ImplTestStepL(); |
|
190 private: |
|
191 void GetFileNamesForCheckL(RArray<TPtrC>& aFileNumExist,RArray<TPtrC>& aFileNumNonExist); |
|
192 void ExtractFileNameL(TInt aEntries, const TDesC& aEntryBase, RArray<TPtrC>& aFileArray); |
|
193 void CheckIfFilesExistL(const RArray<TPtrC>& aFileArray); |
|
194 void CheckIfFilesNotExistL(const RArray<TPtrC>& aFileArray); |
|
195 }; |
|
196 |
|
197 class CheckFileModeChangeStep : public CStsBaseTestStep |
|
198 { |
|
199 public: |
|
200 CheckFileModeChangeStep(CStsTestServer &aStsTestServer); |
|
201 protected: |
|
202 virtual void ImplTestStepPreambleL(); |
|
203 virtual void ImplTestStepPostambleL(); |
|
204 virtual void ImplTestStepL(); |
|
205 }; |
|
206 |
|
207 |
|
208 class CFileOperationsStep : public CStsBaseTestStep |
|
209 { |
|
210 public: |
|
211 CFileOperationsStep(CStsTestServer &aStsTestServer); |
|
212 protected: |
|
213 virtual void ImplTestStepPreambleL(); |
|
214 virtual void ImplTestStepPostambleL(); |
|
215 virtual void ImplTestStepL(); |
|
216 private: |
|
217 void ProcessFileOperationsL(); |
|
218 TPtrC GetNextCommandLineParameterL(const TDesC& aLine, TInt& aNextAvailablePos); |
|
219 }; |
|
220 |
|
221 class CFileModeTestStep : public CStsBaseTestStep |
|
222 { |
|
223 public: |
|
224 CFileModeTestStep(CStsTestServer &aStsTestServer); |
|
225 protected: |
|
226 virtual void ImplTestStepPreambleL(); |
|
227 virtual void ImplTestStepPostambleL(); |
|
228 virtual void ImplTestStepL(); |
|
229 private: |
|
230 void TestCase1L(); |
|
231 void TestCase2L(); |
|
232 void TestCase3L(); |
|
233 }; |
|
234 |
|
235 class CCreateLongFileNameTestStep : public CStsBaseTestStep |
|
236 { |
|
237 public: |
|
238 CCreateLongFileNameTestStep(CStsTestServer &aStsTestServer); |
|
239 protected: |
|
240 virtual void ImplTestStepPreambleL(); |
|
241 virtual void ImplTestStepPostambleL(); |
|
242 virtual void ImplTestStepL(); |
|
243 }; |
|
244 #endif |
|
245 |