|
1 // Copyright (c) 1997-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 // The implementation of the transition classes upon the CComponentTester class methods. |
|
15 // |
|
16 // |
|
17 |
|
18 // ______________________________________________________________________________ |
|
19 // |
|
20 _LIT(KComponentTesterNewLTransition,"CComponentTester_NewL_Transition"); |
|
21 |
|
22 inline CComponentTester_NewL_Transition::CComponentTester_NewL_Transition(CUnitTestContext& aUTContext, |
|
23 TTransitionValidator& aValidator) |
|
24 : CTransitionType(KComponentTesterNewLTransition, aUTContext, aValidator) |
|
25 { |
|
26 // Do nothing here. |
|
27 } |
|
28 |
|
29 inline void CComponentTester_NewL_Transition::TransitMethodL() |
|
30 { |
|
31 _LIT(KComponentTesterNewLTransitMethod, "CComponentTester::NewL transition"); |
|
32 Context().DataLogger().LogInformation(KComponentTesterNewLTransitMethod); |
|
33 TComponentTester_StateAccessor& accessor = REINTERPRET_CAST(TComponentTester_StateAccessor&, Context().StateAccessor()); |
|
34 Context().iComponentUnderTest = accessor.CreateComponentTester(*(Context().iComponentTester), *Context().iDataLogger, *Context().iObserver); |
|
35 } |
|
36 |
|
37 inline CComponentTester_UnitTestContext& CComponentTester_NewL_Transition::Context() const |
|
38 { |
|
39 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
40 } |
|
41 |
|
42 // ______________________________________________________________________________ |
|
43 // |
|
44 _LIT(KComponentTesterDtorTransition,"CComponentTester_Dtor_Transition"); |
|
45 |
|
46 inline CComponentTester_Dtor_Transition::CComponentTester_Dtor_Transition(CUnitTestContext& aUTContext, |
|
47 TTransitionValidator& aValidator) |
|
48 : CTransition(KComponentTesterDtorTransition, aUTContext, aValidator) |
|
49 { |
|
50 // Do nothing here. |
|
51 } |
|
52 |
|
53 inline void CComponentTester_Dtor_Transition::TransitMethodL() |
|
54 { |
|
55 _LIT(KComponentTesterDtorTransitMethod, "CComponentTester::Dtor transition"); |
|
56 Context().DataLogger().LogInformation(KComponentTesterDtorTransitMethod); |
|
57 delete Context().iComponentTester; |
|
58 Context().iComponentTester = NULL; |
|
59 } |
|
60 |
|
61 inline CComponentTester_UnitTestContext& CComponentTester_Dtor_Transition::Context() const |
|
62 { |
|
63 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
64 } |
|
65 |
|
66 // ______________________________________________________________________________ |
|
67 // |
|
68 _LIT(KComponentTesterTransitionSetsLTransition,"CComponentTester_TransitionSetsL_Transition"); |
|
69 |
|
70 inline CComponentTester_TransitionSetsL_Transition::CComponentTester_TransitionSetsL_Transition(CUnitTestContext& aUTContext, |
|
71 TTransitionValidator& aValidator) |
|
72 : CTransitionType(KComponentTesterTransitionSetsLTransition, aUTContext, aValidator) |
|
73 { |
|
74 // Do nothing here. |
|
75 } |
|
76 |
|
77 inline void CComponentTester_TransitionSetsL_Transition::TransitMethodL() |
|
78 { |
|
79 _LIT(KComponentTesterTransitionSetsLTransitMethod, "CComponentTester::TransitionSetsL transition"); |
|
80 Context().DataLogger().LogInformation(KComponentTesterTransitionSetsLTransitMethod); |
|
81 Context().iComponentTester->TransitionSetsL(); |
|
82 } |
|
83 |
|
84 inline CComponentTester_UnitTestContext& CComponentTester_TransitionSetsL_Transition::Context() const |
|
85 { |
|
86 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
87 } |
|
88 |
|
89 // ______________________________________________________________________________ |
|
90 // |
|
91 _LIT(KComponentTesterAddUnitTestLTransition,"CComponentTester_AddUnitTestL_Transition"); |
|
92 |
|
93 inline CComponentTester_AddUnitTestL_Transition::CComponentTester_AddUnitTestL_Transition(CUnitTestContext& aUTContext, |
|
94 TTransitionValidator& aValidator) |
|
95 : CTransitionType(KComponentTesterAddUnitTestLTransition, aUTContext, aValidator) |
|
96 { |
|
97 // Do nothing here. |
|
98 } |
|
99 |
|
100 inline void CComponentTester_AddUnitTestL_Transition::TransitMethodL() |
|
101 { |
|
102 _LIT(KComponentTesterAddUnitTestLTransitMethod, "CComponentTester::AddUnitTestL transition"); |
|
103 Context().DataLogger().LogInformation(KComponentTesterAddUnitTestLTransitMethod); |
|
104 TComponentTester_StateAccessor& accessor = REINTERPRET_CAST(TComponentTester_StateAccessor&, Context().StateAccessor()); |
|
105 accessor.AddUnitTestL(*(Context().iComponentTester), (Context().iUnitTest)); |
|
106 } |
|
107 |
|
108 inline CComponentTester_UnitTestContext& CComponentTester_AddUnitTestL_Transition::Context() const |
|
109 { |
|
110 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
111 } |
|
112 |
|
113 // ______________________________________________________________________________ |
|
114 // |
|
115 _LIT(KComponentTesterAddParamUnitTestLTransition,"CComponentTester_AddParamUnitTestL_Transition"); |
|
116 |
|
117 inline CComponentTester_AddParamUnitTestL_Transition::CComponentTester_AddParamUnitTestL_Transition(CUnitTestContext& aUTContext, |
|
118 TTransitionValidator& aValidator) |
|
119 : CTransitionType(KComponentTesterAddParamUnitTestLTransition, aUTContext, aValidator) |
|
120 { |
|
121 // Do nothing here. |
|
122 } |
|
123 |
|
124 inline void CComponentTester_AddParamUnitTestL_Transition::TransitMethodL() |
|
125 { |
|
126 _LIT(KComponentTesterAddParamUnitTestLTransitMethod, "CComponentTester::AddParamUnitTestL transition"); |
|
127 Context().DataLogger().LogInformation(KComponentTesterAddParamUnitTestLTransitMethod); |
|
128 TComponentTester_StateAccessor& accessor = REINTERPRET_CAST(TComponentTester_StateAccessor&, Context().StateAccessor()); |
|
129 accessor.AddParamUnitTestL(*(Context().iComponentTester), (Context().iUnitTest)); |
|
130 } |
|
131 |
|
132 inline CComponentTester_UnitTestContext& CComponentTester_AddParamUnitTestL_Transition::Context() const |
|
133 { |
|
134 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
135 } |
|
136 |
|
137 // ______________________________________________________________________________ |
|
138 // |
|
139 _LIT(KComponentTesterTestComponentTransition,"CComponentTester_TestComponent_Transition"); |
|
140 |
|
141 inline CComponentTester_TestComponent_Transition::CComponentTester_TestComponent_Transition(CUnitTestContext& aUTContext, |
|
142 TTransitionValidator& aValidator) |
|
143 : CTransition(KComponentTesterTestComponentTransition, aUTContext, aValidator) |
|
144 { |
|
145 // Do nothing here. |
|
146 } |
|
147 |
|
148 inline void CComponentTester_TestComponent_Transition::TransitMethodL() |
|
149 { |
|
150 _LIT(KComponentTesterTestComponentTransitMethod, "CComponentTester::TestComponent transition"); |
|
151 Context().DataLogger().LogInformation(KComponentTesterTestComponentTransitMethod); |
|
152 Context().iComponentTester->TestComponent(&Context().iTests); |
|
153 } |
|
154 |
|
155 inline CComponentTester_UnitTestContext& CComponentTester_TestComponent_Transition::Context() const |
|
156 { |
|
157 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
158 } |
|
159 |
|
160 // ______________________________________________________________________________ |
|
161 // |
|
162 _LIT(KComponentTesterRunLTransition,"CComponentTester_RunL_Transition"); |
|
163 |
|
164 inline CComponentTester_RunL_Transition::CComponentTester_RunL_Transition(CUnitTestContext& aUTContext, |
|
165 TTransitionValidator& aValidator) |
|
166 : CTransitionType(KComponentTesterRunLTransition, aUTContext, aValidator) |
|
167 { |
|
168 // Do nothing here. |
|
169 } |
|
170 |
|
171 inline void CComponentTester_RunL_Transition::TransitMethodL() |
|
172 { |
|
173 _LIT(KComponentTesterRunLTransitMethod, "CComponentTester::RunL transition"); |
|
174 Context().DataLogger().LogInformation(KComponentTesterRunLTransitMethod); |
|
175 TComponentTester_StateAccessor& accessor = REINTERPRET_CAST(TComponentTester_StateAccessor&, Context().StateAccessor()); |
|
176 accessor.RunL(*(Context().iComponentTester)); |
|
177 } |
|
178 |
|
179 inline CComponentTester_UnitTestContext& CComponentTester_RunL_Transition::Context() const |
|
180 { |
|
181 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
182 } |
|
183 |
|
184 // ______________________________________________________________________________ |
|
185 // |
|
186 _LIT(KComponentTesterCompleteTransition,"CComponentTester_Complete_Transition"); |
|
187 |
|
188 inline CComponentTester_Complete_Transition::CComponentTester_Complete_Transition(CUnitTestContext& aUTContext, |
|
189 TTransitionValidator& aValidator) |
|
190 : CTransition(KComponentTesterCompleteTransition, aUTContext, aValidator) |
|
191 { |
|
192 // Do nothing here. |
|
193 } |
|
194 |
|
195 inline void CComponentTester_Complete_Transition::TransitMethodL() |
|
196 { |
|
197 _LIT(KComponentTesterCompleteTransitMethod, "CComponentTester::Complete transition"); |
|
198 Context().DataLogger().LogInformation(KComponentTesterCompleteTransitMethod); |
|
199 Context().iComponentTester->Complete(Context().iUnitTest); |
|
200 } |
|
201 |
|
202 inline CComponentTester_UnitTestContext& CComponentTester_Complete_Transition::Context() const |
|
203 { |
|
204 return REINTERPRET_CAST(CComponentTester_UnitTestContext&,iUTContext); |
|
205 } |
|
206 |
|
207 |
|
208 // Add additional Transition class Implementations here... |
|
209 |