|
1 // Copyright (c) 1998-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 // Name of test harness: T_IMCM02E1 |
|
15 // Component: IMCM |
|
16 // Owner: KP |
|
17 // Brief description of test harness: |
|
18 // Tests CImEmailOperation - creates plaintext/HTML Receipt message |
|
19 // with/without attachments; Also tests adding VCard and signature from the |
|
20 // SMTP settings. |
|
21 // Detailed description of test harness: |
|
22 // As above |
|
23 // Input files required to run test harness: |
|
24 // \MSG\IMCMTSRC\contacts.cdb <DRIVE>:\system\data\contacts.cdb |
|
25 // \MSG\IMCMTSRC\T_IMCM02E1_Entry_Structure.txt <DRIVE>:\msgtest\IMCM\T_IMCM02E1_Entry_Structure.txt |
|
26 // \MSG\IMCMTSRC\rfc82201.txt <DRIVE>:\msgtest\IMCM\rfc82201.txt |
|
27 // \MSG\IMCMTSRC\rfc82202.txt <DRIVE>:\msgtest\IMCM\rfc82202.txt |
|
28 // \MSG\IMCMTSRC\rfc82203.txt <DRIVE>:\msgtest\IMCM\rfc82203.txt |
|
29 // \MSG\IMCMTSRC\rfc82204.txt <DRIVE>:\msgtest\IMCM\rfc82204.txt |
|
30 // \MSG\IMCMTSRC\rfc82205.txt <DRIVE>:\msgtest\IMCM\rfc82205.txt |
|
31 // \MSG\IMCMTSRC\rfc82206.txt <DRIVE>:\msgtest\IMCM\rfc82206.txt |
|
32 // Intermediate files produced while running test harness: |
|
33 // <DRIVE>:\msglogs\T_IMCM02E1\Entry_Structure.txt |
|
34 // Output files produced by running test harness: |
|
35 // <DRIVE>:\msglogs\T_IMCM02E1.<PLATFORM>.<VARIANT>.LOG.txt |
|
36 // Description of how to build test harness: |
|
37 // cd \msg\imcm\ |
|
38 // bldmake bldfiles |
|
39 // abld test build |
|
40 // Description of how to run test harness: |
|
41 // The following instructions are the same for all platforms: |
|
42 // 1. Build T_DB test harness from COMMDB component: |
|
43 // cd \commdb\group |
|
44 // bldmake bldfiles |
|
45 // abld test build t_db |
|
46 // 2. Build the test utilities: |
|
47 // cd \msg\testutils\group\ |
|
48 // bldmake bldfiles |
|
49 // abld build |
|
50 // WINS running instructions: |
|
51 // 1. \epoc32\release\wins\<VARIANT>\T_IMCM02E1.exe can be used at the command prompt |
|
52 // or executable can be run from Windows Explorer. |
|
53 // All other platform running instructions: |
|
54 // 1. Copy \epoc32\release\<PLATFORM>\<VARIANT>\T_IMCM02E1.exe onto the other platform |
|
55 // 2. Copy \epoc32\release\<PLATFORM>\<VARIANT>\MSVTESTUTILS.DLL into |
|
56 // <DRIVE>:\system\libs on the other platform |
|
57 // 3. Copy \epoc32\release\<PLATFORM>\<VARIANT>\EMAILTESTUTILS.DLL into |
|
58 // <DRIVE>:\system\libs on the other platform |
|
59 // 4. Run T_IMCM02E1.exe on the other platform |
|
60 // |
|
61 // |
|
62 |
|
63 #include "emailtestutils.h" |
|
64 |
|
65 #include <miutmsg.h> |
|
66 |
|
67 |
|
68 #include <apfrec.h> |
|
69 #include <apgicnfl.h> |
|
70 #include <ecom/ecom.h> |
|
71 #include <cemailaccounts.h> |
|
72 #include <mmsvattachmentmanager.h> |
|
73 |
|
74 #include <cntdb.h> |
|
75 |
|
76 // local variables etc // |
|
77 |
|
78 #define KPeriod 10000 // period of timer |
|
79 |
|
80 _LIT(KImcm02Test, "T_IMCM02e1 - CImEmailOperation Tests"); |
|
81 RTest test(KImcm02Test); |
|
82 |
|
83 LOCAL_D CTrapCleanup* theCleanup; |
|
84 |
|
85 LOCAL_D TMsvId pop3Service; |
|
86 LOCAL_D TMsvId smtpService; |
|
87 LOCAL_D CEmailTestUtils* testUtils; |
|
88 LOCAL_D CMsvEntrySelection* messageSelection; |
|
89 LOCAL_D TInt testNo = 1; |
|
90 LOCAL_D TBool testFailed=EFalse; |
|
91 |
|
92 #define KComponent _L("IMCM") |
|
93 #define KTestMessageDir _L("") |
|
94 #define KOkFileNameEntryStructure _L("T_IMCM02e1_Entry_Structure.txt") |
|
95 |
|
96 |
|
97 LOCAL_C void InitL() |
|
98 { |
|
99 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler; |
|
100 CActiveScheduler::Install(scheduler); |
|
101 CleanupStack::PushL(scheduler); |
|
102 |
|
103 testUtils = CEmailTestUtils::NewLC(test); |
|
104 testUtils->CreateAllTestDirectories(); |
|
105 CContactDatabase* contacts(NULL); |
|
106 TRAPD(err, contacts = CContactDatabase::OpenL()); |
|
107 delete contacts; |
|
108 if (err==KErrNotFound) |
|
109 { |
|
110 testUtils->WriteComment(_L("contacts file is missing from system data")); |
|
111 testFailed=ETrue; |
|
112 return; |
|
113 } |
|
114 testUtils->FileSession().SetSessionPath(_L("C:\\")); |
|
115 testUtils->ClearEmailAccountsL(); |
|
116 testUtils->CleanMessageFolderL(); |
|
117 testUtils->GoServerSideL(); |
|
118 |
|
119 testUtils->WriteComment(_L("CImEmailOperation Tests")); |
|
120 } |
|
121 |
|
122 LOCAL_C void Closedown() |
|
123 { |
|
124 CleanupStack::PopAndDestroy(2); //testUtils, scheduler |
|
125 User::After(5000000); |
|
126 } |
|
127 |
|
128 |
|
129 LOCAL_C void CreateReceiptL(TMsvId aMessageId, TMsvPartList aPartList, TMsvEmailTypeList aMsvEmailTypeList, TInt aTestNo) |
|
130 { |
|
131 testUtils->TestStart(aTestNo); |
|
132 CTestActive* testActive = new (ELeave) CTestActive(); |
|
133 CleanupStack::PushL(testActive); |
|
134 |
|
135 CImEmailOperation* emailOperation = CImEmailOperation::CreateReceiptL(testActive->iStatus, *(testUtils->iMsvSession), aMessageId, KMsvGlobalOutBoxIndexEntryId, aPartList, aMsvEmailTypeList, KUidMsgTypeSMTP); |
|
136 CleanupStack::PushL(emailOperation); |
|
137 |
|
138 testActive->StartL(); |
|
139 CActiveScheduler::Start(); |
|
140 testUtils->TestFinish(aTestNo,testActive->iStatus.Int()); |
|
141 CleanupStack::PopAndDestroy(2); // testActive, emailOperation |
|
142 } |
|
143 |
|
144 LOCAL_C void SetAddVCardToEmailL(TBool addVCard, TMsvId serviceId) |
|
145 { |
|
146 CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings; |
|
147 CleanupStack::PushL(smtpSettings); |
|
148 |
|
149 CEmailAccounts* accounts = CEmailAccounts::NewLC(); |
|
150 TSmtpAccount smtpAccount; |
|
151 accounts->GetSmtpAccountL(serviceId, smtpAccount); |
|
152 accounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings); |
|
153 |
|
154 smtpSettings->SetAddVCardToEmail(addVCard); |
|
155 |
|
156 accounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings); |
|
157 |
|
158 CleanupStack::PopAndDestroy(2); // smtpSettings, accounts |
|
159 } |
|
160 |
|
161 LOCAL_C void CreateSignatureL(TMsvId serviceId) |
|
162 { |
|
163 testUtils->iMsvEntry->SetEntryL(serviceId); |
|
164 CParaFormatLayer* paraFormatLayer=CParaFormatLayer::NewL(); |
|
165 CleanupStack::PushL(paraFormatLayer); |
|
166 |
|
167 CCharFormatLayer* charFormatLayer=CCharFormatLayer::NewL(); |
|
168 CleanupStack::PushL(charFormatLayer); |
|
169 |
|
170 CRichText* signature=CRichText::NewL(paraFormatLayer, charFormatLayer, CEditableText::EFlatStorage, 256); |
|
171 CleanupStack::PushL(signature); |
|
172 |
|
173 TBuf<100> bodyContents = _L("(Signature:) Symbian Ltd."); |
|
174 signature->InsertL(0, bodyContents); |
|
175 |
|
176 CMsvStore* msvStore = testUtils->iMsvEntry->EditStoreL(); |
|
177 CleanupStack::PushL(msvStore); |
|
178 |
|
179 msvStore->StoreBodyTextL(*signature); |
|
180 msvStore->Commit(); |
|
181 CleanupStack::PopAndDestroy(4); // msvStore, signature, charFormatLayer, paraFormatLayer |
|
182 } |
|
183 |
|
184 LOCAL_C void SetSignatureToEmailL(TBool addSignature, TMsvId serviceId) |
|
185 { |
|
186 CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings; |
|
187 CleanupStack::PushL(smtpSettings); |
|
188 |
|
189 CEmailAccounts* accounts = CEmailAccounts::NewLC(); |
|
190 TSmtpAccount smtpAccount; |
|
191 accounts->GetSmtpAccountL(serviceId, smtpAccount); |
|
192 accounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings); |
|
193 |
|
194 smtpSettings->SetAddSignatureToEmail(addSignature); |
|
195 |
|
196 accounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings); |
|
197 |
|
198 CleanupStack::PopAndDestroy(2); // smtpSettings, msvStore/accounts |
|
199 |
|
200 if (addSignature) |
|
201 testUtils->WriteComment(_L("\tAdd VCard")); |
|
202 } |
|
203 |
|
204 LOCAL_C void SetDefaultServiceL(TMsvId smtpService) |
|
205 { |
|
206 CEmailAccounts* accounts = CEmailAccounts::NewLC(); |
|
207 TSmtpAccount smtpAccount; |
|
208 accounts->GetSmtpAccountL(smtpService, smtpAccount); |
|
209 accounts->SetDefaultSmtpAccountL(smtpAccount); |
|
210 |
|
211 // is default service ?? |
|
212 accounts->GetSmtpAccountL(smtpService, smtpAccount); |
|
213 if (smtpService != smtpAccount.iSmtpService) |
|
214 User::Leave(KErrNotFound); |
|
215 CleanupStack::PopAndDestroy(accounts); |
|
216 } |
|
217 |
|
218 LOCAL_C TMsvId CreateNewPlaintextMessageWithIncompleteAttachmentL() |
|
219 { |
|
220 TMsvEmailTypeList msvEmailTypeList = 0; |
|
221 TMsvPartList partList = 0; |
|
222 |
|
223 CTestActive* testActive = new (ELeave) CTestActive(); |
|
224 CleanupStack::PushL(testActive); |
|
225 partList = (KMsvMessagePartBody | KMsvMessagePartAttachments); |
|
226 CImEmailOperation* emailOperation = CImEmailOperation::CreateNewL(testActive->iStatus, *(testUtils->iMsvSession), KMsvGlobalInBoxIndexEntryId, partList, msvEmailTypeList, KUidMsgTypeSMTP); |
|
227 CleanupStack::PushL(emailOperation); |
|
228 |
|
229 testActive->StartL(); |
|
230 CActiveScheduler::Start(); |
|
231 if (testActive->iStatus.Int()) |
|
232 { |
|
233 testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed")); |
|
234 testUtils->TestHarnessFailed(testActive->iStatus.Int()); |
|
235 } |
|
236 |
|
237 //check progress |
|
238 TMsvId temp; |
|
239 TPckgC<TMsvId> paramPack(temp); |
|
240 const TDesC8& progBuf1 = emailOperation->ProgressL(); |
|
241 paramPack.Set(progBuf1); |
|
242 TMsvId messageId = paramPack(); |
|
243 |
|
244 CleanupStack::PopAndDestroy(2); // testActive, emailOperation |
|
245 |
|
246 // |
|
247 // Add an attachment |
|
248 // |
|
249 testActive = new (ELeave) CTestActive(); |
|
250 CleanupStack::PushL(testActive); |
|
251 |
|
252 _LIT(KAttachment1, "C:\\mailtest\\IMCM\\rfc82201.txt"); |
|
253 |
|
254 CImEmailMessage* imEmailMessage = CImEmailMessage::NewLC(*(testUtils->iMsvEntry)); |
|
255 |
|
256 testUtils->iMsvEntry->SetEntryL(messageId); |
|
257 CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); |
|
258 CleanupStack::PushL(attachmentInfo); |
|
259 imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment1, attachmentInfo, testActive->iStatus); |
|
260 CleanupStack::Pop(attachmentInfo); |
|
261 |
|
262 testActive->StartL(); |
|
263 CActiveScheduler::Start(); // wait for the asynch operation to complete |
|
264 |
|
265 if (testActive->iStatus.Int()) |
|
266 { |
|
267 testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed")); |
|
268 testUtils->TestHarnessFailed(testActive->iStatus.Int()); |
|
269 } |
|
270 |
|
271 testUtils->iMsvEntry->SetEntryL(messageId); |
|
272 attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); |
|
273 CleanupStack::PushL(attachmentInfo); |
|
274 imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment1, attachmentInfo, testActive->iStatus); |
|
275 CleanupStack::Pop(attachmentInfo); |
|
276 |
|
277 testActive->StartL(); |
|
278 CActiveScheduler::Start(); // wait for the asynch operation to complete |
|
279 |
|
280 if (testActive->iStatus.Int()) |
|
281 { |
|
282 testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed")); |
|
283 testUtils->TestHarnessFailed(testActive->iStatus.Int()); |
|
284 } |
|
285 |
|
286 const TDesC8& progBuf2 = imEmailMessage->ProgressL(); |
|
287 paramPack.Set(progBuf2); |
|
288 TMsvId attachmentId = paramPack(); |
|
289 |
|
290 CleanupStack::PopAndDestroy(2); // imEmailMessage, testActive |
|
291 |
|
292 // |
|
293 // Set the attachment to be not complete |
|
294 // |
|
295 |
|
296 testUtils->iMsvEntry->SetEntryL(attachmentId); |
|
297 TMsvEmailEntry attachmentEntry = testUtils->iMsvEntry->Entry(); |
|
298 attachmentEntry.SetComplete(EFalse); |
|
299 testUtils->iMsvEntry->ChangeL(attachmentEntry); |
|
300 |
|
301 return messageId; |
|
302 } |
|
303 |
|
304 LOCAL_C void DoPlaintextCreateReceiptTestsL(TMsvId aMessageId) |
|
305 { |
|
306 TMsvPartList partList = 0; |
|
307 TMsvEmailTypeList emailTypeList = 0; |
|
308 |
|
309 // |
|
310 // Plaintext messages |
|
311 // |
|
312 testUtils->WriteComment(_L("\tPlaintext Create Forward Message Tests")); |
|
313 |
|
314 // basic new message with nothing! |
|
315 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
316 |
|
317 // only body |
|
318 partList = KMsvMessagePartBody; |
|
319 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
320 |
|
321 // only attachment |
|
322 partList = KMsvMessagePartAttachments; |
|
323 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
324 |
|
325 // only body and attachment |
|
326 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
327 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
328 |
|
329 // basic new message with subject |
|
330 partList = KMsvMessagePartDescription; |
|
331 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
332 |
|
333 // only body and subject |
|
334 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
335 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
336 |
|
337 // only attachment and subject |
|
338 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
339 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
340 |
|
341 // only body, attachment and subject |
|
342 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
343 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
344 |
|
345 // basic new message with originator |
|
346 partList = KMsvMessagePartOriginator; |
|
347 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
348 |
|
349 // only body and originator |
|
350 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
351 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
352 |
|
353 // only attachment and originator |
|
354 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
355 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
356 |
|
357 // only body, attachment and originator |
|
358 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
359 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
360 |
|
361 // basic new message with subject and originator |
|
362 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
363 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
364 |
|
365 // only body, subject and originator |
|
366 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
367 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
368 |
|
369 // only attachment, subject and originator |
|
370 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
371 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
372 |
|
373 // only body, attachment, subject and originator |
|
374 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
375 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
376 |
|
377 // basic new message with recipients |
|
378 partList = KMsvMessagePartRecipient; |
|
379 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
380 |
|
381 // only body and recipients |
|
382 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
383 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
384 |
|
385 // only attachment and recipients |
|
386 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
387 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
388 |
|
389 // only body, attachment and recipients |
|
390 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
391 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
392 |
|
393 // basic new message with subject and recipients |
|
394 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
395 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
396 |
|
397 // only body, subject and recipients |
|
398 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
399 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
400 |
|
401 // only attachment, subject and recipients |
|
402 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
403 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
404 |
|
405 // only body, attachment, subject and recipients |
|
406 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
407 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
408 |
|
409 // basic new message with originator and recipients |
|
410 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
411 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
412 |
|
413 // only body, originator and recipients |
|
414 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
415 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
416 |
|
417 // only attachment, originator and recipients |
|
418 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
419 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
420 |
|
421 // only body, attachment, originator and recipients |
|
422 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
423 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
424 |
|
425 // basic new message with subject, originator and recipients |
|
426 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
427 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
428 |
|
429 // only body, subject, originator and recipients |
|
430 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
431 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
432 |
|
433 // only attachment, subject, originator and recipients |
|
434 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
435 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
436 |
|
437 // only body, attachment, subject, originator and recipients |
|
438 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
439 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
440 |
|
441 // Create a VCard and store in the SMTP settings |
|
442 SetAddVCardToEmailL(ETrue, smtpService); |
|
443 testUtils->WriteComment(_L("\tPlaintext Create Forward Message with VCard Tests")); |
|
444 |
|
445 // basic new message with VCard |
|
446 partList = 0; |
|
447 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
448 |
|
449 // only body and VCard |
|
450 partList = KMsvMessagePartBody; |
|
451 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
452 |
|
453 // only attachment and VCard |
|
454 partList = KMsvMessagePartAttachments; |
|
455 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
456 |
|
457 // only body, attachment and VCard |
|
458 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
459 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
460 |
|
461 // basic new message with subject and VCard |
|
462 partList = KMsvMessagePartDescription; |
|
463 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
464 |
|
465 // only body, subject and VCard |
|
466 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
467 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
468 |
|
469 // only attachment, subject and VCard |
|
470 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
471 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
472 |
|
473 // only body, attachment, subject and VCard |
|
474 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
475 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
476 |
|
477 // basic new message with originator and VCard |
|
478 partList = KMsvMessagePartOriginator; |
|
479 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
480 |
|
481 // only body, originator and VCard |
|
482 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
483 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
484 |
|
485 // only attachment, originator and VCard |
|
486 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
487 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
488 |
|
489 // only body, attachment, originator and VCard |
|
490 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
491 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
492 |
|
493 // basic new message with subject, originator and VCard |
|
494 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
495 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
496 |
|
497 // only body, subject, originator and VCard |
|
498 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
499 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
500 |
|
501 // only attachment, subject, originator and VCard |
|
502 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
503 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
504 |
|
505 // only body, attachment, subject, originator and VCard |
|
506 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
507 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
508 |
|
509 // basic new message with recipients and VCard |
|
510 partList = KMsvMessagePartRecipient; |
|
511 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
512 |
|
513 // only body, recipients and VCard |
|
514 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
515 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
516 |
|
517 // only attachment, recipients and VCard |
|
518 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
519 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
520 |
|
521 // only body, attachment, recipients and VCard |
|
522 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
523 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
524 |
|
525 // basic new message with subject, recipients and VCard |
|
526 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
527 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
528 |
|
529 // only body, subject, recipients and VCard |
|
530 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
531 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
532 |
|
533 // only attachment, subject, recipients and VCard |
|
534 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
535 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
536 |
|
537 // only body, attachment, subject, recipients and VCard |
|
538 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
539 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
540 |
|
541 // basic new message with originator, recipients and VCard |
|
542 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
543 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
544 |
|
545 // only body, originator, recipients and VCard |
|
546 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
547 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
548 |
|
549 // only attachment, originator, recipients and VCard |
|
550 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
551 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
552 |
|
553 // only body, attachment, originator, recipients and VCard |
|
554 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
555 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
556 |
|
557 // basic new message with subject, originator, recipients and VCard |
|
558 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
559 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
560 |
|
561 // only body, subject, originator, recipients and VCard |
|
562 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
563 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
564 |
|
565 // only attachment, subject, originator, recipients and VCard |
|
566 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
567 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
568 |
|
569 // only body, attachment, subject, originator, recipients and VCard |
|
570 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
571 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
572 |
|
573 // Store signature in the SMTP settings |
|
574 SetAddVCardToEmailL(EFalse, smtpService); |
|
575 CreateSignatureL(smtpService); |
|
576 SetSignatureToEmailL(ETrue, smtpService); |
|
577 testUtils->WriteComment(_L("\tPlaintext Create Forward Message with signature Tests")); |
|
578 |
|
579 // basic new message with signature! |
|
580 partList = 0; |
|
581 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
582 |
|
583 // only body and signature |
|
584 partList = KMsvMessagePartBody; |
|
585 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
586 |
|
587 // only attachment and signature |
|
588 partList = KMsvMessagePartAttachments; |
|
589 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
590 |
|
591 // only body, attachment and signature |
|
592 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
593 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
594 |
|
595 // basic new message with subject and signature |
|
596 partList = KMsvMessagePartDescription; |
|
597 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
598 |
|
599 // only body, subject and signature |
|
600 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
601 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
602 |
|
603 // only attachment, subject and signature |
|
604 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
605 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
606 |
|
607 // only body, attachment, subject and signature |
|
608 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
609 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
610 |
|
611 // basic new message with originator and signature |
|
612 partList = KMsvMessagePartOriginator; |
|
613 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
614 |
|
615 // only body, originator and signature |
|
616 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
617 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
618 |
|
619 // only attachment, originator and signature |
|
620 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
621 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
622 |
|
623 // only body, attachment, originator and signature |
|
624 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
625 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
626 |
|
627 // basic new message with subject, originator and signature |
|
628 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
629 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
630 |
|
631 // only body, subject, originator and signature |
|
632 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
633 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
634 |
|
635 // only attachment, subject, originator and signature |
|
636 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
637 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
638 |
|
639 // only body, attachment, subject, originator and signature |
|
640 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
641 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
642 |
|
643 // basic new message with recipients and signature |
|
644 partList = KMsvMessagePartRecipient; |
|
645 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
646 |
|
647 // only body, recipients and signature |
|
648 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
649 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
650 |
|
651 // only attachment, recipients and signature |
|
652 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
653 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
654 |
|
655 // only body, attachment, recipients and signature |
|
656 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
657 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
658 |
|
659 // basic new message with subject, recipients and signature |
|
660 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
661 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
662 |
|
663 // only body, subject, recipients and signature |
|
664 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
665 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
666 |
|
667 // only attachment, subject, recipients and signature |
|
668 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
669 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
670 |
|
671 // only body, attachment, subject, recipients and signature |
|
672 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
673 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
674 |
|
675 // basic new message with originator, recipients and signature |
|
676 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
677 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
678 |
|
679 // only body, originator, recipients and signature |
|
680 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
681 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
682 |
|
683 // only attachment, originator, recipients and signature |
|
684 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
685 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
686 |
|
687 // only body, attachment, originator, recipients and signature |
|
688 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
689 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
690 |
|
691 // basic new message with subject, originator, recipients and signature |
|
692 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
693 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
694 |
|
695 // only body, subject, originator, recipients and signature |
|
696 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
697 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
698 |
|
699 // only attachment, subject, originator, recipients and signature |
|
700 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
701 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
702 |
|
703 // only body, attachment, subject, originator, recipients and signature |
|
704 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
705 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
706 |
|
707 // Create a VCard and store in the SMTP settings |
|
708 SetAddVCardToEmailL(ETrue, smtpService); |
|
709 testUtils->WriteComment(_L("\tPlaintext Create Forward Message with VCard and signature Tests")); |
|
710 |
|
711 // basic new message with VCard and Signature! |
|
712 partList = 0; |
|
713 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
714 |
|
715 // only body, VCard and Signature |
|
716 partList = KMsvMessagePartBody; |
|
717 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
718 |
|
719 // only attachment, VCard and Signature |
|
720 partList = KMsvMessagePartAttachments; |
|
721 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
722 |
|
723 // only body, attachment, VCard and Signature |
|
724 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
725 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
726 |
|
727 // basic new message with subject, VCard and Signature |
|
728 partList = KMsvMessagePartDescription; |
|
729 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
730 |
|
731 // only body, subject, VCard and Signature |
|
732 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
733 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
734 |
|
735 // only attachment, subject, VCard and Signature |
|
736 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
737 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
738 |
|
739 // only body, attachment, subject, VCard and Signature |
|
740 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
741 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
742 |
|
743 // basic new message with originator, VCard and Signature |
|
744 partList = KMsvMessagePartOriginator; |
|
745 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
746 |
|
747 // only body, originator, VCard and Signature |
|
748 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
749 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
750 |
|
751 // only attachment, originator, VCard and Signature |
|
752 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
753 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
754 |
|
755 // only body, attachment, originator, VCard and Signature |
|
756 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
757 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
758 |
|
759 // basic new message with subject, originator, VCard and Signature |
|
760 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
761 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
762 |
|
763 // only body, subject, originator, VCard and Signature |
|
764 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
765 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
766 |
|
767 // only attachment, subject, originator, VCard and Signature |
|
768 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
769 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
770 |
|
771 // only body, attachment, subject, originator, VCard and Signature |
|
772 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
773 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
774 |
|
775 // basic new message with recipients, VCard and Signature |
|
776 partList = KMsvMessagePartRecipient; |
|
777 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
778 |
|
779 // only body, recipients, VCard and Signature |
|
780 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
781 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
782 |
|
783 // only attachment, recipients, VCard and Signature |
|
784 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
785 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
786 |
|
787 // only body, attachment, recipients, VCard and Signature |
|
788 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
789 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
790 |
|
791 // basic new message with subject, recipients, VCard and Signature |
|
792 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
793 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
794 |
|
795 // only body, subject, recipients, VCard and Signature |
|
796 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
797 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
798 |
|
799 // only attachment, subject, recipients, VCard and Signature |
|
800 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
801 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
802 |
|
803 // only body, attachment, subject, recipients, VCard and Signature |
|
804 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
805 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
806 |
|
807 // basic new message with originator, recipients, VCard and Signature |
|
808 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
809 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
810 |
|
811 // only body, originator, recipients, VCard and Signature |
|
812 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
813 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
814 |
|
815 // only attachment, originator, recipients, VCard and Signature |
|
816 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
817 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
818 |
|
819 // only body, attachment, originator, recipients, VCard and Signature |
|
820 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
821 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
822 |
|
823 // basic new message with subject, originator, recipients, VCard and Signature |
|
824 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
825 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
826 |
|
827 // only body, subject, originator, recipients, VCard and Signature |
|
828 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
829 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
830 |
|
831 // only attachment, subject, originator, recipients, VCard and Signature |
|
832 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
833 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
834 |
|
835 // only body, attachment, subject, originator, recipients, VCard and Signature |
|
836 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
837 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
838 } |
|
839 |
|
840 LOCAL_C void DoHtmlCreateReceiptTestsL(TMsvId aMessageId) |
|
841 { |
|
842 TMsvPartList partList = 0; |
|
843 TMsvEmailTypeList emailTypeList = KMsvEmailTypeListMHTMLMessage; |
|
844 |
|
845 // |
|
846 // HTML Messages |
|
847 // |
|
848 testUtils->WriteComment(_L("\tHTML Create Forward Message Tests")); |
|
849 |
|
850 // basic new message with nothing! |
|
851 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
852 |
|
853 // only body |
|
854 partList = KMsvMessagePartBody; |
|
855 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
856 |
|
857 // only attachment |
|
858 partList = KMsvMessagePartAttachments; |
|
859 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
860 |
|
861 // only body and attachment |
|
862 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
863 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
864 |
|
865 // basic new message with subject |
|
866 partList = KMsvMessagePartDescription; |
|
867 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
868 |
|
869 // only body and subject |
|
870 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
871 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
872 |
|
873 // only attachment and subject |
|
874 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
875 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
876 |
|
877 // only body, attachment and subject |
|
878 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
879 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
880 |
|
881 // basic new message with originator |
|
882 partList = KMsvMessagePartOriginator; |
|
883 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
884 |
|
885 // only body and originator |
|
886 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
887 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
888 |
|
889 // only attachment and originator |
|
890 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
891 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
892 |
|
893 // only body, attachment and originator |
|
894 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
895 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
896 |
|
897 // basic new message with subject and originator |
|
898 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
899 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
900 |
|
901 // only body, subject and originator |
|
902 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
903 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
904 |
|
905 // only attachment, subject and originator |
|
906 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
907 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
908 |
|
909 // only body, attachment, subject and originator |
|
910 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
911 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
912 |
|
913 // basic new message with recipients |
|
914 partList = KMsvMessagePartRecipient; |
|
915 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
916 |
|
917 // only body and recipients |
|
918 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
919 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
920 |
|
921 // only attachment and recipients |
|
922 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
923 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
924 |
|
925 // only body, attachment and recipients |
|
926 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
927 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
928 |
|
929 // basic new message with subject and recipients |
|
930 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
931 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
932 |
|
933 // only body, subject and recipients |
|
934 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
935 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
936 |
|
937 // only attachment, subject and recipients |
|
938 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
939 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
940 |
|
941 // only body, attachment, subject and recipients |
|
942 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
943 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
944 |
|
945 // basic new message with originator and recipients |
|
946 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
947 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
948 |
|
949 // only body, originator and recipients |
|
950 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
951 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
952 |
|
953 // only attachment, originator and recipients |
|
954 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
955 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
956 |
|
957 // only body, attachment, originator and recipients |
|
958 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
959 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
960 |
|
961 // basic new message with subject, originator and recipients |
|
962 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
963 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
964 |
|
965 // only body, subject, originator and recipients |
|
966 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
967 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
968 |
|
969 // only attachment, subject, originator and recipients |
|
970 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
971 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
972 |
|
973 // only body, attachment, subject, originator and recipients |
|
974 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
975 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
976 |
|
977 // Create a VCard and store in the SMTP settings |
|
978 SetAddVCardToEmailL(ETrue, smtpService); |
|
979 testUtils->WriteComment(_L("\tHTML Create Forward Message with VCard Tests")); |
|
980 |
|
981 // basic new message with VCard |
|
982 partList = 0; |
|
983 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
984 |
|
985 // only body and VCard |
|
986 partList = KMsvMessagePartBody; |
|
987 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
988 |
|
989 // only attachment and VCard |
|
990 partList = KMsvMessagePartAttachments; |
|
991 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
992 |
|
993 // only body, attachment and VCard |
|
994 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
995 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
996 |
|
997 // basic new message with subject and VCard |
|
998 partList = KMsvMessagePartDescription; |
|
999 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1000 |
|
1001 // only body, subject and VCard |
|
1002 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
1003 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1004 |
|
1005 // only attachment, subject and VCard |
|
1006 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
1007 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1008 |
|
1009 // only body, attachment, subject and VCard |
|
1010 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
1011 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1012 |
|
1013 // basic new message with originator and VCard |
|
1014 partList = KMsvMessagePartOriginator; |
|
1015 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1016 |
|
1017 // only body, originator and VCard |
|
1018 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
1019 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1020 |
|
1021 // only attachment, originator and VCard |
|
1022 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
1023 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1024 |
|
1025 // only body, attachment, originator and VCard |
|
1026 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
1027 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1028 |
|
1029 // basic new message with subject, originator and VCard |
|
1030 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1031 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1032 |
|
1033 // only body, subject, originator and VCard |
|
1034 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1035 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1036 |
|
1037 // only attachment, subject, originator and VCard |
|
1038 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1039 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1040 |
|
1041 // only body, attachment, subject, originator and VCard |
|
1042 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1043 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1044 |
|
1045 // basic new message with recipients and VCard |
|
1046 partList = KMsvMessagePartRecipient; |
|
1047 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1048 |
|
1049 // only body, recipients and VCard |
|
1050 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
1051 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1052 |
|
1053 // only attachment, recipients and VCard |
|
1054 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
1055 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1056 |
|
1057 // only body, attachment, recipients and VCard |
|
1058 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
1059 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1060 |
|
1061 // basic new message with subject, recipients and VCard |
|
1062 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1063 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1064 |
|
1065 // only body, subject, recipients and VCard |
|
1066 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1067 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1068 |
|
1069 // only attachment, subject, recipients and VCard |
|
1070 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1071 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1072 |
|
1073 // only body, attachment, subject, recipients and VCard |
|
1074 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1075 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1076 |
|
1077 // basic new message with originator, recipients and VCard |
|
1078 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1079 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1080 |
|
1081 // only body, originator, recipients and VCard |
|
1082 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1083 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1084 |
|
1085 // only attachment, originator, recipients and VCard |
|
1086 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1087 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1088 |
|
1089 // only body, attachment, originator, recipients and VCard |
|
1090 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1091 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1092 |
|
1093 // basic new message with subject, originator, recipients and VCard |
|
1094 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1095 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1096 |
|
1097 // only body, subject, originator, recipients and VCard |
|
1098 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1099 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1100 |
|
1101 // only attachment, subject, originator, recipients and VCard |
|
1102 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1103 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1104 |
|
1105 // only body, attachment, subject, originator, recipients and VCard |
|
1106 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1107 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1108 |
|
1109 // Store signature in the SMTP settings |
|
1110 SetAddVCardToEmailL(EFalse, smtpService); |
|
1111 CreateSignatureL(smtpService); |
|
1112 SetSignatureToEmailL(ETrue, smtpService); |
|
1113 testUtils->WriteComment(_L("\tHTML Create Forward Message with signature Tests")); |
|
1114 |
|
1115 // basic new message with signature! |
|
1116 partList = 0; |
|
1117 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1118 |
|
1119 // only body and signature |
|
1120 partList = KMsvMessagePartBody; |
|
1121 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1122 |
|
1123 // only attachment and signature |
|
1124 partList = KMsvMessagePartAttachments; |
|
1125 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1126 |
|
1127 // only body, attachment and signature |
|
1128 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
1129 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1130 |
|
1131 // basic new message with subject and signature |
|
1132 partList = KMsvMessagePartDescription; |
|
1133 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1134 |
|
1135 // only body, subject and signature |
|
1136 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
1137 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1138 |
|
1139 // only attachment, subject and signature |
|
1140 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
1141 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1142 |
|
1143 // only body, attachment, subject and signature |
|
1144 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
1145 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1146 |
|
1147 // basic new message with originator and signature |
|
1148 partList = KMsvMessagePartOriginator; |
|
1149 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1150 |
|
1151 // only body, originator and signature |
|
1152 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
1153 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1154 |
|
1155 // only attachment, originator and signature |
|
1156 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
1157 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1158 |
|
1159 // only body, attachment, originator and signature |
|
1160 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
1161 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1162 |
|
1163 // basic new message with subject, originator and signature |
|
1164 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1165 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1166 |
|
1167 // only body, subject, originator and signature |
|
1168 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1169 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1170 |
|
1171 // only attachment, subject, originator and signature |
|
1172 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1173 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1174 |
|
1175 // only body, attachment, subject, originator and signature |
|
1176 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1177 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1178 |
|
1179 // basic new message with recipients and signature |
|
1180 partList = KMsvMessagePartRecipient; |
|
1181 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1182 |
|
1183 // only body, recipients and signature |
|
1184 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
1185 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1186 |
|
1187 // only attachment, recipients and signature |
|
1188 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
1189 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1190 |
|
1191 // only body, attachment, recipients and signature |
|
1192 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
1193 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1194 |
|
1195 // basic new message with subject, recipients and signature |
|
1196 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1197 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1198 |
|
1199 // only body, subject, recipients and signature |
|
1200 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1201 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1202 |
|
1203 // only attachment, subject, recipients and signature |
|
1204 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1205 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1206 |
|
1207 // only body, attachment, subject, recipients and signature |
|
1208 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1209 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1210 |
|
1211 // basic new message with originator, recipients and signature |
|
1212 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1213 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1214 |
|
1215 // only body, originator, recipients and signature |
|
1216 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1217 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1218 |
|
1219 // only attachment, originator, recipients and signature |
|
1220 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1221 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1222 |
|
1223 // only body, attachment, originator, recipients and signature |
|
1224 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1225 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1226 |
|
1227 // basic new message with subject, originator, recipients and signature |
|
1228 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1229 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1230 |
|
1231 // only body, subject, originator, recipients and signature |
|
1232 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1233 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1234 |
|
1235 // only attachment, subject, originator, recipients and signature |
|
1236 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1237 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1238 |
|
1239 // only body, attachment, subject, originator, recipients and signature |
|
1240 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1241 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1242 |
|
1243 // Create a VCard and store in the SMTP settings |
|
1244 SetAddVCardToEmailL(ETrue, smtpService); |
|
1245 testUtils->WriteComment(_L("\tHTML Create Forward Message with VCard and signature Tests")); |
|
1246 |
|
1247 // basic new message with VCard and Signature! |
|
1248 partList = 0; |
|
1249 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1250 |
|
1251 // only body, VCard and Signature |
|
1252 partList = KMsvMessagePartBody; |
|
1253 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1254 |
|
1255 // only attachment, VCard and Signature |
|
1256 partList = KMsvMessagePartAttachments; |
|
1257 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1258 |
|
1259 // only body, attachment, VCard and Signature |
|
1260 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
1261 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1262 |
|
1263 // basic new message with subject, VCard and Signature |
|
1264 partList = KMsvMessagePartDescription; |
|
1265 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1266 |
|
1267 // only body, subject, VCard and Signature |
|
1268 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
1269 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1270 |
|
1271 // only attachment, subject, VCard and Signature |
|
1272 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
1273 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1274 |
|
1275 // only body, attachment, subject, VCard and Signature |
|
1276 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
1277 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1278 |
|
1279 // basic new message with originator, VCard and Signature |
|
1280 partList = KMsvMessagePartOriginator; |
|
1281 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1282 |
|
1283 // only body, originator, VCard and Signature |
|
1284 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
1285 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1286 |
|
1287 // only attachment, originator, VCard and Signature |
|
1288 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
1289 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1290 |
|
1291 // only body, attachment, originator, VCard and Signature |
|
1292 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
1293 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1294 |
|
1295 // basic new message with subject, originator, VCard and Signature |
|
1296 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1297 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1298 |
|
1299 // only body, subject, originator, VCard and Signature |
|
1300 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1301 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1302 |
|
1303 // only attachment, subject, originator, VCard and Signature |
|
1304 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1305 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1306 |
|
1307 // only body, attachment, subject, originator, VCard and Signature |
|
1308 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
1309 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1310 |
|
1311 // basic new message with recipients, VCard and Signature |
|
1312 partList = KMsvMessagePartRecipient; |
|
1313 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1314 |
|
1315 // only body, recipients, VCard and Signature |
|
1316 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
1317 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1318 |
|
1319 // only attachment, recipients, VCard and Signature |
|
1320 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
1321 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1322 |
|
1323 // only body, attachment, recipients, VCard and Signature |
|
1324 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
1325 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1326 |
|
1327 // basic new message with subject, recipients, VCard and Signature |
|
1328 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1329 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1330 |
|
1331 // only body, subject, recipients, VCard and Signature |
|
1332 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1333 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1334 |
|
1335 // only attachment, subject, recipients, VCard and Signature |
|
1336 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1337 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1338 |
|
1339 // only body, attachment, subject, recipients, VCard and Signature |
|
1340 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
1341 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1342 |
|
1343 // basic new message with originator, recipients, VCard and Signature |
|
1344 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1345 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1346 |
|
1347 // only body, originator, recipients, VCard and Signature |
|
1348 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1349 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1350 |
|
1351 // only attachment, originator, recipients, VCard and Signature |
|
1352 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1353 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1354 |
|
1355 // only body, attachment, originator, recipients, VCard and Signature |
|
1356 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1357 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1358 |
|
1359 // basic new message with subject, originator, recipients, VCard and Signature |
|
1360 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1361 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1362 |
|
1363 // only body, subject, originator, recipients, VCard and Signature |
|
1364 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1365 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1366 |
|
1367 // only attachment, subject, originator, recipients, VCard and Signature |
|
1368 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1369 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1370 |
|
1371 // only body, attachment, subject, originator, recipients, VCard and Signature |
|
1372 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
1373 CreateReceiptL(aMessageId, partList, emailTypeList, testNo++); |
|
1374 } |
|
1375 |
|
1376 LOCAL_C TBool CompareLogsL() |
|
1377 { |
|
1378 TBool errorOccured = EFalse; |
|
1379 |
|
1380 CDesCArray* correctFile = new (ELeave) CDesCArrayFlat(1); |
|
1381 CPtrCArray* resultFile = new (ELeave) CPtrCArray(1); |
|
1382 |
|
1383 TParse parsedFileName; |
|
1384 TParse parsedResultFileName; |
|
1385 TFileName name; |
|
1386 name.Append(KOkFileNameEntryStructure); |
|
1387 testUtils->ResolveFile(KComponent, name, parsedFileName); |
|
1388 correctFile->AppendL(parsedFileName.FullName()); |
|
1389 name.Zero(); |
|
1390 name.Copy(KFileNameEntryStructure); |
|
1391 testUtils->ResolveLogFile(name, parsedResultFileName); |
|
1392 resultFile->AppendL(parsedResultFileName.FullName()); |
|
1393 |
|
1394 RFileReadStream file1; |
|
1395 RFileReadStream file2; |
|
1396 HBufC8* line1Buffer = HBufC8::NewLC(1024); |
|
1397 TPtr8 line1 = line1Buffer->Des(); |
|
1398 TBuf8<1> aChar1; |
|
1399 |
|
1400 HBufC8* line2Buffer = HBufC8::NewLC(1024); |
|
1401 TPtr8 line2 = line2Buffer->Des(); |
|
1402 TBuf8<1> aChar2; |
|
1403 |
|
1404 for(TInt i=0; i<correctFile->MdcaCount(); i++) |
|
1405 { |
|
1406 TFileName file1Name = correctFile->MdcaPoint(i); |
|
1407 |
|
1408 TFileName file2Name = resultFile->MdcaPoint(i); |
|
1409 |
|
1410 TInt error1=KErrNone; |
|
1411 TInt error2=KErrNone; |
|
1412 |
|
1413 test.Printf(_L("\n%s"), file2Name.PtrZ()); |
|
1414 |
|
1415 error1=file1.Open(testUtils->FileSession(), file1Name, EFileShareAny); |
|
1416 if(error1!=KErrNone) |
|
1417 { |
|
1418 errorOccured = ETrue; |
|
1419 } |
|
1420 else |
|
1421 { |
|
1422 error2=file2.Open(testUtils->FileSession(), file2Name, EFileShareAny); |
|
1423 if(error2!=KErrNone) |
|
1424 { |
|
1425 errorOccured = ETrue; |
|
1426 } |
|
1427 } |
|
1428 |
|
1429 if((error1==KErrNone)&&(error2==KErrNone)) |
|
1430 { |
|
1431 // read the file into the conversion object |
|
1432 TBool finished = EFalse; |
|
1433 |
|
1434 do { |
|
1435 line1.FillZ(); |
|
1436 line1.SetLength(0); |
|
1437 // compile the lines one char at a time |
|
1438 do { |
|
1439 TRAPD( error, file1.ReadL(aChar1, 1) ); |
|
1440 if (error!=KErrEof) |
|
1441 line1.Append(aChar1); |
|
1442 else |
|
1443 { |
|
1444 finished = ETrue; |
|
1445 break; |
|
1446 } |
|
1447 // stop at the end of line or no more data |
|
1448 } |
|
1449 while((aChar1[0]!=0x0A)&&(line1.Length()<1024)); |
|
1450 |
|
1451 line2.FillZ(); |
|
1452 line2.SetLength(0); |
|
1453 do { |
|
1454 TRAPD( error, file2.ReadL(aChar2, 1) ); |
|
1455 if (error!=KErrEof) |
|
1456 line2.Append(aChar2); |
|
1457 else |
|
1458 { |
|
1459 finished = ETrue; |
|
1460 break; |
|
1461 } |
|
1462 // stop at the end of line or no more data |
|
1463 } |
|
1464 while((aChar2[0]!=0x0A)&&(line2.Length()<1024)); |
|
1465 |
|
1466 // get rid of white space |
|
1467 line1.TrimRight(); |
|
1468 line2.TrimRight(); |
|
1469 |
|
1470 if(line1.Compare(line2) != 0) |
|
1471 { |
|
1472 // error so no point in continuing to compare!! |
|
1473 errorOccured = ETrue; |
|
1474 file1.Close(); |
|
1475 file2.Close(); |
|
1476 delete correctFile; |
|
1477 delete resultFile; |
|
1478 CleanupStack::PopAndDestroy(2); //line 1 , line 2 |
|
1479 return ETrue; |
|
1480 } |
|
1481 } |
|
1482 while(!finished); |
|
1483 } |
|
1484 |
|
1485 file1.Close(); |
|
1486 file2.Close(); |
|
1487 } |
|
1488 |
|
1489 delete correctFile; |
|
1490 delete resultFile; |
|
1491 CleanupStack::PopAndDestroy(2); //line 1 , line 2 |
|
1492 |
|
1493 return errorOccured; |
|
1494 } |
|
1495 |
|
1496 LOCAL_C void doMainL() |
|
1497 { |
|
1498 InitL(); |
|
1499 if (testFailed) |
|
1500 { |
|
1501 Closedown(); |
|
1502 return; |
|
1503 } |
|
1504 testUtils->GoClientSideL(); |
|
1505 smtpService = testUtils->CreateSmtpServiceL(); |
|
1506 pop3Service = testUtils->CreatePopServiceL(); |
|
1507 testUtils->GoServerSideL(); |
|
1508 |
|
1509 testUtils->CreateMessageFilesL(pop3Service, KMsvGlobalInBoxIndexEntryId, _L("c:\\mailtest\\IMCM\\")); |
|
1510 |
|
1511 test.Console()->SetPos(0, 6); |
|
1512 test.Printf(_L("Performing Tests:\n")); |
|
1513 |
|
1514 testUtils->GoClientSideL(); |
|
1515 |
|
1516 SetDefaultServiceL(smtpService); |
|
1517 |
|
1518 // get a list of all email messages in the Inbox |
|
1519 testUtils->iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId); |
|
1520 delete messageSelection; |
|
1521 messageSelection = testUtils->iMsvEntry->ChildrenWithTypeL(KUidMsvMessageEntry); |
|
1522 |
|
1523 TParse parsedFileName; |
|
1524 TFileName name(KTestMessageDir); |
|
1525 testUtils->ResolveLogFile(name, parsedFileName); |
|
1526 |
|
1527 test.Console()->SetPos(3, 8); |
|
1528 test.Printf(_L("Create Receipt Tests 1:")); |
|
1529 //Create Receipt to message with attachment which is not complete |
|
1530 testUtils->WriteComment(_L("Test 1 - Create Receipt to Plaintext message with incomplete atcmt Tests")); |
|
1531 TMsvId messageWithIncompleteAttachment = CreateNewPlaintextMessageWithIncompleteAttachmentL(); |
|
1532 TRAPD(ret,DoPlaintextCreateReceiptTestsL(messageWithIncompleteAttachment)); |
|
1533 if (ret) |
|
1534 { |
|
1535 testUtils->TestHarnessFailed(ret); |
|
1536 delete messageSelection; |
|
1537 Closedown(); |
|
1538 return; |
|
1539 } |
|
1540 |
|
1541 // |
|
1542 // Create HTML Receipttests |
|
1543 // |
|
1544 test.Console()->SetPos(3, 9); |
|
1545 test.Printf(_L("Create Receipt Tests 2:")); |
|
1546 testUtils->WriteComment(_L("Test 2 - Create HTML Receipt Tests")); |
|
1547 // Receipt to normal plaintext message with no attachments |
|
1548 testUtils->WriteComment(_L("Create Receipt to Plaintext message with no atcmts Tests")); |
|
1549 TRAP(ret,DoHtmlCreateReceiptTestsL(messageSelection->At(5))); |
|
1550 if (ret) |
|
1551 { |
|
1552 testUtils->TestHarnessFailed(ret); |
|
1553 delete messageSelection; |
|
1554 Closedown(); |
|
1555 return; |
|
1556 } |
|
1557 |
|
1558 test.Console()->SetPos(3, 10); |
|
1559 test.Printf(_L("Create Receipt Tests 3:")); |
|
1560 //Create Receipt to plaintext message with attachment |
|
1561 testUtils->WriteComment(_L("Test 3 - Create Receipt to Plaintext message with atcmt Tests")); |
|
1562 TRAP(ret,DoHtmlCreateReceiptTestsL(messageSelection->At(1))); |
|
1563 if (ret) |
|
1564 { |
|
1565 testUtils->TestHarnessFailed(ret); |
|
1566 delete messageSelection; |
|
1567 Closedown(); |
|
1568 return; |
|
1569 } |
|
1570 |
|
1571 |
|
1572 testUtils->FindChildrenL(KMsvGlobalOutBoxIndexEntryId, parsedFileName.FullName(), ETrue, EFalse); // writes message info (from Outbox) into files |
|
1573 |
|
1574 testUtils->TestFinish(testNo-1); |
|
1575 testUtils->TestHarnessCompleted(); |
|
1576 |
|
1577 delete messageSelection; |
|
1578 Closedown(); |
|
1579 |
|
1580 // shouldn't have to do this, but convertor plugins aren't |
|
1581 // doing it yet so we get a false memory leak so remove this |
|
1582 // when they fix that. |
|
1583 REComSession::FinalClose(); |
|
1584 } |
|
1585 |
|
1586 GLDEF_C TInt E32Main() |
|
1587 { |
|
1588 __UHEAP_MARK; |
|
1589 test.Start(_L("T_IMCM02e1 Test CImEmailOperation class\n")); |
|
1590 theCleanup=CTrapCleanup::New(); |
|
1591 TRAPD(ret,doMainL()); |
|
1592 test(ret==KErrNone); |
|
1593 delete theCleanup; |
|
1594 test.End(); |
|
1595 test.Close(); |
|
1596 __UHEAP_MARKEND; |
|
1597 User::Heap().Check(); |
|
1598 return(KErrNone); |
|
1599 } |