|
1 /* |
|
2 * Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __UT_CSTUNCLIENTIMPLEMENTATION_H__ |
|
22 #define __UT_CSTUNCLIENTIMPLEMENTATION_H__ |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/ceunittestsuiteclass.h> |
|
26 #include <digia/eunit/EUnitDecorators.h> |
|
27 |
|
28 |
|
29 // INTERNAL INCLUDES |
|
30 #include "cstunclientimplementation.h" |
|
31 #include "cncmconnectionmultiplexer.h" |
|
32 #include "mncmconnectionmultiplexerobserver.h" |
|
33 #include "natfwstunclientobserver.h" |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CSTUNBinding; |
|
37 |
|
38 // CLASS DEFINITION |
|
39 /** |
|
40 * TODO Auto-generated test suite |
|
41 * |
|
42 */ |
|
43 NONSHARABLE_CLASS( ut_cstunclientimplementation ) |
|
44 : public CEUnitTestSuiteClass, public MSTUNClientObserver, |
|
45 public MNcmConnectionMultiplexerObserver |
|
46 { |
|
47 public: // Constructors and destructors |
|
48 |
|
49 /** |
|
50 * Two phase construction |
|
51 */ |
|
52 static ut_cstunclientimplementation* NewL(); |
|
53 static ut_cstunclientimplementation* NewLC(); |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 ~ut_cstunclientimplementation(); |
|
58 |
|
59 public: // From mstunclientobserver |
|
60 |
|
61 void STUNClientInitCompleted( const CSTUNClient& aClient, |
|
62 TInt aCompletionCode ); |
|
63 |
|
64 |
|
65 void STUNBindingEventOccurredL( TSTUNBindingEvent aEvent, |
|
66 const CBinding& aBinding ); |
|
67 |
|
68 |
|
69 void STUNBindingErrorOccurred( const CBinding& aBinding, |
|
70 TInt aError ); |
|
71 |
|
72 public: // From MNcmConnectionMultiplexerObserver |
|
73 |
|
74 void Notify( TUint aSessionId, TUint aStreamId, TNotifyType aType, TInt aError ); |
|
75 |
|
76 private: // Constructors and destructors |
|
77 |
|
78 ut_cstunclientimplementation(); |
|
79 void ConstructL(); |
|
80 |
|
81 private: // New methods |
|
82 |
|
83 void SetupL(); |
|
84 |
|
85 void Teardown(); |
|
86 |
|
87 void T_CSTUNClientImplementation__CSTUNClientImplementationL(); |
|
88 |
|
89 void T_CSTUNClientImplementation_TimerExpiredLL(); |
|
90 |
|
91 void T_CSTUNClientImplementation_LeaveFromTimerExpiredL(); |
|
92 |
|
93 void T_CSTUNClientImplementation_CompletedLL(); |
|
94 |
|
95 void T_CSTUNClientImplementation_ErrorOccuredL(); |
|
96 |
|
97 void T_CSTUNClientImplementation_IcmpErrorL(); |
|
98 |
|
99 void T_CSTUNClientImplementation_SharedSecretObtainedLL(); |
|
100 |
|
101 void T_CSTUNClientImplementation_SharedSecretErrorLL(); |
|
102 |
|
103 void T_CSTUNClientImplementation_STUNClientL(); |
|
104 |
|
105 void T_CSTUNClientImplementation_TimerProviderL(); |
|
106 |
|
107 void T_CSTUNClientImplementation_RetransmitIntervalL(); |
|
108 |
|
109 void T_CSTUNClientImplementation_TransportProtocolL(); |
|
110 |
|
111 void T_CSTUNClientImplementation_AddressResolvedLL(); |
|
112 |
|
113 void T_CSTUNClientImplementation_ObtainSharedSecretLL(); |
|
114 |
|
115 void T_CSTUNClientImplementation_SharedSecretRejectedLL(); |
|
116 |
|
117 void T_CSTUNClientImplementation_ObtainServerAddressL(); |
|
118 |
|
119 void T_CSTUNClientImplementation_ObtainTransactionIDLL(); |
|
120 |
|
121 void T_CSTUNClientImplementation_AttachBindingLL(); |
|
122 |
|
123 void T_CSTUNClientImplementation_DetachBindingL(); |
|
124 |
|
125 void T_CSTUNClientImplementation_BindingErrorLL(); |
|
126 |
|
127 void T_CSTUNClientImplementation_BindingEventOccurredL(); |
|
128 |
|
129 void T_CSTUNClientImplementation_RenewSharedSecretLL(); |
|
130 |
|
131 void T_CSTUNClientImplementation_UsernameForIndicationL(); |
|
132 |
|
133 void T_CSTUNClientImplementation_PasswordForIndicationL(); |
|
134 |
|
135 void T_CSTUNClientImplementation_IsInitializedL(); |
|
136 |
|
137 void T_CSTUNClientImplementation_STUNServerAddrLL(); |
|
138 |
|
139 void T_CSTUNClientImplementation_SetCredentialsLL(); |
|
140 |
|
141 void T_CSTUNClientImplementation_SharedSecretObtainedL(); |
|
142 |
|
143 void T_CSTUNClientImplementation_HasPresetCredentialsL(); |
|
144 |
|
145 void T_CSTUNClientImplementation_ChangeStateL(); |
|
146 |
|
147 void T_CSTUNClientImplementation_TerminateL(); |
|
148 |
|
149 void T_CSTUNClientImplementation_TlsResolvedLL(); |
|
150 |
|
151 void T_CSTUNClientImplementation_TcpResolvedLL(); |
|
152 |
|
153 void T_CSTUNClientImplementation_FreeResolverResourcesL(); |
|
154 |
|
155 void T_CSTUNClientImplementation_GetSharedSecretFromServerLL(); |
|
156 |
|
157 void T_CSTUNClientImplementation_PassSharedSecretToBindingLL(); |
|
158 |
|
159 void T_CSTUNClientImplementation_InformWaitingBindingsLL(); |
|
160 |
|
161 void T_CSTUNClientImplementation_HandleSharedSecretErrorLL(); |
|
162 |
|
163 void T_CSTUNClientImplementation_DoesSharedSecretMatchL(); |
|
164 |
|
165 void T_CSTUNClientImplementation_PassInitCompletedLL(); |
|
166 |
|
167 void T_CSTUNClientImplementation_PassCredentialsRejectedLL(); |
|
168 |
|
169 void T_CSTUNClientImplementation_StartSharedSecretTimerL(); |
|
170 |
|
171 void T_CSTUNClientImplementation_MultiplexerInstanceL(); |
|
172 |
|
173 void T_CSTUNClientImplementation___DbgTestInvariantL(); |
|
174 |
|
175 void T_CSTUNClientImplementation_RemoveAddressL(); |
|
176 |
|
177 |
|
178 private: // Data |
|
179 |
|
180 CSTUNClientImplementation* iCSTUNClientImplementation; |
|
181 EUNIT_DECLARE_TEST_TABLE; |
|
182 |
|
183 RSocketServ iSocketServ; |
|
184 RConnection iConnection; |
|
185 CDeltaTimer* iDeltatimer; |
|
186 CSTUNClient* iStunclient; |
|
187 TUint iStreamId; |
|
188 TUint iSubstreamId; |
|
189 HBufC8* iServeraddress; |
|
190 HBufC8* iResponse; |
|
191 HBufC8* iRespDataIndication; |
|
192 CNcmConnectionMultiplexer* iMux; |
|
193 RSocket iSocket; |
|
194 TRequestStatus iStatus; |
|
195 CSTUNBinding* iBinding; |
|
196 CSTUNClientRenewSharedSecret* iRenewSharedSecret; |
|
197 CSTUNClientReady* iReady; |
|
198 CSTUNClientGetSharedSecret *iGetSharedSecret; |
|
199 CSTUNClientResolvingUDP* iResolvingUDP; |
|
200 }; |
|
201 |
|
202 #endif // __UT_CSTUNCLIENTIMPLEMENTATION_H__ |
|
203 |
|
204 // End of file |