|
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 definitions of the transition classes upon the CSmsSchemeHandler class methods. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @SYMCreationDate Created : 01/06/01 14:07:23 |
|
21 */ |
|
22 |
|
23 #ifndef __SMSSCHEMEHANDLERTRANSITIONS_H__ |
|
24 #define __SMSSCHEMEHANDLERTRANSITIONS_H__ |
|
25 |
|
26 #include <ecom/test_bed/testutilities.h> |
|
27 #include <ecom/test_bed/stateaccessor.h> |
|
28 #include <ecom/test_bed/leaktesttransition.h> |
|
29 #include <ecom/test_bed/datalogger.h> |
|
30 #include "SMSSCH.H" |
|
31 #include "SmsSchemeHandlerStateAccessor.h" |
|
32 #include <ecom/test_bed/unittest.h> |
|
33 |
|
34 // ______________________________________________________________________________ |
|
35 // |
|
36 /** |
|
37 @internalTechnology |
|
38 @class |
|
39 Comments : Provide all the CSmsSchemeHandler specific |
|
40 parameters and behaviour on the CSmsSchemeHandler |
|
41 test class for a transition. |
|
42 */ |
|
43 |
|
44 class CSmsSchemeHandler_UnitTestContext : public CUnitTestContext |
|
45 { |
|
46 public: |
|
47 /** |
|
48 @fn CSmsSchemeHandler_UnitTestContext(CDataLogger& aDataLogger, |
|
49 MStateAccessor& aStateAccessor, |
|
50 MTransitionObserver& aObserver) |
|
51 Intended Usage : Default constructor. |
|
52 Error Condition : None. |
|
53 @since 6.0 |
|
54 @param aDataLogger The output logging object. |
|
55 @param aObserver The observer of this UnitTest's Transitions. |
|
56 @param aStateAccessor WhiteBox state access to the CSmsSchemeHandler class under test. |
|
57 @pre None. |
|
58 @post CSmsSchemeHandler_UnitTestContext is fully constructed, and initialised. |
|
59 */ |
|
60 inline CSmsSchemeHandler_UnitTestContext(CDataLogger& aDataLogger, |
|
61 MStateAccessor& aStateAccessor, |
|
62 MTransitionObserver& aObserver); |
|
63 |
|
64 /** |
|
65 @fn ~CSmsSchemeHandler_UnitTestContext() |
|
66 Intended Usage : Default Destructor |
|
67 @since 6.0 |
|
68 @pre CSmsSchemeHandler_UnitTestContext is fully constructed. |
|
69 @post CSmsSchemeHandler_UnitTestContext is fully destroyed |
|
70 */ |
|
71 virtual inline ~CSmsSchemeHandler_UnitTestContext(); |
|
72 |
|
73 /** The instance of the class under test */ |
|
74 CSmsSchemeHandler* iSmsSchemeHandler; |
|
75 |
|
76 const TDesC* iUrl; |
|
77 |
|
78 struct SSmsNumber |
|
79 { |
|
80 SSmsNumber() : iNumber(KNullDesC), iServiceCentre(KNullDesC) {} |
|
81 TPtrC iNumber; |
|
82 TPtrC iServiceCentre; |
|
83 }; |
|
84 |
|
85 RArray<SSmsNumber> iPostCheck; |
|
86 |
|
87 }; // CSmsSchemeHandler_UnitTestContext |
|
88 |
|
89 // ______________________________________________________________________________ |
|
90 // |
|
91 /** |
|
92 @internalTechnology |
|
93 @class |
|
94 Comments : Transition test of the CSmsSchemeHandler::NewL method. |
|
95 */ |
|
96 class CSmsSchemeHandler_NewL_Transition : public CTransition |
|
97 { |
|
98 public: |
|
99 /** |
|
100 @fn CSmsSchemeHandler_NewL_Transition(CUnitTestContext& aUTContext, |
|
101 TTransitionValidator& aValidator) |
|
102 Intended Usage : Standard c'tor method. |
|
103 Error Condition : None. |
|
104 @since 6.0 |
|
105 @param aUTContext The context this transition is operating in. |
|
106 @param aValidator Used for checking the pre & post conditions of the test object. |
|
107 @pre None. |
|
108 @post CSmsSchemeHandler_NewL_Transition is fully constructed. |
|
109 */ |
|
110 CSmsSchemeHandler_NewL_Transition(CUnitTestContext& aUTContext, |
|
111 TTransitionValidator& aValidator); |
|
112 /** |
|
113 @fn TransitMethodL() |
|
114 Intended Usage : To execute the CSmsSchemeHandler::NewL method for the test harness. |
|
115 Error Condition : Leaves with an error code. |
|
116 @leave KErrNoMemory, (@see CSmsSchemeHandler::NewL) |
|
117 @since 6.0 |
|
118 @return None |
|
119 @pre CSmsSchemeHandler_NewL_Transition is fully constructed. |
|
120 @post No change in the CSmsSchemeHandler_NewL_Transition apart |
|
121 from iSmsSchemeHandler, which may have changed state. |
|
122 (@see CSmsSchemeHandler::NewL post-condition) for iSmsSchemeHandler's new state. |
|
123 */ |
|
124 inline void TransitMethodL(); |
|
125 |
|
126 /** |
|
127 @fn Context() const |
|
128 Intended Usage : To provide access to the unit test context cast to the correct type. |
|
129 Error Condition : None. |
|
130 @since 6.0 |
|
131 @return The unit test context cast to a CSmsSchemeHandler_UnitTestContext |
|
132 @pre iUTContext is a valid CSmsSchemeHandler_UnitTestContext. |
|
133 @post No change in the CSmsSchemeHandler_NewL_Transition |
|
134 */ |
|
135 inline CSmsSchemeHandler_UnitTestContext& Context() const; |
|
136 }; // CSmsSchemeHandler_NewL_Transition |
|
137 |
|
138 // ______________________________________________________________________________ |
|
139 // |
|
140 /** |
|
141 @internalTechnology |
|
142 @class |
|
143 Comments : Transition test of the CSmsSchemeHandler::Dtor method. |
|
144 */ |
|
145 class CSmsSchemeHandler_Dtor_Transition : public CTransition |
|
146 { |
|
147 public: |
|
148 /** |
|
149 @fn CSmsSchemeHandler_Dtor_Transition(CUnitTestContext& aUTContext, |
|
150 TTransitionValidator& aValidator) |
|
151 Intended Usage : Standard c'tor method. |
|
152 Error Condition : None. |
|
153 @since 6.0 |
|
154 @param aUTContext The context this transition is operating in. |
|
155 @param aValidator Used for checking the pre & post conditions of the test object. |
|
156 @pre None. |
|
157 @post CSmsSchemeHandler_Dtor_Transition is fully constructed. |
|
158 */ |
|
159 CSmsSchemeHandler_Dtor_Transition(CUnitTestContext& aUTContext, |
|
160 TTransitionValidator& aValidator); |
|
161 /** |
|
162 @fn TransitMethodL() |
|
163 Intended Usage : To execute the CSmsSchemeHandler::Dtor method for the test harness. |
|
164 Error Condition : Leaves with an error code. |
|
165 @leave KErrNoMemory, (@see CSmsSchemeHandler::Dtor) |
|
166 @since 6.0 |
|
167 @return None |
|
168 @pre CSmsSchemeHandler_Dtor_Transition is fully constructed. |
|
169 @post No change in the CSmsSchemeHandler_Dtor_Transition apart |
|
170 from iSmsSchemeHandler, which may have changed state. |
|
171 (@see CSmsSchemeHandler::Dtor post-condition) for iSmsSchemeHandler's new state. |
|
172 */ |
|
173 inline void TransitMethodL(); |
|
174 |
|
175 /** |
|
176 @fn Context() const |
|
177 Intended Usage : To provide access to the unit test context cast to the correct type. |
|
178 Error Condition : None. |
|
179 @since 6.0 |
|
180 @return The unit test context cast to a CSmsSchemeHandler_UnitTestContext |
|
181 @pre iUTContext is a valid CSmsSchemeHandler_UnitTestContext. |
|
182 @post No change in the CSmsSchemeHandler_Dtor_Transition |
|
183 */ |
|
184 inline CSmsSchemeHandler_UnitTestContext& Context() const; |
|
185 }; // CSmsSchemeHandler_Dtor_Transition |
|
186 |
|
187 |
|
188 // ______________________________________________________________________________ |
|
189 // |
|
190 /** |
|
191 @internalTechnology |
|
192 @class |
|
193 Comments : Transition test of the CSmsSchemeHandler::ParseUrlL method. |
|
194 */ |
|
195 class CSmsSchemeHandler_ParseUrlL_Transition : public CTransition |
|
196 { |
|
197 public: |
|
198 /** |
|
199 @fn CSmsSchemeHandler_ParseUrlL_Transition(CUnitTestContext& aUTContext, |
|
200 TTransitionValidator& aValidator) |
|
201 Intended Usage : Standard c'tor method. |
|
202 Error Condition : None. |
|
203 @since 6.0 |
|
204 @param aUTContext The context this transition is operating in. |
|
205 @param aValidator Used for checking the pre & post conditions of the test object. |
|
206 @pre None. |
|
207 @post CSmsSchemeHandler_ParseUrlL_Transition is fully constructed. |
|
208 */ |
|
209 CSmsSchemeHandler_ParseUrlL_Transition(CUnitTestContext& aUTContext, |
|
210 TTransitionValidator& aValidator); |
|
211 /** |
|
212 @fn TransitMethodL() |
|
213 Intended Usage : To execute the CSmsSchemeHandler::ParseUrlL method for the test harness. |
|
214 Error Condition : Leaves with an error code. |
|
215 @leave KErrNoMemory, (@see CSmsSchemeHandler::ParseUrlL) |
|
216 @since 6.0 |
|
217 @return None |
|
218 @pre CSmsSchemeHandler_ParseUrlL_Transition is fully constructed. |
|
219 @post No change in the CSmsSchemeHandler_ParseUrlL_Transition apart |
|
220 from iSmsSchemeHandler, which may have changed state. |
|
221 (@see CSmsSchemeHandler::ParseUrlL post-condition) for iSmsSchemeHandler's new state. |
|
222 */ |
|
223 inline void TransitMethodL(); |
|
224 |
|
225 /** |
|
226 @fn Context() const |
|
227 Intended Usage : To provide access to the unit test context cast to the correct type. |
|
228 Error Condition : None. |
|
229 @since 6.0 |
|
230 @return The unit test context cast to a CSmsSchemeHandler_UnitTestContext |
|
231 @pre iUTContext is a valid CSmsSchemeHandler_UnitTestContext. |
|
232 @post No change in the CSmsSchemeHandler_ParseUrlL_Transition |
|
233 */ |
|
234 inline CSmsSchemeHandler_UnitTestContext& Context() const; |
|
235 }; // CSmsSchemeHandler_ParseUrlL_Transition |
|
236 |
|
237 |
|
238 // Add additional Transition class definitions here... |
|
239 |
|
240 #include "SmsSchemeHandlerTransitions.inl" |
|
241 |
|
242 #include "SmsSchemeHandlerUnitTestContext.inl" |
|
243 |
|
244 #endif // __SMSSCHEMEHANDLERTRANSITIONS_H__ |
|
245 |