|
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 6.1 - 6.12 |
|
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 "PsdAgtTestSMInitialisation.h" |
|
39 |
|
40 |
|
41 // Test case 6.1 |
|
42 enum TVerdict CPsdAgtTest6_1::doPsdAgtTestStepL( void ) |
|
43 { |
|
44 TRealAgtNotify agtNotify; |
|
45 agtNotify.SetTestCase(601); |
|
46 // We expect DummyEtel to simulate an error during connection |
|
47 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
48 |
|
49 return iTestStepResult; |
|
50 } |
|
51 |
|
52 |
|
53 // Test case 6.2 |
|
54 enum TVerdict CPsdAgtTest6_2::doPsdAgtTestStepL( void ) |
|
55 { |
|
56 TRealAgtNotify agtNotify; |
|
57 agtNotify.SetTestCase(602); |
|
58 // We expect DummyEtel to simulate an error during connection |
|
59 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
60 |
|
61 return iTestStepResult; |
|
62 } |
|
63 |
|
64 |
|
65 // Test case 6.3 |
|
66 enum TVerdict CPsdAgtTest6_3::doPsdAgtTestStepL( void ) |
|
67 { |
|
68 TRealAgtNotify agtNotify; |
|
69 agtNotify.SetTestCase(603); |
|
70 // We expect DummyEtel to simulate an error during connection |
|
71 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
72 |
|
73 return iTestStepResult; |
|
74 } |
|
75 |
|
76 |
|
77 // Test case 6.4 |
|
78 enum TVerdict CPsdAgtTest6_4::doPsdAgtTestStepL( void ) |
|
79 { |
|
80 TRealAgtNotify agtNotify; |
|
81 agtNotify.SetTestCase(604); |
|
82 // We expect DummyEtel to simulate an error during connection |
|
83 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
84 |
|
85 return iTestStepResult; |
|
86 } |
|
87 |
|
88 // Test case 6.5 |
|
89 enum TVerdict CPsdAgtTest6_5::doPsdAgtTestStepL( void ) |
|
90 { |
|
91 TRealAgtNotify agtNotify; |
|
92 agtNotify.SetTestCase(605); |
|
93 // We expect DummyEtel to simulate an error during connection |
|
94 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
95 |
|
96 return iTestStepResult; |
|
97 } |
|
98 |
|
99 // Test case 6.6 |
|
100 enum TVerdict CPsdAgtTest6_6::doPsdAgtTestStepL( void ) |
|
101 { |
|
102 TRealAgtNotify agtNotify; |
|
103 agtNotify.SetTestCase(606); |
|
104 // We expect DummyEtel to simulate an error during connection |
|
105 ConnectExpectErrorL(KErrNotFound, EPsdStartingConfiguration); |
|
106 |
|
107 return iTestStepResult; |
|
108 } |
|
109 |
|
110 // Test case 6.7 |
|
111 enum TVerdict CPsdAgtTest6_7::doPsdAgtTestStepL( void ) |
|
112 { |
|
113 TRealAgtNotify agtNotify; |
|
114 agtNotify.SetTestCase(607); |
|
115 // We expect DummyEtel to simulate an error during connection |
|
116 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
117 |
|
118 return iTestStepResult; |
|
119 } |
|
120 |
|
121 // Test case 6.8 |
|
122 enum TVerdict CPsdAgtTest6_8::doPsdAgtTestStepL( void ) |
|
123 { |
|
124 TRealAgtNotify agtNotify; |
|
125 agtNotify.SetTestCase(608); |
|
126 // We expect DummyEtel to simulate an error during connection |
|
127 ConnectExpectErrorL(KErrNotFound, EPsdStartingConfiguration); |
|
128 |
|
129 return iTestStepResult; |
|
130 } |
|
131 |
|
132 // Test case 6.9 |
|
133 enum TVerdict CPsdAgtTest6_9::doPsdAgtTestStepL( void ) |
|
134 { |
|
135 _LIT(KTsyName,"NAME.TSY"); |
|
136 |
|
137 TRealAgtNotify agtNotify; |
|
138 agtNotify.SetTestCase(609); |
|
139 Log(_L("COMMDB changing MODEM_TSY_NAME to NAME.TSY")); |
|
140 CDbModemTable *modem = CDbModemTable::NewL(); |
|
141 CleanupStack::PushL(modem); |
|
142 modem->SetColumnTextL(TPtrC(MODEM_TSY_NAME),KTsyName); |
|
143 |
|
144 // We expect DummyEtel to simulate an error during connection |
|
145 ConnectExpectErrorL(KErrNotFound, KStartingSelection); |
|
146 |
|
147 Log(_L("Reverting COMMDB changes")); |
|
148 modem->UndoDatabaseChangesL(); |
|
149 CleanupStack::PopAndDestroy(modem); |
|
150 |
|
151 return iTestStepResult; |
|
152 } |
|
153 |
|
154 // Test case 6.10 |
|
155 enum TVerdict CPsdAgtTest6_10::doPsdAgtTestStepL( void ) |
|
156 { |
|
157 TRealAgtNotify agtNotify; |
|
158 agtNotify.SetTestCase(610); |
|
159 // We expect the connection attempt to fail |
|
160 ConnectExpectErrorL(KErrGeneral, EPsdStartingConfiguration); |
|
161 |
|
162 return iTestStepResult; |
|
163 } |
|
164 |
|
165 |
|
166 // Test case 6.11 |
|
167 enum TVerdict CPsdAgtTest6_11::doPsdAgtTestStepL( void ) |
|
168 { |
|
169 TRealAgtNotify agtNotify; |
|
170 agtNotify.SetTestCase(611); |
|
171 // We expect the connection attempt to be successful |
|
172 NormalConnectL(); |
|
173 |
|
174 return iTestStepResult; |
|
175 } |
|
176 |
|
177 |
|
178 // Test case 6.12 |
|
179 enum TVerdict CPsdAgtTest6_12::doPsdAgtTestStepL( void ) |
|
180 { |
|
181 TRealAgtNotify agtNotify; |
|
182 agtNotify.SetTestCase(612); |
|
183 // We expect the connection attempt to be successful |
|
184 NormalConnectL(); |
|
185 |
|
186 return iTestStepResult; |
|
187 } |
|
188 |
|
189 |