|
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_IMCM02D2 |
|
15 // Component: IMCM |
|
16 // Owner: KP |
|
17 // Brief description of test harness: |
|
18 // Tests CImEmailOperation - creates forward as attachment plaintext/HTML |
|
19 // message with/without attachments; forward as attachment HTML message with |
|
20 // no text alternative. Also tests adding VCard and signature from the SMTP |
|
21 // settings. |
|
22 // Detailed description of test harness: |
|
23 // As above |
|
24 // Input files required to run test harness: |
|
25 // \MSG\IMCMTSRC\contacts.cdb <DRIVE>:\system\data\contacts.cdb |
|
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 // In addition the following is required for WINS: |
|
33 // \MSG\IMCMTSRC\T_IMCM02d2_Entry_Structure_wins.txt <DRIVE>:\msgtest\IMCM\T_IMCM02d2_Entry_Structure_wins.txt |
|
34 // In addition the following is required for ARMI, ARM4, THUMB: |
|
35 // \MSG\IMCMTSRC\T_IMCM02D2_Entry_Structure.txt <DRIVE>:\msgtest\IMCM\T_IMCM02D2_Entry_Structure.txt |
|
36 // Intermediate files produced while running test harness: |
|
37 // <DRIVE>:\msglogs\T_IMCM02D2\Entry_Structure.txt |
|
38 // Output files produced by running test harness: |
|
39 // <DRIVE>:\msglogs\T_IMCM02D2.<PLATFORM>.<VARIANT>.LOG.txt |
|
40 // Description of how to build test harness: |
|
41 // cd \msg\imcm\ |
|
42 // bldmake bldfiles |
|
43 // abld test build |
|
44 // Description of how to run test harness: |
|
45 // The following instructions are the same for all platforms: |
|
46 // 1. Build T_DB test harness from COMMDB component: |
|
47 // cd \commdb\group |
|
48 // bldmake bldfiles |
|
49 // abld test build t_db |
|
50 // 2. Build the test utilities: |
|
51 // cd \msg\testutils\group\ |
|
52 // bldmake bldfiles |
|
53 // abld build |
|
54 // WINS running instructions: |
|
55 // 1. \epoc32\release\wins\<VARIANT>\T_IMCM02D2.exe can be used at the command prompt |
|
56 // or executable can be run from Windows Explorer. |
|
57 // All other platform running instructions: |
|
58 // 1. Copy \epoc32\release\<PLATFORM>\<VARIANT>\T_IMCM02D2.exe onto the other platform |
|
59 // 2. Copy \epoc32\release\<PLATFORM>\<VARIANT>\MSVTESTUTILS.DLL into |
|
60 // <DRIVE>:\system\libs on the other platform |
|
61 // 3. Copy \epoc32\release\<PLATFORM>\<VARIANT>\EMAILTESTUTILS.DLL into |
|
62 // <DRIVE>:\system\libs on the other platform |
|
63 // 4. Run T_IMCM02D2.exe on the other platform |
|
64 // |
|
65 // |
|
66 |
|
67 #include "emailtestutils.h" |
|
68 |
|
69 #include <miutmsg.h> |
|
70 |
|
71 |
|
72 #include <apfrec.h> |
|
73 #include <apgicnfl.h> |
|
74 #include <ecom/ecom.h> |
|
75 |
|
76 #include <mmsvattachmentmanager.h> |
|
77 #include <cemailaccounts.h> |
|
78 |
|
79 #include <cntdb.h> |
|
80 |
|
81 // local variables etc // |
|
82 |
|
83 _LIT(KImcm02Test, "T_IMCM02d2 - CImEmailOperation Tests"); |
|
84 RTest test(KImcm02Test); |
|
85 |
|
86 LOCAL_D CTrapCleanup* theCleanup; |
|
87 |
|
88 |
|
89 LOCAL_D TMsvId pop3Service; |
|
90 LOCAL_D TMsvId smtpService; |
|
91 LOCAL_D CEmailTestUtils* testUtils; |
|
92 LOCAL_D CMsvEntrySelection* messageSelection; |
|
93 LOCAL_D TInt testNo = 1; |
|
94 LOCAL_D TBool testFailed=EFalse; |
|
95 |
|
96 #define KComponent _L("IMCM") |
|
97 #define KTestMessageDir _L("") |
|
98 #define KOkFileNameEntryStructure _L("T_IMCM02d2_Entry_Structure.txt") |
|
99 // |
|
100 |
|
101 LOCAL_D TBool StartTimeSet=EFalse; |
|
102 LOCAL_D TTime StartTime; |
|
103 LOCAL_D TInt KnownDateTimeIndex=0; |
|
104 |
|
105 LOCAL_C void SetKnownDateAndTime() |
|
106 { |
|
107 TDateTime aDateTimes[]={ |
|
108 TDateTime(2002,EJune,18,10,30,0,0), |
|
109 TDateTime(2003,EJanuary,1,21,0,0,0), |
|
110 TDateTime(2001,EDecember,18,2,15,0,0), |
|
111 TDateTime(2004,EMay,18,17,50,0,0) |
|
112 }; |
|
113 if (!StartTimeSet) |
|
114 { |
|
115 StartTime.UniversalTime(); |
|
116 StartTimeSet=ETrue; |
|
117 } |
|
118 TTime aFakeTime(aDateTimes[KnownDateTimeIndex++]); |
|
119 KnownDateTimeIndex&=3; |
|
120 User::SetHomeTime(aFakeTime); |
|
121 } |
|
122 |
|
123 LOCAL_C void RestoreDateAndTime() |
|
124 { |
|
125 if (StartTimeSet) |
|
126 { |
|
127 TTime aCurrentTime; |
|
128 aCurrentTime.UniversalTime(); |
|
129 TTimeIntervalSeconds aDuration; |
|
130 if (!aCurrentTime.SecondsFrom(StartTime,aDuration)) |
|
131 StartTime+=aDuration; |
|
132 User::SetHomeTime(StartTime); |
|
133 StartTimeSet=EFalse; |
|
134 } |
|
135 } |
|
136 |
|
137 |
|
138 |
|
139 LOCAL_C void InitL() |
|
140 { |
|
141 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler; |
|
142 CActiveScheduler::Install(scheduler); |
|
143 CleanupStack::PushL(scheduler); |
|
144 |
|
145 testUtils = CEmailTestUtils::NewLC(test); |
|
146 testUtils->CreateAllTestDirectories(); |
|
147 CContactDatabase* contacts(NULL); |
|
148 TRAPD(err, contacts = CContactDatabase::OpenL()); |
|
149 delete contacts; |
|
150 if (err==KErrNotFound) |
|
151 { |
|
152 testUtils->WriteComment(_L("contacts file is missing from system data")); |
|
153 testFailed=ETrue; |
|
154 return; |
|
155 } |
|
156 testUtils->FileSession().SetSessionPath(_L("C:\\")); |
|
157 testUtils->ClearEmailAccountsL(); |
|
158 testUtils->CleanMessageFolderL(); |
|
159 testUtils->GoServerSideL(); |
|
160 |
|
161 testUtils->WriteComment(_L("CImEmailOperation Tests")); |
|
162 } |
|
163 |
|
164 LOCAL_C void Closedown() |
|
165 { |
|
166 CleanupStack::PopAndDestroy(2); //testUtils, scheduler |
|
167 User::After(5000000); |
|
168 } |
|
169 |
|
170 |
|
171 LOCAL_C void CreateForwardL(TMsvId aMessageId, TMsvPartList aPartList, TMsvEmailTypeList aMsvEmailTypeList, TInt aTestNo) |
|
172 { |
|
173 testUtils->TestStart(aTestNo); |
|
174 CTestActive* testActive = new (ELeave) CTestActive(); |
|
175 CleanupStack::PushL(testActive); |
|
176 |
|
177 CImEmailOperation* emailOperation = CImEmailOperation::CreateForwardL(testActive->iStatus, *(testUtils->iMsvSession), aMessageId, KMsvGlobalOutBoxIndexEntryId, aPartList, aMsvEmailTypeList, KUidMsgTypeSMTP); |
|
178 CleanupStack::PushL(emailOperation); |
|
179 |
|
180 testActive->StartL(); |
|
181 CActiveScheduler::Start(); |
|
182 testUtils->TestFinish(aTestNo,testActive->iStatus.Int()); |
|
183 |
|
184 // TestMessageProgressL(*emailOperation, aPartList, aMsvEmailTypeList, aTestNo); |
|
185 |
|
186 CleanupStack::PopAndDestroy(2); // testActive, emailOperation |
|
187 } |
|
188 |
|
189 LOCAL_C void SetAddVCardToEmailL(TBool addVCard, TMsvId serviceId) |
|
190 { |
|
191 CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings; |
|
192 CleanupStack::PushL(smtpSettings); |
|
193 |
|
194 CEmailAccounts* accounts = CEmailAccounts::NewLC(); |
|
195 TSmtpAccount smtpAccount; |
|
196 accounts->GetSmtpAccountL(serviceId, smtpAccount); |
|
197 accounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings); |
|
198 |
|
199 smtpSettings->SetAddVCardToEmail(addVCard); |
|
200 |
|
201 accounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings); |
|
202 |
|
203 CleanupStack::PopAndDestroy(2); // smtpSettings, accounts |
|
204 } |
|
205 |
|
206 LOCAL_C void CreateSignatureL(TMsvId serviceId) |
|
207 { |
|
208 testUtils->iMsvEntry->SetEntryL(serviceId); |
|
209 CParaFormatLayer* paraFormatLayer=CParaFormatLayer::NewL(); |
|
210 CleanupStack::PushL(paraFormatLayer); |
|
211 |
|
212 CCharFormatLayer* charFormatLayer=CCharFormatLayer::NewL(); |
|
213 CleanupStack::PushL(charFormatLayer); |
|
214 |
|
215 CRichText* signature=CRichText::NewL(paraFormatLayer, charFormatLayer, CEditableText::EFlatStorage, 256); |
|
216 CleanupStack::PushL(signature); |
|
217 |
|
218 TBuf<100> bodyContents = _L("(Signature:) Symbian Ltd."); |
|
219 signature->InsertL(0, bodyContents); |
|
220 |
|
221 CMsvStore* msvStore = testUtils->iMsvEntry->EditStoreL(); |
|
222 CleanupStack::PushL(msvStore); |
|
223 |
|
224 msvStore->StoreBodyTextL(*signature); |
|
225 msvStore->Commit(); |
|
226 CleanupStack::PopAndDestroy(4); // msvStore, signature, charFormatLayer, paraFormatLayer |
|
227 } |
|
228 |
|
229 LOCAL_C void SetSignatureToEmailL(TBool addSignature, TMsvId serviceId) |
|
230 { |
|
231 CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings; |
|
232 CleanupStack::PushL(smtpSettings); |
|
233 |
|
234 CEmailAccounts* accounts = CEmailAccounts::NewLC(); |
|
235 TSmtpAccount smtpAccount; |
|
236 accounts->GetSmtpAccountL(serviceId, smtpAccount); |
|
237 accounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings); |
|
238 |
|
239 smtpSettings->SetAddSignatureToEmail(addSignature); |
|
240 |
|
241 accounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings); |
|
242 |
|
243 CleanupStack::PopAndDestroy(2); // smtpSettings, accounts |
|
244 |
|
245 if (addSignature) |
|
246 testUtils->WriteComment(_L("\tAdd VCard")); |
|
247 } |
|
248 |
|
249 LOCAL_C void SetDefaultServiceL(TMsvId smtpService) |
|
250 { |
|
251 CEmailAccounts* accounts = CEmailAccounts::NewLC(); |
|
252 TSmtpAccount smtpAccount; |
|
253 accounts->GetSmtpAccountL(smtpService, smtpAccount); |
|
254 accounts->SetDefaultSmtpAccountL(smtpAccount); |
|
255 |
|
256 // is default service ?? |
|
257 TSmtpAccount defaultAccount; |
|
258 accounts->DefaultSmtpAccountL(defaultAccount); |
|
259 if (smtpService != defaultAccount.iSmtpService) |
|
260 { |
|
261 User::Leave(KErrNotFound); |
|
262 } |
|
263 CleanupStack::PopAndDestroy(accounts); |
|
264 } |
|
265 |
|
266 LOCAL_C TMsvId CreateNewPlaintextMessageWithIncompleteAttachmentL() |
|
267 { |
|
268 TMsvEmailTypeList msvEmailTypeList = 0; |
|
269 TMsvPartList partList = 0; |
|
270 |
|
271 CTestActive* testActive = new (ELeave) CTestActive(); |
|
272 CleanupStack::PushL(testActive); |
|
273 partList = (KMsvMessagePartBody | KMsvMessagePartAttachments); |
|
274 CImEmailOperation* emailOperation = CImEmailOperation::CreateNewL(testActive->iStatus, *(testUtils->iMsvSession), KMsvGlobalInBoxIndexEntryId, partList, msvEmailTypeList, KUidMsgTypeSMTP); |
|
275 CleanupStack::PushL(emailOperation); |
|
276 |
|
277 testActive->StartL(); |
|
278 CActiveScheduler::Start(); |
|
279 if (testActive->iStatus.Int()) |
|
280 { |
|
281 testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed")); |
|
282 testUtils->TestHarnessFailed(testActive->iStatus.Int()); |
|
283 } |
|
284 |
|
285 //check progress |
|
286 TMsvId temp; |
|
287 TPckgC<TMsvId> paramPack(temp); |
|
288 const TDesC8& progBuf1 = emailOperation->ProgressL(); |
|
289 paramPack.Set(progBuf1); |
|
290 TMsvId messageId = paramPack(); |
|
291 |
|
292 CleanupStack::PopAndDestroy(2); // testActive, emailOperation |
|
293 |
|
294 // |
|
295 // Add an attachment |
|
296 // |
|
297 testActive = new (ELeave) CTestActive(); |
|
298 CleanupStack::PushL(testActive); |
|
299 |
|
300 _LIT(KAttachment1, "C:\\mailtest\\IMCM\\rfc82201.txt"); |
|
301 _LIT(KAttachment2, "C:\\mailtest\\IMCM\\rfc82202.txt"); |
|
302 |
|
303 CImEmailMessage* imEmailMessage = CImEmailMessage::NewLC(*(testUtils->iMsvEntry)); |
|
304 testUtils->iMsvEntry->SetEntryL(messageId); |
|
305 CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); |
|
306 CleanupStack::PushL(attachmentInfo); |
|
307 imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment1, attachmentInfo, testActive->iStatus); |
|
308 CleanupStack::Pop(attachmentInfo); |
|
309 testActive->StartL(); |
|
310 CActiveScheduler::Start(); // wait for the asynch operation to complete |
|
311 |
|
312 if (testActive->iStatus.Int()) |
|
313 { |
|
314 testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed")); |
|
315 testUtils->TestHarnessFailed(testActive->iStatus.Int()); |
|
316 } |
|
317 |
|
318 testUtils->iMsvEntry->SetEntryL(messageId); |
|
319 attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); |
|
320 CleanupStack::PushL(attachmentInfo); |
|
321 imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment2, attachmentInfo, testActive->iStatus); |
|
322 CleanupStack::Pop(attachmentInfo); |
|
323 |
|
324 testActive->StartL(); |
|
325 CActiveScheduler::Start(); // wait for the asynch operation to complete |
|
326 |
|
327 if (testActive->iStatus.Int()) |
|
328 { |
|
329 testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed")); |
|
330 testUtils->TestHarnessFailed(testActive->iStatus.Int()); |
|
331 } |
|
332 const TDesC8& progBuf2 = imEmailMessage->ProgressL(); |
|
333 paramPack.Set(progBuf2); |
|
334 TMsvId attachmentId = paramPack(); |
|
335 |
|
336 CleanupStack::PopAndDestroy(2); // imEmailMessage, testActive |
|
337 |
|
338 // |
|
339 // Set the attachment to be not complete |
|
340 // |
|
341 |
|
342 testUtils->iMsvEntry->SetEntryL(attachmentId); |
|
343 TMsvEmailEntry attachmentEntry = testUtils->iMsvEntry->Entry(); |
|
344 attachmentEntry.SetComplete(EFalse); |
|
345 testUtils->iMsvEntry->ChangeL(attachmentEntry); |
|
346 |
|
347 return messageId; |
|
348 } |
|
349 |
|
350 LOCAL_C void DoHtmlCreateForwardAsAttachmentTestsL(TMsvId aMessageId) |
|
351 { |
|
352 TMsvPartList partList = 0; |
|
353 TMsvEmailTypeList emailTypeList = KMsvEmailTypeListMHTMLMessage; |
|
354 |
|
355 // |
|
356 // HTML Messages |
|
357 // |
|
358 testUtils->WriteComment(_L("\tHTML Create Forward Message Tests")); |
|
359 |
|
360 // basic new message with nothing! |
|
361 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
362 |
|
363 // only body |
|
364 partList = KMsvMessagePartBody; |
|
365 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
366 |
|
367 // only attachment |
|
368 partList = KMsvMessagePartAttachments; |
|
369 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
370 |
|
371 // only body and attachment |
|
372 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
373 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
374 |
|
375 // basic new message with subject |
|
376 partList = KMsvMessagePartDescription; |
|
377 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
378 |
|
379 // only body and subject |
|
380 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
381 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
382 |
|
383 // only attachment and subject |
|
384 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
385 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
386 |
|
387 // only body, attachment and subject |
|
388 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
389 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
390 |
|
391 // CImEmailOperation::CreateForwardL() just passes the following flags to CImHeader |
|
392 // KMsvMessagePartOriginator |
|
393 // KMsvMessagePartRecipient |
|
394 // basic new message with originator |
|
395 partList = KMsvMessagePartOriginator; |
|
396 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
397 |
|
398 // only body and originator |
|
399 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
400 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
401 |
|
402 // only attachment and originator |
|
403 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
404 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
405 |
|
406 // only body, attachment and originator |
|
407 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
408 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
409 |
|
410 // basic new message with subject and originator |
|
411 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
412 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
413 |
|
414 // only body, subject and originator |
|
415 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
416 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
417 |
|
418 // only attachment, subject and originator |
|
419 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
420 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
421 |
|
422 // only body, attachment, subject and originator |
|
423 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
424 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
425 |
|
426 // basic new message with recipients |
|
427 partList = KMsvMessagePartRecipient; |
|
428 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
429 |
|
430 // only body and recipients |
|
431 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
432 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
433 |
|
434 // only attachment and recipients |
|
435 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
436 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
437 |
|
438 // only body, attachment and recipients |
|
439 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
440 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
441 |
|
442 // basic new message with subject and recipients |
|
443 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
444 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
445 |
|
446 // only body, subject and recipients |
|
447 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
448 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
449 |
|
450 // only attachment, subject and recipients |
|
451 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
452 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
453 |
|
454 // only body, attachment, subject and recipients |
|
455 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
456 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
457 |
|
458 // basic new message with originator and recipients |
|
459 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
460 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
461 |
|
462 // only body, originator and recipients |
|
463 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
464 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
465 |
|
466 // only attachment, originator and recipients |
|
467 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
468 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
469 |
|
470 // only body, attachment, originator and recipients |
|
471 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
472 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
473 |
|
474 // basic new message with subject, originator and recipients |
|
475 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
476 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
477 |
|
478 // only body, subject, originator and recipients |
|
479 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
480 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
481 |
|
482 // only attachment, subject, originator and recipients |
|
483 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
484 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
485 |
|
486 // only body, attachment, subject, originator and recipients |
|
487 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
488 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
489 // Create a VCard and store in the SMTP settings |
|
490 SetAddVCardToEmailL(ETrue, smtpService); |
|
491 testUtils->WriteComment(_L("\tHTML Create Forward Message with VCard Tests")); |
|
492 |
|
493 // basic new message with VCard |
|
494 partList = 0; |
|
495 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
496 |
|
497 // only body and VCard |
|
498 partList = KMsvMessagePartBody; |
|
499 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
500 |
|
501 // only attachment and VCard |
|
502 partList = KMsvMessagePartAttachments; |
|
503 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
504 |
|
505 // only body, attachment and VCard |
|
506 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
507 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
508 |
|
509 // basic new message with subject and VCard |
|
510 partList = KMsvMessagePartDescription; |
|
511 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
512 |
|
513 // only body, subject and VCard |
|
514 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
515 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
516 |
|
517 // only attachment, subject and VCard |
|
518 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
519 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
520 |
|
521 // only body, attachment, subject and VCard |
|
522 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
523 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
524 |
|
525 // CImEmailOperation::CreateForwardL() just passes the following flags to CImHeader |
|
526 // KMsvMessagePartOriginator |
|
527 // KMsvMessagePartRecipient |
|
528 // basic new message with originator and VCard |
|
529 partList = KMsvMessagePartOriginator; |
|
530 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
531 |
|
532 // only body, originator and VCard |
|
533 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
534 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
535 |
|
536 // only attachment, originator and VCard |
|
537 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
538 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
539 |
|
540 // only body, attachment, originator and VCard |
|
541 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
542 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
543 |
|
544 // basic new message with subject, originator and VCard |
|
545 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
546 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
547 |
|
548 // only body, subject, originator and VCard |
|
549 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
550 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
551 |
|
552 // only attachment, subject, originator and VCard |
|
553 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
554 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
555 |
|
556 // only body, attachment, subject, originator and VCard |
|
557 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
558 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
559 |
|
560 // basic new message with recipients and VCard |
|
561 partList = KMsvMessagePartRecipient; |
|
562 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
563 |
|
564 // only body, recipients and VCard |
|
565 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
566 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
567 |
|
568 // only attachment, recipients and VCard |
|
569 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
570 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
571 |
|
572 // only body, attachment, recipients and VCard |
|
573 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
574 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
575 |
|
576 // basic new message with subject, recipients and VCard |
|
577 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
578 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
579 |
|
580 // only body, subject, recipients and VCard |
|
581 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
582 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
583 |
|
584 // only attachment, subject, recipients and VCard |
|
585 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
586 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
587 |
|
588 // only body, attachment, subject, recipients and VCard |
|
589 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
590 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
591 |
|
592 // basic new message with originator, recipients and VCard |
|
593 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
594 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
595 |
|
596 // only body, originator, recipients and VCard |
|
597 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
598 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
599 |
|
600 // only attachment, originator, recipients and VCard |
|
601 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
602 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
603 |
|
604 // only body, attachment, originator, recipients and VCard |
|
605 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
606 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
607 |
|
608 // basic new message with subject, originator, recipients and VCard |
|
609 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
610 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
611 |
|
612 // only body, subject, originator, recipients and VCard |
|
613 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
614 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
615 |
|
616 // only attachment, subject, originator, recipients and VCard |
|
617 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
618 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
619 |
|
620 // only body, attachment, subject, originator, recipients and VCard |
|
621 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
622 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
623 |
|
624 // Store signature in the SMTP settings |
|
625 SetAddVCardToEmailL(EFalse, smtpService); |
|
626 CreateSignatureL(smtpService); |
|
627 SetSignatureToEmailL(ETrue, smtpService); |
|
628 testUtils->WriteComment(_L("\tHTML Create Forward Message with signature Tests")); |
|
629 |
|
630 // basic new message with signature! |
|
631 partList = 0; |
|
632 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
633 |
|
634 // only body and signature |
|
635 partList = KMsvMessagePartBody; |
|
636 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
637 |
|
638 // only attachment and signature |
|
639 partList = KMsvMessagePartAttachments; |
|
640 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
641 |
|
642 // only body, attachment and signature |
|
643 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
644 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
645 |
|
646 // basic new message with subject and signature |
|
647 partList = KMsvMessagePartDescription; |
|
648 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
649 |
|
650 // only body, subject and signature |
|
651 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
652 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
653 |
|
654 // only attachment, subject and signature |
|
655 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
656 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
657 |
|
658 // only body, attachment, subject and signature |
|
659 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
660 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
661 |
|
662 // CImEmailOperation::CreateForwardL() just passes the following flags to CImHeader |
|
663 // KMsvMessagePartOriginator |
|
664 // KMsvMessagePartRecipient |
|
665 |
|
666 // basic new message with originator and signature |
|
667 partList = KMsvMessagePartOriginator; |
|
668 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
669 |
|
670 // only body, originator and signature |
|
671 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
672 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
673 |
|
674 // only attachment, originator and signature |
|
675 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
676 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
677 |
|
678 // only body, attachment, originator and signature |
|
679 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
680 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
681 |
|
682 // basic new message with subject, originator and signature |
|
683 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
684 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
685 |
|
686 // only body, subject, originator and signature |
|
687 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
688 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
689 |
|
690 // only attachment, subject, originator and signature |
|
691 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
692 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
693 |
|
694 // only body, attachment, subject, originator and signature |
|
695 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
696 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
697 |
|
698 // basic new message with recipients and signature |
|
699 partList = KMsvMessagePartRecipient; |
|
700 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
701 |
|
702 // only body, recipients and signature |
|
703 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
704 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
705 |
|
706 // only attachment, recipients and signature |
|
707 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
708 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
709 |
|
710 // only body, attachment, recipients and signature |
|
711 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
712 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
713 |
|
714 // basic new message with subject, recipients and signature |
|
715 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
716 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
717 |
|
718 // only body, subject, recipients and signature |
|
719 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
720 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
721 |
|
722 // only attachment, subject, recipients and signature |
|
723 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
724 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
725 |
|
726 // only body, attachment, subject, recipients and signature |
|
727 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
728 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
729 |
|
730 // basic new message with originator, recipients and signature |
|
731 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
732 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
733 |
|
734 // only body, originator, recipients and signature |
|
735 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
736 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
737 |
|
738 // only attachment, originator, recipients and signature |
|
739 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
740 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
741 |
|
742 // only body, attachment, originator, recipients and signature |
|
743 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
744 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
745 |
|
746 // basic new message with subject, originator, recipients and signature |
|
747 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
748 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
749 |
|
750 // only body, subject, originator, recipients and signature |
|
751 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
752 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
753 |
|
754 // only attachment, subject, originator, recipients and signature |
|
755 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
756 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
757 |
|
758 // only body, attachment, subject, originator, recipients and signature |
|
759 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
760 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
761 |
|
762 // Create a VCard and store in the SMTP settings |
|
763 SetAddVCardToEmailL(ETrue, smtpService); |
|
764 testUtils->WriteComment(_L("\tHTML Create Forward Message with VCard and signature Tests")); |
|
765 |
|
766 // basic new message with VCard and Signature! |
|
767 partList = 0; |
|
768 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
769 |
|
770 // only body, VCard and Signature |
|
771 partList = KMsvMessagePartBody; |
|
772 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
773 |
|
774 // only attachment, VCard and Signature |
|
775 partList = KMsvMessagePartAttachments; |
|
776 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
777 |
|
778 // only body, attachment, VCard and Signature |
|
779 partList = KMsvMessagePartBody | KMsvMessagePartAttachments; |
|
780 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
781 |
|
782 // basic new message with subject, VCard and Signature |
|
783 partList = KMsvMessagePartDescription; |
|
784 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
785 |
|
786 // only body, subject, VCard and Signature |
|
787 partList = KMsvMessagePartBody | KMsvMessagePartDescription; |
|
788 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
789 |
|
790 // only attachment, subject, VCard and Signature |
|
791 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
792 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
793 |
|
794 // only body, attachment, subject, VCard and Signature |
|
795 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription; |
|
796 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
797 |
|
798 // CImEmailOperation::CreateForwardL() just passes the following flags to CImHeader |
|
799 // KMsvMessagePartOriginator |
|
800 // KMsvMessagePartRecipient |
|
801 // basic new message with originator, VCard and Signature |
|
802 partList = KMsvMessagePartOriginator; |
|
803 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
804 |
|
805 // only body, originator, VCard and Signature |
|
806 partList = KMsvMessagePartBody | KMsvMessagePartOriginator; |
|
807 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
808 |
|
809 // only attachment, originator, VCard and Signature |
|
810 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
811 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
812 |
|
813 // only body, attachment, originator, VCard and Signature |
|
814 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator; |
|
815 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
816 |
|
817 // basic new message with subject, originator, VCard and Signature |
|
818 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
819 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
820 |
|
821 // only body, subject, originator, VCard and Signature |
|
822 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
823 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
824 |
|
825 // only attachment, subject, originator, VCard and Signature |
|
826 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
827 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
828 |
|
829 // only body, attachment, subject, originator, VCard and Signature |
|
830 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator; |
|
831 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
832 |
|
833 // basic new message with recipients, VCard and Signature |
|
834 partList = KMsvMessagePartRecipient; |
|
835 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
836 |
|
837 // only body, recipients, VCard and Signature |
|
838 partList = KMsvMessagePartBody | KMsvMessagePartRecipient; |
|
839 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
840 |
|
841 // only attachment, recipients, VCard and Signature |
|
842 partList = KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
843 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
844 |
|
845 // only body, attachment, recipients, VCard and Signature |
|
846 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartRecipient; |
|
847 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
848 |
|
849 // basic new message with subject, recipients, VCard and Signature |
|
850 partList = KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
851 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
852 |
|
853 // only body, subject, recipients, VCard and Signature |
|
854 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
855 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
856 |
|
857 // only attachment, subject, recipients, VCard and Signature |
|
858 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
859 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
860 |
|
861 // only body, attachment, subject, recipients, VCard and Signature |
|
862 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartRecipient; |
|
863 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
864 |
|
865 // basic new message with originator, recipients, VCard and Signature |
|
866 partList = KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
867 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
868 |
|
869 // only body, originator, recipients, VCard and Signature |
|
870 partList = KMsvMessagePartBody | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
871 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
872 |
|
873 // only attachment, originator, recipients, VCard and Signature |
|
874 partList = KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
875 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
876 |
|
877 // only body, attachment, originator, recipients, VCard and Signature |
|
878 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
879 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
880 |
|
881 // basic new message with subject, originator, recipients, VCard and Signature |
|
882 partList = KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
883 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
884 |
|
885 // only body, subject, originator, recipients, VCard and Signature |
|
886 partList = KMsvMessagePartBody | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
887 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
888 |
|
889 // only attachment, subject, originator, recipients, VCard and Signature |
|
890 partList = KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
891 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
892 |
|
893 // only body, attachment, subject, originator, recipients, VCard and Signature |
|
894 partList = KMsvMessagePartBody | KMsvMessagePartAttachments | KMsvMessagePartDescription | KMsvMessagePartOriginator | KMsvMessagePartRecipient; |
|
895 CreateForwardL(aMessageId, partList, emailTypeList, testNo++); |
|
896 } |
|
897 |
|
898 LOCAL_C TBool CompareLogsL() |
|
899 { |
|
900 TBool errorOccured = EFalse; |
|
901 |
|
902 CDesCArray* correctFile = new (ELeave) CDesCArrayFlat(1); |
|
903 CPtrCArray* resultFile = new (ELeave) CPtrCArray(1); |
|
904 |
|
905 TParse parsedFileName; |
|
906 TParse parsedResultFileName; |
|
907 TFileName name; |
|
908 name.Append(KOkFileNameEntryStructure); |
|
909 testUtils->ResolveFile(KComponent, name, parsedFileName); |
|
910 correctFile->AppendL(parsedFileName.FullName()); |
|
911 name.Zero(); |
|
912 name.Copy(KFileNameEntryStructure); |
|
913 testUtils->ResolveLogFile(name, parsedResultFileName); |
|
914 resultFile->AppendL(parsedResultFileName.FullName()); |
|
915 |
|
916 RFileReadStream file1; |
|
917 RFileReadStream file2; |
|
918 HBufC8* line1Buffer = HBufC8::NewLC(1024); |
|
919 TPtr8 line1 = line1Buffer->Des(); |
|
920 TBuf8<1> aChar1; |
|
921 |
|
922 HBufC8* line2Buffer = HBufC8::NewLC(1024); |
|
923 TPtr8 line2 = line2Buffer->Des(); |
|
924 TBuf8<1> aChar2; |
|
925 |
|
926 for(TInt i=0; i<correctFile->MdcaCount(); i++) |
|
927 { |
|
928 TFileName file1Name = correctFile->MdcaPoint(i); |
|
929 |
|
930 TFileName file2Name = resultFile->MdcaPoint(i); |
|
931 |
|
932 TInt error1=KErrNone; |
|
933 TInt error2=KErrNone; |
|
934 |
|
935 test.Printf(_L("\n%s"), file2Name.PtrZ()); |
|
936 |
|
937 error1=file1.Open(testUtils->FileSession(), file1Name, EFileShareAny); |
|
938 if(error1!=KErrNone) |
|
939 { |
|
940 errorOccured = ETrue; |
|
941 } |
|
942 else |
|
943 { |
|
944 error2=file2.Open(testUtils->FileSession(), file2Name, EFileShareAny); |
|
945 if(error2!=KErrNone) |
|
946 { |
|
947 errorOccured = ETrue; |
|
948 } |
|
949 } |
|
950 |
|
951 if((error1==KErrNone)&&(error2==KErrNone)) |
|
952 { |
|
953 // read the file into the conversion object |
|
954 TBool finished = EFalse; |
|
955 |
|
956 do { |
|
957 line1.FillZ(); |
|
958 line1.SetLength(0); |
|
959 // compile the lines one char at a time |
|
960 do { |
|
961 TRAPD( error, file1.ReadL(aChar1, 1) ); |
|
962 if (error!=KErrEof) |
|
963 line1.Append(aChar1); |
|
964 else |
|
965 { |
|
966 finished = ETrue; |
|
967 break; |
|
968 } |
|
969 // stop at the end of line or no more data |
|
970 } |
|
971 while((aChar1[0]!=0x0A)&&(line1.Length()<1024)); |
|
972 |
|
973 line2.FillZ(); |
|
974 line2.SetLength(0); |
|
975 do { |
|
976 TRAPD( error, file2.ReadL(aChar2, 1) ); |
|
977 if (error!=KErrEof) |
|
978 line2.Append(aChar2); |
|
979 else |
|
980 { |
|
981 finished = ETrue; |
|
982 break; |
|
983 } |
|
984 // stop at the end of line or no more data |
|
985 } |
|
986 while((aChar2[0]!=0x0A)&&(line2.Length()<1024)); |
|
987 |
|
988 // get rid of white space |
|
989 line1.TrimRight(); |
|
990 line2.TrimRight(); |
|
991 |
|
992 if(line1.Compare(line2) != 0) |
|
993 { |
|
994 // error so no point in continuing to compare!! |
|
995 errorOccured = ETrue; |
|
996 file1.Close(); |
|
997 file2.Close(); |
|
998 delete correctFile; |
|
999 delete resultFile; |
|
1000 CleanupStack::PopAndDestroy(2); //line 1 , line 2 |
|
1001 return ETrue; |
|
1002 } |
|
1003 } |
|
1004 while(!finished); |
|
1005 } |
|
1006 |
|
1007 file1.Close(); |
|
1008 file2.Close(); |
|
1009 } |
|
1010 |
|
1011 delete correctFile; |
|
1012 delete resultFile; |
|
1013 CleanupStack::PopAndDestroy(2); //line 1 , line 2 |
|
1014 |
|
1015 return errorOccured; |
|
1016 } |
|
1017 |
|
1018 LOCAL_C void doMainL() |
|
1019 { |
|
1020 SetKnownDateAndTime(); |
|
1021 InitL(); |
|
1022 if (testFailed) |
|
1023 { |
|
1024 Closedown(); |
|
1025 return; |
|
1026 } |
|
1027 testUtils->GoClientSideL(); |
|
1028 smtpService = testUtils->CreateSmtpServiceL(); |
|
1029 pop3Service = testUtils->CreatePopServiceL(); |
|
1030 testUtils->GoServerSideL(); |
|
1031 |
|
1032 testUtils->CreateMessageFilesL(pop3Service, KMsvGlobalInBoxIndexEntryId, _L("c:\\mailtest\\IMCM\\")); |
|
1033 |
|
1034 test.Console()->SetPos(0, 6); |
|
1035 test.Printf(_L("Performing Tests:\n")); |
|
1036 |
|
1037 testUtils->GoClientSideL(); |
|
1038 |
|
1039 SetDefaultServiceL(smtpService); |
|
1040 |
|
1041 // get a list of all email messages in the Inbox |
|
1042 testUtils->iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId); |
|
1043 delete messageSelection; |
|
1044 messageSelection = testUtils->iMsvEntry->ChildrenWithTypeL(KUidMsvMessageEntry); |
|
1045 |
|
1046 TParse parsedFileName; |
|
1047 TFileName name(KTestMessageDir); |
|
1048 testUtils->ResolveLogFile(name, parsedFileName); |
|
1049 |
|
1050 |
|
1051 TMsvId messageWithIncompleteAttachment = CreateNewPlaintextMessageWithIncompleteAttachmentL(); |
|
1052 |
|
1053 SetKnownDateAndTime(); |
|
1054 test.Console()->SetPos(3, 8); |
|
1055 test.Printf(_L("Create Forward Tests 1:")); |
|
1056 //Create Forward As Attachment html message with attachment and no text alternative to the HTML |
|
1057 testUtils->WriteComment(_L("Test 2 - Create Forward As Atcmt to HTML message with atcmt and no text alt. Tests")); |
|
1058 TRAPD(ret,DoHtmlCreateForwardAsAttachmentTestsL(messageSelection->At(3))); |
|
1059 if (ret) |
|
1060 { |
|
1061 testUtils->TestFinish(testNo,ret); |
|
1062 testUtils->TestHarnessFailed(ret); |
|
1063 delete messageSelection; |
|
1064 Closedown(); |
|
1065 return; |
|
1066 } |
|
1067 |
|
1068 SetKnownDateAndTime(); |
|
1069 |
|
1070 test.Console()->SetPos(3, 9); |
|
1071 test.Printf(_L("Create Forward Tests 2:")); |
|
1072 //Create Forward As Attachment message with attachment which is not complete |
|
1073 testUtils->WriteComment(_L("Test 2 - Create Forward As Atcmt to Plaintext message with incomplete atcmt Tests")); |
|
1074 messageWithIncompleteAttachment = CreateNewPlaintextMessageWithIncompleteAttachmentL(); |
|
1075 TRAP(ret,DoHtmlCreateForwardAsAttachmentTestsL(messageWithIncompleteAttachment)); |
|
1076 if (ret) |
|
1077 { |
|
1078 testUtils->TestFinish(testNo,ret); |
|
1079 testUtils->TestHarnessFailed(ret); |
|
1080 delete messageSelection; |
|
1081 Closedown(); |
|
1082 return; |
|
1083 } |
|
1084 |
|
1085 RestoreDateAndTime(); |
|
1086 |
|
1087 testUtils->FindChildrenL(KMsvGlobalOutBoxIndexEntryId, parsedFileName.FullName(), ETrue, EFalse); // writes message info (from Outbox) into files |
|
1088 |
|
1089 testUtils->TestFinish(testNo-1); |
|
1090 testUtils->TestHarnessCompleted(); |
|
1091 |
|
1092 delete messageSelection; |
|
1093 Closedown(); |
|
1094 // shouldn't have to do this, but convertor plugins aren't |
|
1095 // doing it yet so we get a false memory leak so remove this |
|
1096 // when they fix that. |
|
1097 REComSession::FinalClose(); |
|
1098 } |
|
1099 |
|
1100 GLDEF_C TInt E32Main() |
|
1101 { |
|
1102 __UHEAP_MARK; |
|
1103 test.Start(_L("T_IMCM02d2 Test CImEmailOperation class\n")); |
|
1104 theCleanup=CTrapCleanup::New(); |
|
1105 TRAPD(ret,doMainL()); |
|
1106 test(ret==KErrNone); |
|
1107 RestoreDateAndTime(); |
|
1108 delete theCleanup; |
|
1109 test.End(); |
|
1110 test.Close(); |
|
1111 __UHEAP_MARKEND; |
|
1112 User::Heap().Check(); |
|
1113 return(KErrNone); |
|
1114 } |