24
|
1 |
// Copyright (c) 2005-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 |
//
|
|
15 |
|
|
16 |
#include "Te_EtelPacketTestServer.h"
|
|
17 |
|
|
18 |
#include "testdef.h"
|
|
19 |
#include "Te_EtelPacketTest1_1.h"
|
|
20 |
#include "Te_EtelPacketTest1_2.h"
|
|
21 |
#include "Te_EtelPacketTest1_3.h"
|
|
22 |
#include "Te_EtelPacketTest3g_1.h"
|
|
23 |
#include "Te_EtelPacketTest3g_2.h"
|
|
24 |
#include "Te_EtelPacketTest3g_3.h"
|
|
25 |
#include "Te_EtelPacketTest1_1Extended.h"
|
|
26 |
#include "Te_EtelPacketTestMultipleClients.h"
|
|
27 |
#include "Te_EtelPacketTest_Rel99.h"
|
|
28 |
#include "Te_EtelPacketTestAuthenticationAndDNS.h"
|
|
29 |
#include "Te_EtelPacketTestPCO_IE.h"
|
|
30 |
#include "Te_EtelPacketTest_Rel5.h"
|
|
31 |
#include "Te_EtelPacketMbmsSupport.h"
|
|
32 |
#include "Te_EtelPacketMbmsService.h"
|
|
33 |
#include "Te_EtelPacketMbmsContext.h"
|
|
34 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
35 |
#include "Te_EtelPacketTestContextConnectionInfo.h"
|
|
36 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
37 |
#include "Te_EtelPacketTestSteps.h"
|
|
38 |
#include <etel.h>
|
|
39 |
|
|
40 |
_LIT(KServerName,"Te_EtelPacket");
|
|
41 |
|
|
42 |
CEtelPacketTestServer* CEtelPacketTestServer::NewL()
|
|
43 |
/**
|
|
44 |
* @return - Instance of the test server
|
|
45 |
* Same code for Secure and non-secure variants
|
|
46 |
* Called inside the MainL() function to create and start the
|
|
47 |
* CTestServer derived server.
|
|
48 |
*/
|
|
49 |
{
|
|
50 |
CEtelPacketTestServer * testServer = new (ELeave) CEtelPacketTestServer();
|
|
51 |
CleanupStack::PushL(testServer);
|
|
52 |
|
|
53 |
testServer->ConstructL(KServerName);
|
|
54 |
CleanupStack::Pop(testServer);
|
|
55 |
return testServer;
|
|
56 |
}
|
|
57 |
|
|
58 |
CEtelPacketTestServer::~CEtelPacketTestServer()
|
|
59 |
{
|
|
60 |
iContext.Close();
|
|
61 |
iPhone.Close();
|
|
62 |
iPacketService.Close();
|
|
63 |
iTelServer.Close();
|
|
64 |
}
|
|
65 |
|
|
66 |
LOCAL_C void MainL()
|
|
67 |
/**
|
|
68 |
* Secure variant
|
|
69 |
* Much simpler, uses the new Rendezvous() call to sync with the client
|
|
70 |
*/
|
|
71 |
{
|
|
72 |
TInt result = StartC32();
|
|
73 |
if (result != KErrNone && result != KErrAlreadyExists)
|
|
74 |
{
|
|
75 |
User::Leave(result);
|
|
76 |
}
|
|
77 |
|
|
78 |
CActiveScheduler* sched=NULL;
|
|
79 |
sched=new(ELeave) CActiveScheduler;
|
|
80 |
CActiveScheduler::Install(sched);
|
|
81 |
CEtelPacketTestServer* testServer = NULL;
|
|
82 |
|
|
83 |
// Create the CTestServer derived server
|
|
84 |
TRAPD(err,testServer = CEtelPacketTestServer::NewL());
|
|
85 |
if(!err)
|
|
86 |
{
|
|
87 |
// Sync with the client and enter the active scheduler
|
|
88 |
RProcess::Rendezvous(KErrNone);
|
|
89 |
sched->Start();
|
|
90 |
}
|
|
91 |
delete testServer;
|
|
92 |
delete sched;
|
|
93 |
}
|
|
94 |
|
|
95 |
GLDEF_C TInt E32Main()
|
|
96 |
/**
|
|
97 |
* @return - Standard Epoc error code on process exit
|
|
98 |
* Secure variant only
|
|
99 |
* Process entry point. Called by client using RProcess API
|
|
100 |
*/
|
|
101 |
{
|
|
102 |
__UHEAP_MARK;
|
|
103 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
104 |
if(cleanup == NULL)
|
|
105 |
{
|
|
106 |
return KErrNoMemory;
|
|
107 |
}
|
|
108 |
TRAPD(err,MainL());
|
|
109 |
delete cleanup;
|
|
110 |
__UHEAP_MARKEND;
|
|
111 |
return err;
|
|
112 |
}
|
|
113 |
|
|
114 |
CTestStep* CEtelPacketTestServer::CreateTestStep(const TDesC& aStepName)
|
|
115 |
/**
|
|
116 |
* @return - A CTestStep derived instance
|
|
117 |
* Secure and non-secure variants
|
|
118 |
* Implementation of CTestServer pure virtual
|
|
119 |
*/
|
|
120 |
{
|
|
121 |
CTestStep* testStep = NULL;
|
|
122 |
|
|
123 |
if(aStepName == _L("Authentication_And_DNS_Server_Names"))
|
|
124 |
{
|
|
125 |
testStep = new CEtelPacketTestAuthenticationAndDNS;
|
|
126 |
}
|
|
127 |
else if(aStepName == _L("Release_99_Service"))
|
|
128 |
{
|
|
129 |
testStep = new CEtelPacketTest_Rel99;
|
|
130 |
}
|
|
131 |
else if(aStepName == _L("Service"))
|
|
132 |
{
|
|
133 |
testStep = new CEtelPacketTest1_1;
|
|
134 |
}
|
|
135 |
else if(aStepName == _L("Context"))
|
|
136 |
{
|
|
137 |
testStep = new CEtelPacketTest1_2;
|
|
138 |
}
|
|
139 |
else if(aStepName == _L("QoS"))
|
|
140 |
{
|
|
141 |
testStep = new CEtelPacketTest1_3;
|
|
142 |
}
|
|
143 |
else if(aStepName == _L("3GPacketService"))
|
|
144 |
{
|
|
145 |
testStep = new CEtelPacketTest3G_1;
|
|
146 |
}
|
|
147 |
else if(aStepName == _L("3GPacketContext"))
|
|
148 |
{
|
|
149 |
testStep = new CEtelPacketTest3G_2;
|
|
150 |
}
|
|
151 |
else if(aStepName == _L("3GPacketQoS"))
|
|
152 |
{
|
|
153 |
testStep = new CEtelPacketTest3G_3;
|
|
154 |
}
|
|
155 |
else if(aStepName == _L("Extended_Service"))
|
|
156 |
{
|
|
157 |
testStep = new CEtelPacketTest1_1Extended;
|
|
158 |
}
|
|
159 |
else if(aStepName == _L("Multiple_Clients"))
|
|
160 |
{
|
|
161 |
testStep = new CEtelPacketTestMultipleClients;
|
|
162 |
}
|
|
163 |
else if(aStepName == _L("PCO_IE"))
|
|
164 |
{
|
|
165 |
testStep = new CEtelPacketTestPCO_IE;
|
|
166 |
}
|
|
167 |
else if(aStepName == _L("Release_5_Service"))
|
|
168 |
{
|
|
169 |
testStep = new CEtelPacketTest_Rel5;
|
|
170 |
}
|
|
171 |
//Defect Fix Test Case
|
|
172 |
else if(aStepName == KConnectEtelLoadTSY)
|
|
173 |
{
|
|
174 |
testStep = new CTestConnectEtelLoadTSY(iTelServer);
|
|
175 |
}
|
|
176 |
else if(aStepName == KOpenPhone)
|
|
177 |
{
|
|
178 |
testStep = new CTestOpenPhone(iTelServer, iPhone);
|
|
179 |
}
|
|
180 |
else if(aStepName == KClosePhone)
|
|
181 |
{
|
|
182 |
testStep = new CTestClosePhone(iPhone);
|
|
183 |
}
|
|
184 |
else if(aStepName == KDisconnectEtelUnloadTSY)
|
|
185 |
{
|
|
186 |
testStep = new CTestDisconnectEtelUnloadTSY(iTelServer);
|
|
187 |
}
|
|
188 |
else if(aStepName == KOpenPacketService)
|
|
189 |
{
|
|
190 |
testStep = new CTestOpenPacketService(iPacketService, iPhone);
|
|
191 |
}
|
|
192 |
else if(aStepName == KClosePacketService)
|
|
193 |
{
|
|
194 |
testStep = new CTestClosePacketService(iPacketService);
|
|
195 |
}
|
|
196 |
else if(aStepName == KOpenContext)
|
|
197 |
{
|
|
198 |
testStep = new CTestOpenContext(iTelServer, iPacketService, iContext, iContextName);
|
|
199 |
}
|
|
200 |
else if(aStepName == KCloseContext)
|
|
201 |
{
|
|
202 |
testStep = new CTestCloseContext(iContext);
|
|
203 |
}
|
|
204 |
else if(aStepName == KMbmsSupport)
|
|
205 |
{
|
|
206 |
testStep = new CTestMbmsSupport;
|
|
207 |
}
|
|
208 |
else if(aStepName == KMbmsService)
|
|
209 |
{
|
|
210 |
testStep = new CTestMbmsService;
|
|
211 |
}
|
|
212 |
else if(aStepName == KMbmsContext)
|
|
213 |
{
|
|
214 |
testStep = new CTestMbmsContext;
|
|
215 |
}
|
|
216 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
217 |
else if(aStepName == KContextConnectionInfo)
|
|
218 |
{
|
|
219 |
testStep = new CEtelPacketTestContextConnectionInfo;
|
|
220 |
}
|
|
221 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
222 |
// Set the test step name here to save code!!!
|
|
223 |
//
|
|
224 |
if (testStep != NULL)
|
|
225 |
{
|
|
226 |
testStep->SetTestStepName(aStepName);
|
|
227 |
}
|
|
228 |
|
|
229 |
return testStep;
|
|
230 |
}
|