|
1 /* |
|
2 * Copyright (c) 2006 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // CLASS HEADER |
|
20 #include "MT_CFOperationPluginManager.h" |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <EUnitMacros.h> |
|
24 #include <EUnitDecorators.h> |
|
25 #include <ECom/ECom.h> |
|
26 #include "cfoperationpluginmanager.h" |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include "cfscripthandler.h" |
|
30 #include "cfenvutils.h" |
|
31 |
|
32 // CONSTRUCTION |
|
33 MT_CFOperationPluginManager* MT_CFOperationPluginManager::NewL() |
|
34 { |
|
35 MT_CFOperationPluginManager* self = MT_CFOperationPluginManager::NewLC(); |
|
36 CleanupStack::Pop(); |
|
37 |
|
38 return self; |
|
39 } |
|
40 |
|
41 MT_CFOperationPluginManager* MT_CFOperationPluginManager::NewLC() |
|
42 { |
|
43 MT_CFOperationPluginManager* self = new( ELeave ) MT_CFOperationPluginManager(); |
|
44 CleanupStack::PushL( self ); |
|
45 |
|
46 self->ConstructL(); |
|
47 |
|
48 return self; |
|
49 } |
|
50 |
|
51 // Destructor (virtual by CBase) |
|
52 MT_CFOperationPluginManager::~MT_CFOperationPluginManager() |
|
53 { |
|
54 // Enable screen saver |
|
55 CFEnvUtils::EnableScreenSaver( ETrue ); |
|
56 } |
|
57 |
|
58 // Default constructor |
|
59 MT_CFOperationPluginManager::MT_CFOperationPluginManager() |
|
60 { |
|
61 } |
|
62 |
|
63 // Second phase construct |
|
64 void MT_CFOperationPluginManager::ConstructL() |
|
65 { |
|
66 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
67 // It generates the test case table. |
|
68 CEUnitTestSuiteClass::ConstructL(); |
|
69 |
|
70 // Disable screen saver |
|
71 CFEnvUtils::EnableScreenSaver( EFalse ); |
|
72 } |
|
73 |
|
74 // METHODS |
|
75 |
|
76 |
|
77 void MT_CFOperationPluginManager::SetupL( ) |
|
78 { |
|
79 iCCFOperationPluginManager = CCFOperationPluginManager::NewL( *this ); |
|
80 } |
|
81 |
|
82 void MT_CFOperationPluginManager::SetupEmptyL( ) |
|
83 { |
|
84 |
|
85 } |
|
86 |
|
87 |
|
88 void MT_CFOperationPluginManager::Teardown( ) |
|
89 { |
|
90 delete iCCFOperationPluginManager; |
|
91 iCCFOperationPluginManager = NULL; |
|
92 |
|
93 iArray.Close(); |
|
94 |
|
95 #ifdef __WINS__ |
|
96 REComSession::FinalClose(); |
|
97 #endif |
|
98 } |
|
99 |
|
100 |
|
101 |
|
102 //----------------------------------------------------------------------------- |
|
103 // MT_CFOperationPluginManager::T_CCFOperationPluginManager_NewLL |
|
104 //----------------------------------------------------------------------------- |
|
105 // |
|
106 void MT_CFOperationPluginManager::T_CCFOperationPluginManager_NewLL( ) |
|
107 { |
|
108 CCFOperationPluginManager* instance = |
|
109 CCFOperationPluginManager::NewL( *this ); |
|
110 CleanupStack::PushL( instance ); |
|
111 |
|
112 EUNIT_ASSERT_DESC( instance, "CCFOperationPluginManager instance not created!" ); |
|
113 |
|
114 CleanupStack::PopAndDestroy( instance ); |
|
115 } |
|
116 |
|
117 //----------------------------------------------------------------------------- |
|
118 // MT_CFOperationPluginManager::T_CCFOperationPluginManager_NewLL |
|
119 //----------------------------------------------------------------------------- |
|
120 // |
|
121 void MT_CFOperationPluginManager::T_CCFOperationPluginManager_NewLCL( ) |
|
122 { |
|
123 CCFOperationPluginManager* instance = |
|
124 CCFOperationPluginManager::NewLC( *this ); |
|
125 |
|
126 EUNIT_ASSERT_DESC( instance, "CCFOperationPluginManager instance not created!" ); |
|
127 |
|
128 CleanupStack::PopAndDestroy( instance ); |
|
129 } |
|
130 |
|
131 //----------------------------------------------------------------------------- |
|
132 // MT_CFOperationPluginManager::T_CCFOperationPluginManager_InitializePhaseL1L |
|
133 //----------------------------------------------------------------------------- |
|
134 // |
|
135 void MT_CFOperationPluginManager::T_CCFOperationPluginManager_InitializePhaseL1L( ) |
|
136 { |
|
137 // Activate checks |
|
138 //TInt err = RProperty::Set( KContextSourceTestCategory, KDisableChecks, 1 ); |
|
139 |
|
140 // Load only first phase plug-ins (TestContextSourcePlugin) |
|
141 MCFStarterObserver* instance = |
|
142 static_cast<MCFStarterObserver*>( iCCFOperationPluginManager ); |
|
143 instance->InitializePhaseL( CCFPhaseBase::ECFDeviceStarting ); |
|
144 } |
|
145 |
|
146 //----------------------------------------------------------------------------- |
|
147 // MT_CFOperationPluginManager::T_CCFOperationPluginManager_InitializePhaseL2L |
|
148 //----------------------------------------------------------------------------- |
|
149 // |
|
150 void MT_CFOperationPluginManager::T_CCFOperationPluginManager_InitializePhaseL2L( ) |
|
151 { |
|
152 // Load all phases |
|
153 MCFStarterObserver* instance = |
|
154 static_cast<MCFStarterObserver*>( iCCFOperationPluginManager ); |
|
155 instance->InitializePhaseL( CCFPhaseBase::ECFDeviceStarting ); |
|
156 instance->InitializePhaseL( CCFPhaseBase::ECFDeviceStarted ); |
|
157 instance->InitializePhaseL( CCFPhaseBase::ECFCfwReady ); |
|
158 } |
|
159 |
|
160 |
|
161 // TEST TABLE |
|
162 EUNIT_BEGIN_TEST_TABLE( |
|
163 MT_CFOperationPluginManager, |
|
164 "Add test suite description here.", |
|
165 "MODULE" ) |
|
166 |
|
167 EUNIT_TEST( |
|
168 "NewL - test ", |
|
169 "CCFOperationPluginManager", |
|
170 "NewL", |
|
171 "FUNCTIONALITY", |
|
172 SetupEmptyL, T_CCFOperationPluginManager_NewLL, Teardown) |
|
173 |
|
174 EUNIT_TEST( |
|
175 "NewLC - test ", |
|
176 "CCFOperationPluginManager", |
|
177 "NewLC", |
|
178 "FUNCTIONALITY", |
|
179 SetupEmptyL, T_CCFOperationPluginManager_NewLCL, Teardown) |
|
180 |
|
181 EUNIT_TEST( |
|
182 "InitializePhaseL 1 - test ", |
|
183 "CCFOperationPluginManager", |
|
184 "InitializePhaseL", |
|
185 "FUNCTIONALITY", |
|
186 SetupL, T_CCFOperationPluginManager_InitializePhaseL1L, Teardown) |
|
187 |
|
188 EUNIT_TEST( |
|
189 "InitializePhaseL 2 - test ", |
|
190 "CCFOperationPluginManager", |
|
191 "InitializePhaseL", |
|
192 "FUNCTIONALITY", |
|
193 SetupL, T_CCFOperationPluginManager_InitializePhaseL2L, Teardown) |
|
194 |
|
195 EUNIT_END_TEST_TABLE |
|
196 |
|
197 // END OF FILE |