1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 |
|
19 ABTester is both a client of the SBEngine and ABServer only for test purposes |
|
20 */ |
|
21 |
|
22 #ifndef __ABTESTER_H__ |
|
23 #define __ABTESTER_H__ |
|
24 |
|
25 #include <sbeclient.h> |
|
26 #include <abclient.h> |
|
27 |
|
28 namespace conn |
|
29 { |
|
30 class CABDataOwner; |
|
31 class CABData; |
|
32 |
|
33 const TInt KABTestABSID = 0x0AB7E57E; |
|
34 _LIT(KABTestPanicText, "ABTester"); |
|
35 |
|
36 enum TABTestStep |
|
37 { |
|
38 EABGetListOfDataOwners, |
|
39 EABSetBackupMode, |
|
40 EABSetBaseBackupOwners, |
|
41 EABGetExpectedDataSize, |
|
42 EABGetBackupRegFile, |
|
43 EABGetABDOState, |
|
44 EABGetActiveSnapshot, |
|
45 EABGetActiveData, |
|
46 EABSetNormalMode, |
|
47 EABSetRestoreMode, |
|
48 EABSupplyRegData, |
|
49 EABSupplyActiveSnapshot, |
|
50 EABSupplyActiveData |
|
51 }; |
|
52 |
|
53 /** |
|
54 This class owns the SBEClient and also owns the test ABClient |
|
55 |
|
56 It's responsible for running the test steps and storing the results |
|
57 */ |
|
58 class CABTester : public CActive |
|
59 { |
|
60 public: |
|
61 static CABTester* NewLC(); |
|
62 void Run(); |
|
63 ~CABTester(); |
|
64 |
|
65 // CActive |
|
66 protected: |
|
67 void DoCancel(); |
|
68 void RunL(); |
|
69 TInt RunError(TInt aError); |
|
70 |
|
71 private: |
|
72 CABTester() : CActive(EPriorityNormal), iSBEClient(NULL), iStepNumber(0), |
|
73 iABSID(KABTestABSID), iTestDOI(NULL), iTestDOISID(NULL), iBackupRegFile(NULL), |
|
74 iActiveSnapshot(NULL), iActiveData(NULL), iABDOStatus(EUnset) |
|
75 {} |
|
76 void ConstructL(); |
|
77 |
|
78 // The test steps |
|
79 void InitTestStepArray(); |
|
80 void DoTestStepL(TABTestStep aStepId); |
|
81 void StepGetListOfDataOwnersL(); |
|
82 void StepSetBaseBackupOwnersL(); |
|
83 void Pass(); |
|
84 void Fail(TInt aCode = KErrAbort); |
|
85 void GetABDOStateL(); |
|
86 |
|
87 private: |
|
88 CSBEClient* iSBEClient; |
|
89 RArray<TABTestStep> iTestSteps; |
|
90 TInt iStepNumber; |
|
91 TSecureId iABSID; |
|
92 CDataOwnerInfo* iTestDOI; |
|
93 CSBSecureId* iTestDOISID; |
|
94 HBufC8* iBackupRegFile; |
|
95 HBufC8* iActiveSnapshot; |
|
96 HBufC8* iActiveData; |
|
97 TDataOwnerStatus iABDOStatus; |
|
98 }; |
|
99 } |
|
100 |
|
101 #endif //__ABTESTER_H__ |
|