24
|
1 |
// Copyright (c) 2008-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_smsinter.h"
|
|
17 |
#include "TE_smsinterserver.h"
|
|
18 |
|
|
19 |
|
|
20 |
_LIT(KServerName, "TE_SMSINTER");
|
|
21 |
|
|
22 |
|
|
23 |
/**
|
|
24 |
* @return - Instance of the test server
|
|
25 |
* Called inside the MainL() function to create and start the
|
|
26 |
* CTestServer derived server.
|
|
27 |
*/
|
|
28 |
CSmsInterTestServer* CSmsInterTestServer::NewL()
|
|
29 |
{
|
|
30 |
CSmsInterTestServer* server = new (ELeave) CSmsInterTestServer();
|
|
31 |
|
|
32 |
CleanupStack::PushL(server);
|
|
33 |
server->StartL(KServerName);
|
|
34 |
CleanupStack::Pop(server);
|
|
35 |
|
|
36 |
return server;
|
|
37 |
} // CSmsInterTestServer::NewL
|
|
38 |
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Much simpler, uses the new Rendezvous() call to sync with the client
|
|
42 |
*/
|
|
43 |
LOCAL_C void MainL()
|
|
44 |
{
|
|
45 |
CActiveScheduler* sched=NULL;
|
|
46 |
sched=new(ELeave) CActiveScheduler;
|
|
47 |
CActiveScheduler::Install(sched);
|
|
48 |
CSmsInterTestServer* server = NULL;
|
|
49 |
|
|
50 |
// Create the CTestServer derived server
|
|
51 |
TRAPD(err, server = CSmsInterTestServer::NewL());
|
|
52 |
if (err == KErrNone)
|
|
53 |
{
|
|
54 |
// Sync with the client and enter the active scheduler
|
|
55 |
RProcess::Rendezvous(KErrNone);
|
|
56 |
sched->Start();
|
|
57 |
}
|
|
58 |
delete server;
|
|
59 |
delete sched;
|
|
60 |
} // MainL
|
|
61 |
|
|
62 |
|
|
63 |
/**
|
|
64 |
* @return - Standard Epoc error code on exit
|
|
65 |
*/
|
|
66 |
GLDEF_C TInt E32Main()
|
|
67 |
{
|
|
68 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
69 |
if(cleanup == NULL)
|
|
70 |
{
|
|
71 |
return KErrNoMemory;
|
|
72 |
}
|
|
73 |
TRAPD(err, MainL());
|
|
74 |
delete cleanup;
|
|
75 |
|
|
76 |
return err;
|
|
77 |
} // E32Main
|
|
78 |
|
|
79 |
|
|
80 |
/**
|
|
81 |
* @return - A CTestStep derived instance
|
|
82 |
* Implementation of CTestServer pure virtual
|
|
83 |
*/
|
|
84 |
CTestStep* CSmsInterTestServer::CreateTestStep(const TDesC& aStepName)
|
|
85 |
{
|
|
86 |
CTestStep* testStep = NULL;
|
|
87 |
|
|
88 |
//
|
|
89 |
// Here the test step is created when it is needed. Note that this
|
|
90 |
// function is non-leaving so we cannot use new(ELeave). Therefore
|
|
91 |
// the new could return NULL, but that is not a problem as it implies
|
|
92 |
// the test step is missing and this will be marked in the log file.
|
|
93 |
//
|
|
94 |
if (aStepName == _L("SendRecvTextFormated7BitEMS"))
|
|
95 |
{
|
|
96 |
testStep = new CSmsSendRecvTextFormated7BitEMS;
|
|
97 |
}
|
|
98 |
else if (aStepName == _L("SendRecvTextFormated8BitEMS"))
|
|
99 |
{
|
|
100 |
testStep = new CSmsSendRecvTextFormated8BitEMS;
|
|
101 |
}
|
|
102 |
else if (aStepName == _L("SendRecvTextFormated16BitEMS"))
|
|
103 |
{
|
|
104 |
testStep = new CSmsSendRecvTextFormated16BitEMS;
|
|
105 |
}
|
|
106 |
else if (aStepName == _L("EnumerateReadWriteAndDeleteEMSOnSIM"))
|
|
107 |
{
|
|
108 |
testStep = new CSmsEnumerateReadWriteAndDeleteEMSOnSIM;
|
|
109 |
}
|
|
110 |
else if (aStepName == _L("SendRecvPreDefSoundEMS"))
|
|
111 |
{
|
|
112 |
testStep = new CSmsSendRecvPreDefSoundEMS;
|
|
113 |
}
|
|
114 |
else if (aStepName == _L("SendRecvUserDefSoundEMS"))
|
|
115 |
{
|
|
116 |
testStep = new CSmsSendRecvUserDefSoundEMS;
|
|
117 |
}
|
|
118 |
else if (aStepName == _L("EnumerateReadWriteAndDeleteEMSOnPhone"))
|
|
119 |
{
|
|
120 |
testStep = new CSmsEnumerateReadWriteAndDeleteEMSOnPhone;
|
|
121 |
}
|
|
122 |
else if (aStepName == _L("SendRecvPicturesEMS"))
|
|
123 |
{
|
|
124 |
testStep = new CSmsSendRecvPicturesEMS;
|
|
125 |
}
|
|
126 |
else if (aStepName == _L("SendRecvPreDefAnimation"))
|
|
127 |
{
|
|
128 |
testStep = new CSmsSendRecvPreDefAnimation;
|
|
129 |
}
|
|
130 |
else if (aStepName == _L("SendRecvUserDefAnimation"))
|
|
131 |
{
|
|
132 |
testStep = new CSmsSendRecvUserDefAnimation;
|
|
133 |
}
|
|
134 |
else if (aStepName == _L("SendRecvUserPromptEMS"))
|
|
135 |
{
|
|
136 |
testStep = new CSmsSendRecvUserPromptEMS;
|
|
137 |
}
|
|
138 |
else if (aStepName == _L("SendRecvObjectDistributionEMS"))
|
|
139 |
{
|
|
140 |
testStep = new CSmsSendRecvObjectDistributionEMS;
|
|
141 |
}
|
|
142 |
else if (aStepName == _L("SendRecvManyEMSObjects"))
|
|
143 |
{
|
|
144 |
testStep = new CSmsSendRecvManyEMSObjects;
|
|
145 |
}
|
|
146 |
else if (aStepName == _L("SendRecvEMSOn8BitPort"))
|
|
147 |
{
|
|
148 |
testStep = new CSmsSendRecvEMSOn8BitPort;
|
|
149 |
}
|
|
150 |
else if (aStepName == _L("SendRecvEMSOn16BitPort"))
|
|
151 |
{
|
|
152 |
testStep = new CSmsSendRecvEMSOn16BitPort;
|
|
153 |
}
|
|
154 |
else if (aStepName == _L("TestFormattingSegmentation"))
|
|
155 |
{
|
|
156 |
testStep = new CSmsTestFormattingSegmentation;
|
|
157 |
}
|
|
158 |
else if (aStepName == _L("TestNumberOfMessages"))
|
|
159 |
{
|
|
160 |
testStep = new CSmsTestNumberOfMessages;
|
|
161 |
}
|
|
162 |
else if (aStepName == _L("TestCreateSocket"))
|
|
163 |
{
|
|
164 |
testStep = new CSmsTestCreateSocket;
|
|
165 |
}
|
|
166 |
else if (aStepName == _L("PublicMethods"))
|
|
167 |
{
|
|
168 |
testStep = new CSmsPublicMethods;
|
|
169 |
}
|
|
170 |
else if (aStepName == _L("SendAndReceive7bitMsgs"))
|
|
171 |
{
|
|
172 |
testStep = new CSmsSendAndReceive7bitMsgs;
|
|
173 |
}
|
|
174 |
else if (aStepName == _L("SendAndReceive8bitMsgs"))
|
|
175 |
{
|
|
176 |
testStep = new CSmsSendAndReceive8bitMsgs;
|
|
177 |
}
|
|
178 |
else if (aStepName == _L("SendAndReceive16bitMsgs"))
|
|
179 |
{
|
|
180 |
testStep = new CSmsSendAndReceive16bitMsgs;
|
|
181 |
}
|
|
182 |
else if (aStepName == _L("SendAndReceiveConcatenatedMsgs"))
|
|
183 |
{
|
|
184 |
testStep = new CSmsSendAndReceiveConcatenatedMsgs;
|
|
185 |
}
|
|
186 |
else if (aStepName == _L("TestStringMatchingIncomingMsg"))
|
|
187 |
{
|
|
188 |
testStep = new CSmsTestStringMatchingIncomingMsg;
|
|
189 |
}
|
|
190 |
else if (aStepName == _L("SendAndReceiveDifferentIEIs"))
|
|
191 |
{
|
|
192 |
testStep = new CSmsSendAndReceiveDifferentIEIs;
|
|
193 |
}
|
|
194 |
else if (aStepName == _L("SendAndReceiveBinaryData"))
|
|
195 |
{
|
|
196 |
testStep = new CSmsSendAndReceiveBinaryData;
|
|
197 |
}
|
|
198 |
else if (aStepName == _L("TestOOM"))
|
|
199 |
{
|
|
200 |
testStep = new CSmsTestOOM;
|
|
201 |
}
|
|
202 |
else if (aStepName == _L("TestSendAndReceive1byteMsg"))
|
|
203 |
{
|
|
204 |
testStep = new CSmsTestSendAndReceive1byteMsg;
|
|
205 |
}
|
|
206 |
else if (aStepName == _L("TestSmsWapEmailNotification"))
|
|
207 |
{
|
|
208 |
testStep = new CSmsTestSmsWapEmailNotification;
|
|
209 |
}
|
|
210 |
else if (aStepName == _L("TestSendAndReceive159bytesMsg"))
|
|
211 |
{
|
|
212 |
testStep = new CSmsTestSendAndReceive159bytesMsg;
|
|
213 |
}
|
|
214 |
else if (aStepName == _L("TestSocketConnectTwice"))
|
|
215 |
{
|
|
216 |
testStep = new CSmsTestSocketConnectTwice;
|
|
217 |
}
|
|
218 |
else if (aStepName == _L("TestSocketBinding"))
|
|
219 |
{
|
|
220 |
testStep = new CSmsTestSocketBinding;
|
|
221 |
}
|
|
222 |
else if (aStepName == _L("TestEnumerateAndReceiveMessages"))
|
|
223 |
{
|
|
224 |
testStep = new CSmsTestEnumerateAndReceiveMessages;
|
|
225 |
}
|
|
226 |
else if (aStepName == _L("TestEnumerateAndDeleteMessages"))
|
|
227 |
{
|
|
228 |
testStep = new CSmsTestEnumerateAndDeleteMessages;
|
|
229 |
}
|
|
230 |
else if (aStepName == _L("EnumerateAndWriteAndDeleteMessages"))
|
|
231 |
{
|
|
232 |
testStep = new CSmsEnumerateAndWriteAndDeleteMessages;
|
|
233 |
}
|
|
234 |
else if (aStepName == _L("PDUSlotStoreWithEnumeration"))
|
|
235 |
{
|
|
236 |
testStep = new CSmsPDUSlotStoreWithEnumeration;
|
|
237 |
}
|
|
238 |
else if (aStepName == _L("DeleteMessagesWithoutEnumeration"))
|
|
239 |
{
|
|
240 |
testStep = new CSmsDeleteMessagesWithoutEnumeration;
|
|
241 |
}
|
|
242 |
else if (aStepName == _L("SmartMessaging"))
|
|
243 |
{
|
|
244 |
testStep = new CSmsSmartMessaging;
|
|
245 |
}
|
|
246 |
else if (aStepName == _L("RetrieveAndStoreSmsParams"))
|
|
247 |
{
|
|
248 |
testStep = new CSmsRetrieveAndStoreSmsParams;
|
|
249 |
}
|
|
250 |
else if (aStepName == _L("TestRetrieveAndStoreSmsParamsOOM"))
|
|
251 |
{
|
|
252 |
testStep = new CSmsTestRetrieveAndStoreSmsParamsOOM;
|
|
253 |
}
|
|
254 |
else if (aStepName == _L("SmsStoreMsgOfDifferentClasses"))
|
|
255 |
{
|
|
256 |
testStep = new CSmsSmsStoreMsgOfDifferentClasses;
|
|
257 |
}
|
|
258 |
else if (aStepName == _L("DuplicatePdusOnStore"))
|
|
259 |
{
|
|
260 |
testStep = new CSmsDuplicatePdusOnStore;
|
|
261 |
}
|
|
262 |
else if (aStepName == _L("TestMaxNumberOfPdusOnStore"))
|
|
263 |
{
|
|
264 |
testStep = new CSmsTestMaxNumberOfPdusOnStore;
|
|
265 |
}
|
|
266 |
else if (aStepName == _L("DeletingMessageInEmptyStore"))
|
|
267 |
{
|
|
268 |
testStep = new CSmsDeletingMessageInEmptyStore;
|
|
269 |
}
|
|
270 |
else if (aStepName == _L("ConcatenatedMessages"))
|
|
271 |
{
|
|
272 |
testStep = new CSmsConcatenatedMessages;
|
|
273 |
}
|
|
274 |
else if (aStepName == _L("OutOfMemoryWrite"))
|
|
275 |
{
|
|
276 |
testStep = new CSmsOutOfMemoryWrite;
|
|
277 |
}
|
|
278 |
else if (aStepName == _L("TestOutOfMemoryRead"))
|
|
279 |
{
|
|
280 |
testStep = new CSmsTestOutOfMemoryRead;
|
|
281 |
}
|
|
282 |
else if (aStepName == _L("OutOfMemoryDelete"))
|
|
283 |
{
|
|
284 |
testStep = new CSmsOutOfMemoryDelete;
|
|
285 |
}
|
|
286 |
else if (aStepName == _L("SendSMS2Port0000"))
|
|
287 |
{
|
|
288 |
testStep = new CSmsSendSMS2Port0000;
|
|
289 |
}
|
|
290 |
else if (aStepName == _L("TestReceiveLongClass2"))
|
|
291 |
{
|
|
292 |
testStep = new CSmsTestReceiveLongClass2;
|
|
293 |
}
|
|
294 |
else if (aStepName == _L("TestSendAndReceiveConcatenated1"))
|
|
295 |
{
|
|
296 |
testStep = new CSmsTestSendAndReceiveConcatenated1;
|
|
297 |
}
|
|
298 |
else if (aStepName == _L("TestSendAndReceiveConcatenated2"))
|
|
299 |
{
|
|
300 |
testStep = new CSmsTestSendAndReceiveConcatenated2;
|
|
301 |
}
|
|
302 |
else if (aStepName == _L("TestBindingToApplicationPort"))
|
|
303 |
{
|
|
304 |
testStep = new CSmsTestBindingToApplicationPort;
|
|
305 |
}
|
|
306 |
else if (aStepName == _L("TestSendAndReceiveAndDeleteClass2Msgs"))
|
|
307 |
{
|
|
308 |
testStep = new CSmsTestSendAndReceiveAndDeleteClass2Msgs;
|
|
309 |
}
|
|
310 |
else if (aStepName == _L("PublishandSubscribeTest"))
|
|
311 |
{
|
|
312 |
testStep = new CSmsPublishandSubscribeTest;
|
|
313 |
}
|
|
314 |
else if (aStepName == _L("TestSendingReceivingViaAppPortPublishAndSubscribe"))
|
|
315 |
{
|
|
316 |
testStep = new CSmsTestSendingReceivingViaAppPortPublishAndSubscribe;
|
|
317 |
}
|
|
318 |
|
|
319 |
//
|
|
320 |
// Set the test step name here to save code!!!
|
|
321 |
//
|
|
322 |
if (testStep != NULL)
|
|
323 |
{
|
|
324 |
testStep->SetTestStepName(aStepName);
|
|
325 |
}
|
|
326 |
|
|
327 |
return testStep;
|
|
328 |
} // CSmsInterTestServer::CreateTestStep
|