|
1 // Copyright (c) 2001-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 // This contains PsdAgt TestCase Test 1.1 - 1.14 |
|
15 // |
|
16 // |
|
17 |
|
18 // EPOC includes |
|
19 #include <e32base.h> |
|
20 #include <in_sock.h> |
|
21 |
|
22 // Test system includes |
|
23 #include "networking/log.h" |
|
24 #include "networking/teststep.h" |
|
25 #include "TestStepPsdAgt.h" |
|
26 #include "TestSuitePsdAgt.h" |
|
27 |
|
28 // COMMDB Database Undo |
|
29 #include "DbUndo.h" |
|
30 |
|
31 // RPacketContext |
|
32 #include <etelpckt.h> |
|
33 |
|
34 // EPsdStartingConfiguration |
|
35 #include <psdprog.h> |
|
36 |
|
37 // Class definitions |
|
38 #include "Psdagttestcommdbparameters.h" |
|
39 |
|
40 |
|
41 // Test case 1.1, CDMA connect and disconnect |
|
42 enum TVerdict CPsdAgtTest1_1::doPsdAgtTestStepL( void ) |
|
43 { |
|
44 TRealAgtNotify agtNotify; |
|
45 agtNotify.SetTestCase(101); |
|
46 |
|
47 // Call basic connect / disconnect function from base class |
|
48 NormalConnectL(); |
|
49 return iTestStepResult; |
|
50 } |
|
51 |
|
52 // Test case 1.2 |
|
53 enum TVerdict CPsdAgtTest1_2::doPsdAgtTestStepL( void ) |
|
54 { |
|
55 TRealAgtNotify agtNotify; |
|
56 agtNotify.SetTestCase(102); |
|
57 |
|
58 ConnectExpectErrorL(KErrNotSupported,EPsdStartingConfiguration); |
|
59 |
|
60 // Close database object, forcing it to undo all changes that were made |
|
61 Log(_L("Reverting COMMDB changes")); |
|
62 |
|
63 return iTestStepResult; |
|
64 } |
|
65 |
|
66 // Test case 1.3 |
|
67 enum TVerdict CPsdAgtTest1_3::doPsdAgtTestStepL( void ) |
|
68 { |
|
69 TRealAgtNotify agtNotify; |
|
70 agtNotify.SetTestCase(103); |
|
71 |
|
72 ConnectExpectErrorL(KErrNotSupported,EPsdStartingConfiguration); |
|
73 |
|
74 // Close database object, forcing it to undo all changes that were made |
|
75 Log(_L("Reverting COMMDB changes")); |
|
76 |
|
77 return iTestStepResult; |
|
78 } |
|
79 |
|
80 // Test case 1.4 |
|
81 enum TVerdict CPsdAgtTest1_4::doPsdAgtTestStepL( void ) |
|
82 { |
|
83 TRealAgtNotify agtNotify; |
|
84 agtNotify.SetTestCase(104); |
|
85 |
|
86 ConnectExpectErrorL(KErrNotSupported,EPsdStartingConfiguration); |
|
87 |
|
88 // Close database object, forcing it to undo all changes that were made |
|
89 Log(_L("Reverting COMMDB changes")); |
|
90 |
|
91 return iTestStepResult; |
|
92 } |
|
93 |
|
94 |
|
95 // Test case 1.5, GPRS connect and disconnect |
|
96 enum TVerdict CPsdAgtTest1_5::doPsdAgtTestStepL( void ) |
|
97 { |
|
98 TRealAgtNotify agtNotify; |
|
99 agtNotify.SetTestCase(105); |
|
100 SetGPRSModeL(agtNotify); |
|
101 |
|
102 // Call basic connect / disconnect function from base class |
|
103 NormalConnectL(); |
|
104 return iTestStepResult; |
|
105 } |
|
106 |
|
107 // Test case 1.6 |
|
108 enum TVerdict CPsdAgtTest1_6::doPsdAgtTestStepL( void ) |
|
109 { |
|
110 TRealAgtNotify agtNotify; |
|
111 agtNotify.SetTestCase(106); |
|
112 SetGPRSModeL(agtNotify); |
|
113 |
|
114 Log(_L("COMMDB changing GPRS_ANONYMOUS_ACCESS to True")); |
|
115 CDbGPRSOutgoingTable *gprs = CDbGPRSOutgoingTable::NewL(); |
|
116 CleanupStack::PushL(gprs); |
|
117 gprs->SetColumnBoolL(TPtrC(GPRS_ANONYMOUS_ACCESS),ETrue); |
|
118 |
|
119 ConnectExpectErrorL(KErrNotSupported,EPsdStartingConfiguration); |
|
120 |
|
121 // Close database object, forcing it to undo all changes that were made |
|
122 Log(_L("Reverting COMMDB changes")); |
|
123 gprs->UndoDatabaseChangesL(); |
|
124 CleanupStack::PopAndDestroy(gprs); |
|
125 return iTestStepResult; |
|
126 } |
|
127 |
|
128 // Test case 1.7 |
|
129 enum TVerdict CPsdAgtTest1_7::doPsdAgtTestStepL( void ) |
|
130 { |
|
131 TRealAgtNotify agtNotify; |
|
132 agtNotify.SetTestCase(107); |
|
133 SetGPRSModeL(agtNotify); |
|
134 |
|
135 Log(_L("COMMDB changing GPRS_DATA_COMPRESSION to True")); |
|
136 CDbGPRSOutgoingTable *gprs = CDbGPRSOutgoingTable::NewL(); |
|
137 CleanupStack::PushL(gprs); |
|
138 gprs->SetColumnBoolL(TPtrC(GPRS_DATA_COMPRESSION),ETrue); |
|
139 |
|
140 ConnectExpectErrorL(KErrNotSupported,EPsdStartingConfiguration); |
|
141 |
|
142 // Close database object, forcing it to undo all changes that were made |
|
143 Log(_L("Reverting COMMDB changes")); |
|
144 gprs->UndoDatabaseChangesL(); |
|
145 CleanupStack::PopAndDestroy(gprs); |
|
146 |
|
147 return iTestStepResult; |
|
148 } |
|
149 |
|
150 // Test case 1.8 |
|
151 enum TVerdict CPsdAgtTest1_8::doPsdAgtTestStepL( void ) |
|
152 { |
|
153 TRealAgtNotify agtNotify; |
|
154 agtNotify.SetTestCase(108); |
|
155 SetGPRSModeL(agtNotify); |
|
156 |
|
157 Log(_L("COMMDB changing GPRS_HEADER_COMPRESSION to True")); |
|
158 CDbGPRSOutgoingTable *gprs = CDbGPRSOutgoingTable::NewL(); |
|
159 CleanupStack::PushL(gprs); |
|
160 gprs->SetColumnBoolL(TPtrC(GPRS_HEADER_COMPRESSION),ETrue); |
|
161 |
|
162 ConnectExpectErrorL(KErrNotSupported,EPsdStartingConfiguration); |
|
163 |
|
164 // Close database object, forcing it to undo all changes that were made |
|
165 Log(_L("Reverting COMMDB changes")); |
|
166 gprs->UndoDatabaseChangesL(); |
|
167 CleanupStack::PopAndDestroy(gprs); |
|
168 |
|
169 return iTestStepResult; |
|
170 } |
|
171 |
|
172 enum TVerdict CPsdAgtTest1_9::doPsdAgtTestStepL( void ) |
|
173 { |
|
174 // This test is really only here for code coverage purposes |
|
175 // It's difficult to actually test for any particular result |
|
176 // aside from a successful connection / disconnection |
|
177 TRealAgtNotify agtNotify; |
|
178 agtNotify.SetTestCase(109); |
|
179 |
|
180 CNifAgentRefN1 *agent; |
|
181 |
|
182 // Construct a new Dummy Nifman Instance |
|
183 agent = CNifAgentRefN1::NewL(this,EFalse); |
|
184 CleanupStack::PushL(agent); |
|
185 |
|
186 agent->WaitForIncoming(); |
|
187 |
|
188 DelayL(8000000); |
|
189 CleanupStack::PopAndDestroy(agent); |
|
190 |
|
191 return iTestStepResult; |
|
192 } |
|
193 |
|
194 |
|
195 // Test case 1.10 |
|
196 enum TVerdict CPsdAgtTest1_10::doPsdAgtTestStepL( void ) |
|
197 { |
|
198 TRealAgtNotify agtNotify; |
|
199 agtNotify.SetTestCase(110); |
|
200 |
|
201 NormalConnectL(); |
|
202 |
|
203 // Close database object, forcing it to undo all changes that were made |
|
204 Log(_L("Reverting COMMDB changes")); |
|
205 |
|
206 return iTestStepResult; |
|
207 } |
|
208 |
|
209 |
|
210 // Test case 1.11 |
|
211 enum TVerdict CPsdAgtTest1_11::doPsdAgtTestStepL( void ) |
|
212 { |
|
213 TRealAgtNotify agtNotify; |
|
214 agtNotify.SetTestCase(111); |
|
215 |
|
216 NormalConnectL(); |
|
217 |
|
218 // Close database object, forcing it to undo all changes that were made |
|
219 Log(_L("Reverting COMMDB changes")); |
|
220 |
|
221 return iTestStepResult; |
|
222 } |
|
223 |
|
224 // Test case 1.12 |
|
225 enum TVerdict CPsdAgtTest1_12::doPsdAgtTestStepL( void ) |
|
226 { |
|
227 TRealAgtNotify agtNotify; |
|
228 agtNotify.SetTestCase(112); |
|
229 |
|
230 NormalConnectL(); |
|
231 |
|
232 // Close database object, forcing it to undo all changes that were made |
|
233 Log(_L("Reverting COMMDB changes")); |
|
234 |
|
235 return iTestStepResult; |
|
236 } |
|
237 |
|
238 // Test case 1.13 |
|
239 enum TVerdict CPsdAgtTest1_13::doPsdAgtTestStepL( void ) |
|
240 { |
|
241 TRealAgtNotify agtNotify; |
|
242 agtNotify.SetTestCase(113); |
|
243 |
|
244 NormalConnectL(); |
|
245 |
|
246 // Close database object, forcing it to undo all changes that were made |
|
247 Log(_L("Reverting COMMDB changes")); |
|
248 |
|
249 return iTestStepResult; |
|
250 } |
|
251 |
|
252 // Test case 1.14 |
|
253 enum TVerdict CPsdAgtTest1_14::doPsdAgtTestStepL( void ) |
|
254 { |
|
255 TRealAgtNotify agtNotify; |
|
256 agtNotify.SetTestCase(114); |
|
257 |
|
258 NormalConnectL(); |
|
259 |
|
260 // Close database object, forcing it to undo all changes that were made |
|
261 Log(_L("Reverting COMMDB changes")); |
|
262 |
|
263 return iTestStepResult; |
|
264 } |
|
265 |
|
266 // Test case 1.15 set GPRS use edge |
|
267 enum TVerdict CPsdAgtTest1_15::doPsdAgtTestStepL( void ) |
|
268 { |
|
269 TRealAgtNotify agtNotify; |
|
270 agtNotify.SetTestCase(115); |
|
271 SetGPRSModeL(agtNotify); |
|
272 |
|
273 Log(_L("COMMDB changing GPRS_USE_EDGE to TRUE")); |
|
274 CDbGPRSOutgoingTable *gprs = CDbGPRSOutgoingTable::NewL(); |
|
275 CleanupStack::PushL(gprs); |
|
276 gprs->SetColumnBoolL(TPtrC(GPRS_USE_EDGE),ETrue); |
|
277 |
|
278 NormalConnectL(); |
|
279 |
|
280 // Close database object, forcing it to undo all changes that were made |
|
281 Log(_L("Reverting COMMDB changes")); |
|
282 gprs->UndoDatabaseChangesL(); |
|
283 CleanupStack::PopAndDestroy(gprs); |
|
284 |
|
285 return iTestStepResult; |
|
286 } |
|
287 |
|
288 // Test case 1.16 set use edge |
|
289 enum TVerdict CPsdAgtTest1_16::doPsdAgtTestStepL( void ) |
|
290 { |
|
291 TRealAgtNotify agtNotify; |
|
292 agtNotify.SetTestCase(116); |
|
293 |
|
294 NormalConnectL(); |
|
295 |
|
296 // Close database object, forcing it to undo all changes that were made |
|
297 Log(_L("Reverting COMMDB changes")); |
|
298 |
|
299 return iTestStepResult; |
|
300 } |