sl@0
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// The unit test class implementations for the CLoadManager tests
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "LoadManagerUnitTest.h"
|
sl@0
|
19 |
#include "RegistryData.h"
|
sl@0
|
20 |
|
sl@0
|
21 |
CLoadManager_CreateAndDestroy_UnitTest* CLoadManager_CreateAndDestroy_UnitTest::NewL(CDataLogger& aDataLogger,
|
sl@0
|
22 |
MUnitTestObserver& aObserver)
|
sl@0
|
23 |
{
|
sl@0
|
24 |
CLoadManager_CreateAndDestroy_UnitTest* self =
|
sl@0
|
25 |
new(ELeave) CLoadManager_CreateAndDestroy_UnitTest(aDataLogger,
|
sl@0
|
26 |
aObserver);
|
sl@0
|
27 |
CleanupStack::PushL(self);
|
sl@0
|
28 |
self->ConstructL();
|
sl@0
|
29 |
CleanupStack::Pop();
|
sl@0
|
30 |
return self;
|
sl@0
|
31 |
}
|
sl@0
|
32 |
|
sl@0
|
33 |
// Now the Individual transitions need to be added.
|
sl@0
|
34 |
inline void CLoadManager_CreateAndDestroy_UnitTest::ConstructL()
|
sl@0
|
35 |
{
|
sl@0
|
36 |
// Perform the base class initialization
|
sl@0
|
37 |
UnitTestConstructL();
|
sl@0
|
38 |
|
sl@0
|
39 |
// Create the Unit test state accessor
|
sl@0
|
40 |
iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
|
sl@0
|
41 |
// Construct the Unit test context.
|
sl@0
|
42 |
iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
|
sl@0
|
43 |
// Add the Transitions in the order they are to run
|
sl@0
|
44 |
// C'tor first, D'tor last...
|
sl@0
|
45 |
iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
|
sl@0
|
46 |
AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
|
sl@0
|
47 |
iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
|
sl@0
|
48 |
AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
void CLoadManager_CreateAndDestroy_UnitTest::PrepareUnitTestL()
|
sl@0
|
52 |
{
|
sl@0
|
53 |
// Give the context a constructed set of data
|
sl@0
|
54 |
iUTContext->iRegistryData = CRegistryData::NewL(iFs);
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
// ______________________________________________________________________________
|
sl@0
|
58 |
//
|
sl@0
|
59 |
CLoadManager_FindInstantiationAndDestroy_UnitTest* CLoadManager_FindInstantiationAndDestroy_UnitTest::NewL(CDataLogger& aDataLogger,
|
sl@0
|
60 |
MUnitTestObserver& aObserver)
|
sl@0
|
61 |
{
|
sl@0
|
62 |
CLoadManager_FindInstantiationAndDestroy_UnitTest* self =
|
sl@0
|
63 |
new(ELeave) CLoadManager_FindInstantiationAndDestroy_UnitTest(aDataLogger,
|
sl@0
|
64 |
aObserver);
|
sl@0
|
65 |
CleanupStack::PushL(self);
|
sl@0
|
66 |
self->ConstructL();
|
sl@0
|
67 |
CleanupStack::Pop();
|
sl@0
|
68 |
return self;
|
sl@0
|
69 |
}
|
sl@0
|
70 |
|
sl@0
|
71 |
// Now the Individual transitions need to be added.
|
sl@0
|
72 |
inline void CLoadManager_FindInstantiationAndDestroy_UnitTest::ConstructL()
|
sl@0
|
73 |
{
|
sl@0
|
74 |
// Perform the base class initialization
|
sl@0
|
75 |
UnitTestConstructL();
|
sl@0
|
76 |
|
sl@0
|
77 |
// Create the Unit test state accessor
|
sl@0
|
78 |
iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
|
sl@0
|
79 |
// Construct the Unit test context.
|
sl@0
|
80 |
iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
|
sl@0
|
81 |
|
sl@0
|
82 |
iUTContext->iUniqueImplementationUid = KUniqueImplementationUid_Works;
|
sl@0
|
83 |
// Add the Transitions in the order they are to run
|
sl@0
|
84 |
// C'tor first, D'tor last...
|
sl@0
|
85 |
iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
|
sl@0
|
86 |
AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
|
sl@0
|
87 |
|
sl@0
|
88 |
iInstantiationMethodValidator = new(ELeave) TLoadManager_InstantiationMethod_TransitionValidator(*iUTContext);
|
sl@0
|
89 |
AddTransitionL(new(ELeave)CLoadManager_InstantiationMethodL_Transition(*iUTContext,*iInstantiationMethodValidator));
|
sl@0
|
90 |
|
sl@0
|
91 |
iDestroyThisValidator = new(ELeave) TLoadManager_DestroyThis_TransitionValidator(*iUTContext);
|
sl@0
|
92 |
AddTransitionL(new(ELeave)CLoadManager_DestroyedThis_Transition(*iUTContext,*iDestroyThisValidator));
|
sl@0
|
93 |
|
sl@0
|
94 |
iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
|
sl@0
|
95 |
AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
|
sl@0
|
96 |
}
|
sl@0
|
97 |
|
sl@0
|
98 |
void CLoadManager_FindInstantiationAndDestroy_UnitTest::PrepareUnitTestL()
|
sl@0
|
99 |
{
|
sl@0
|
100 |
iUTContext->iRegistryData = CRegistryData::NewL(iFs);
|
sl@0
|
101 |
}
|
sl@0
|
102 |
|
sl@0
|
103 |
// ______________________________________________________________________________
|
sl@0
|
104 |
//
|
sl@0
|
105 |
CLoadManager_FindInstantiationFailure_UnitTest* CLoadManager_FindInstantiationFailure_UnitTest::NewL(CDataLogger& aDataLogger,
|
sl@0
|
106 |
MUnitTestObserver& aObserver)
|
sl@0
|
107 |
{
|
sl@0
|
108 |
CLoadManager_FindInstantiationFailure_UnitTest* self =
|
sl@0
|
109 |
new(ELeave) CLoadManager_FindInstantiationFailure_UnitTest(aDataLogger,
|
sl@0
|
110 |
aObserver);
|
sl@0
|
111 |
CleanupStack::PushL(self);
|
sl@0
|
112 |
self->ConstructL();
|
sl@0
|
113 |
CleanupStack::Pop();
|
sl@0
|
114 |
return self;
|
sl@0
|
115 |
}
|
sl@0
|
116 |
|
sl@0
|
117 |
// Now the Individual transitions need to be added.
|
sl@0
|
118 |
inline void CLoadManager_FindInstantiationFailure_UnitTest::ConstructL()
|
sl@0
|
119 |
{
|
sl@0
|
120 |
// Perform the base class initialization
|
sl@0
|
121 |
UnitTestConstructL();
|
sl@0
|
122 |
|
sl@0
|
123 |
// Create the Unit test state accessor
|
sl@0
|
124 |
iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
|
sl@0
|
125 |
// Construct the Unit test context.
|
sl@0
|
126 |
iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
|
sl@0
|
127 |
|
sl@0
|
128 |
iUTContext->iUniqueImplementationUid = KUniqueImplementationUid_Fails;
|
sl@0
|
129 |
iUTContext->iRegistryData = CRegistryData::NewL(iFs);
|
sl@0
|
130 |
// Add the Transitions in the order they are to run
|
sl@0
|
131 |
// C'tor first, D'tor last...
|
sl@0
|
132 |
iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
|
sl@0
|
133 |
AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
|
sl@0
|
134 |
|
sl@0
|
135 |
iInstantiationMethodValidator = new(ELeave) TLoadManager_InstantiationFailure_TransitionValidator(*iUTContext);
|
sl@0
|
136 |
AddTransitionL(new(ELeave)CLoadManager_InstantiationMethodL_Transition(*iUTContext,*iInstantiationMethodValidator));
|
sl@0
|
137 |
|
sl@0
|
138 |
iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
|
sl@0
|
139 |
AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
|
sl@0
|
140 |
}
|
sl@0
|
141 |
|
sl@0
|
142 |
// ______________________________________________________________________________
|
sl@0
|
143 |
//
|
sl@0
|
144 |
CLoadManager_DefectFOT56ULPM_UnitTest* CLoadManager_DefectFOT56ULPM_UnitTest::NewL(CDataLogger& aDataLogger,
|
sl@0
|
145 |
MUnitTestObserver& aObserver)
|
sl@0
|
146 |
{
|
sl@0
|
147 |
CLoadManager_DefectFOT56ULPM_UnitTest* self =
|
sl@0
|
148 |
new(ELeave) CLoadManager_DefectFOT56ULPM_UnitTest(aDataLogger,
|
sl@0
|
149 |
aObserver);
|
sl@0
|
150 |
CleanupStack::PushL(self);
|
sl@0
|
151 |
self->ConstructL();
|
sl@0
|
152 |
CleanupStack::Pop();
|
sl@0
|
153 |
return self;
|
sl@0
|
154 |
}
|
sl@0
|
155 |
|
sl@0
|
156 |
// Now the Individual transitions need to be added.
|
sl@0
|
157 |
inline void CLoadManager_DefectFOT56ULPM_UnitTest::ConstructL()
|
sl@0
|
158 |
{
|
sl@0
|
159 |
// Perform the base class initialization
|
sl@0
|
160 |
UnitTestConstructL();
|
sl@0
|
161 |
|
sl@0
|
162 |
// Create the Unit test state accessor
|
sl@0
|
163 |
iStateAccessor = new(ELeave) TLoadManager_StateAccessor;
|
sl@0
|
164 |
// Construct the Unit test context.
|
sl@0
|
165 |
iUTContext = new(ELeave) CLoadManager_UnitTestContext(iDataLogger, *iStateAccessor, *this);
|
sl@0
|
166 |
|
sl@0
|
167 |
iUTContext->iUniqueImplementationUid = KUniqueImplementationUid_Works;
|
sl@0
|
168 |
iUTContext->iRegistryData = CRegistryData::NewL(iFs);
|
sl@0
|
169 |
// Add the Transitions in the order they are to run
|
sl@0
|
170 |
// C'tor first, D'tor last...
|
sl@0
|
171 |
iCtorValidator = new(ELeave) TLoadManager_Ctor_TransitionValidator(*iUTContext);
|
sl@0
|
172 |
iInstantiationMethodValidator = new(ELeave) TLoadManager_InstantiationMethod_TransitionValidator(*iUTContext);
|
sl@0
|
173 |
iDestroyThisValidator = new(ELeave) TLoadManager_DestroyThis_TransitionValidator(*iUTContext);
|
sl@0
|
174 |
iDtorValidator = new(ELeave) TLoadManager_Dtor_TransitionValidator(*iUTContext);
|
sl@0
|
175 |
|
sl@0
|
176 |
AddTransitionL(new(ELeave)CLoadManager_NewL_Transition(*iUTContext,*iCtorValidator));
|
sl@0
|
177 |
AddTransitionL(new(ELeave)CLoadManager_InstantiationMethodL_Transition(*iUTContext,*iInstantiationMethodValidator));
|
sl@0
|
178 |
AddTransitionL(new(ELeave)CLoadManager_DestroyCreate_Transition(*iUTContext,*iDestroyThisValidator));
|
sl@0
|
179 |
AddTransitionL(new(ELeave)CLoadManager_DestroyedThis_Transition(*iUTContext,*iDestroyThisValidator));
|
sl@0
|
180 |
AddTransitionL(new(ELeave)CLoadManager_Dtor_Transition(*iUTContext,*iDtorValidator));
|
sl@0
|
181 |
}
|
sl@0
|
182 |
|