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 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 // INCLUDE FILES |
|
27 #include <StifTestInterface.h> |
|
28 #include "ui_tsecuritymanager.h" |
|
29 #include <SettingServerClient.h> |
|
30 |
|
31 |
|
32 |
|
33 // ============================ MEMBER FUNCTIONS =============================== |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // Cui_tsecuritymanager::Cui_tsecuritymanager |
|
37 // C++ default constructor can NOT contain any code, that |
|
38 // might leave. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 Cui_tsecuritymanager::Cui_tsecuritymanager( |
|
42 CTestModuleIf& aTestModuleIf ): |
|
43 CScriptBase( aTestModuleIf ) |
|
44 { |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // Cui_tsecuritymanager::ConstructL |
|
49 // Symbian 2nd phase constructor can leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 void Cui_tsecuritymanager::ConstructL() |
|
53 { |
|
54 //Read logger settings to check whether test case name is to be |
|
55 //appended to log file name. |
|
56 RSettingServer settingServer; |
|
57 TInt ret = settingServer.Connect(); |
|
58 if(ret != KErrNone) |
|
59 { |
|
60 User::Leave(ret); |
|
61 } |
|
62 // Struct to StifLogger settigs. |
|
63 TLoggerSettings loggerSettings; |
|
64 // Parse StifLogger defaults from STIF initialization file. |
|
65 ret = settingServer.GetLoggerSettings(loggerSettings); |
|
66 if(ret != KErrNone) |
|
67 { |
|
68 User::Leave(ret); |
|
69 } |
|
70 // Close Setting server session |
|
71 settingServer.Close(); |
|
72 |
|
73 TFileName logFileName; |
|
74 |
|
75 if(loggerSettings.iAddTestCaseTitle) |
|
76 { |
|
77 TName title; |
|
78 TestModuleIf().GetTestCaseTitleL(title); |
|
79 logFileName.Format(Kui_tsecuritymanagerLogFileWithTitle, &title); |
|
80 } |
|
81 else |
|
82 { |
|
83 logFileName.Copy(Kui_tsecuritymanagerLogFile); |
|
84 } |
|
85 |
|
86 iLog = CStifLogger::NewL( Kui_tsecuritymanagerLogPath, |
|
87 logFileName, |
|
88 CStifLogger::ETxt, |
|
89 CStifLogger::EFile, |
|
90 EFalse ); |
|
91 |
|
92 // SendTestClassVersion(); |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // Cui_tsecuritymanager::NewL |
|
97 // Two-phased constructor. |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 Cui_tsecuritymanager* Cui_tsecuritymanager::NewL( |
|
101 CTestModuleIf& aTestModuleIf ) |
|
102 { |
|
103 Cui_tsecuritymanager* self = new (ELeave) Cui_tsecuritymanager( aTestModuleIf ); |
|
104 |
|
105 CleanupStack::PushL( self ); |
|
106 self->ConstructL(); |
|
107 CleanupStack::Pop(); |
|
108 |
|
109 return self; |
|
110 |
|
111 } |
|
112 |
|
113 // Destructor |
|
114 Cui_tsecuritymanager::~Cui_tsecuritymanager() |
|
115 { |
|
116 |
|
117 // Delete resources allocated from test methods |
|
118 Delete(); |
|
119 |
|
120 // Delete logger |
|
121 delete iLog; |
|
122 |
|
123 } |
|
124 |
|
125 //----------------------------------------------------------------------------- |
|
126 // Cui_tsecuritymanager::SendTestClassVersion |
|
127 // Method used to send version of test class |
|
128 //----------------------------------------------------------------------------- |
|
129 // |
|
130 /*void Cui_tsecuritymanager::SendTestClassVersion() |
|
131 { |
|
132 TVersion moduleVersion; |
|
133 moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; |
|
134 moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; |
|
135 moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; |
|
136 |
|
137 TFileName moduleName; |
|
138 moduleName = _L("ui_tsecuritymanager.dll"); |
|
139 |
|
140 TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName); |
|
141 }*/ |
|
142 |
|
143 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // LibEntryL is a polymorphic Dll entry point. |
|
147 // Returns: CScriptBase: New CScriptBase derived object |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 EXPORT_C CScriptBase* LibEntryL( |
|
151 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
152 { |
|
153 |
|
154 return ( CScriptBase* ) Cui_tsecuritymanager::NewL( aTestModuleIf ); |
|
155 |
|
156 } |
|
157 |
|
158 |
|
159 // End of File |
|