|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "ctestsmtpmobilityaccounts.h" |
|
17 #include <cemailaccounts.h> |
|
18 #include <smtpset.h> |
|
19 #include <pop3set.h> |
|
20 #include <imapset.h> |
|
21 #include <iapprefs.h> |
|
22 #include <cimsmtpmobilitysettings.h> |
|
23 |
|
24 _LIT(KSmtpAcc1Name, "SMTP Acc 1"); |
|
25 _LIT(KSmtpAcc2Name, "SMTP Acc 2"); |
|
26 _LIT(KSmtpAcc3Name, "SMTP Acc 3"); |
|
27 _LIT(KMobAcc1Name, "Mob Acc 1"); |
|
28 _LIT(KMobAcc2Name, "Mob Acc 2"); |
|
29 _LIT(KMobAcc3Name, "Mob Acc 3"); |
|
30 _LIT(KPopAcc1Name, "POP Acc 1"); |
|
31 _LIT(KPopAcc2Name, "POP Acc 2"); |
|
32 _LIT(KImapAcc1Name, "IMAP Acc 1"); |
|
33 _LIT(KImapAcc2Name, "IMAP Acc 1"); |
|
34 _LIT8(KSmtpLoginName, "SMTP Login"); |
|
35 _LIT8(KMobLoginName, "Mob Login"); |
|
36 _LIT8(KTestLoginName, "TestLoginName"); |
|
37 |
|
38 /** |
|
39 Constructor |
|
40 */ |
|
41 CTestSmtpMobilityAccounts::CTestSmtpMobilityAccounts() |
|
42 { |
|
43 } |
|
44 |
|
45 /** |
|
46 Destructor |
|
47 */ |
|
48 CTestSmtpMobilityAccounts::~CTestSmtpMobilityAccounts() |
|
49 { |
|
50 delete iEmailAccounts; |
|
51 delete iSmtpAccSettings; |
|
52 delete iIapPrefs; |
|
53 delete iMobAccSettings; |
|
54 iIapList.Close(); |
|
55 } |
|
56 |
|
57 /** |
|
58 Test setup |
|
59 */ |
|
60 void CTestSmtpMobilityAccounts::SetupL() |
|
61 { |
|
62 iEmailAccounts = CEmailAccounts::NewL(); |
|
63 |
|
64 iSmtpAccSettings = new (ELeave) CImSmtpSettings(); |
|
65 iIapPrefs = CImIAPPreferences::NewLC(); |
|
66 CleanupStack::Pop(iIapPrefs); |
|
67 iEmailAccounts->PopulateDefaultSmtpSettingsL(*iSmtpAccSettings, *iIapPrefs); |
|
68 iSmtpAccSettings->SetLoginNameL(KSmtpLoginName); |
|
69 |
|
70 iMobAccSettings = CImSmtpMobilitySettings::NewL(); |
|
71 iEmailAccounts->PopulateDefaultSmtpMobilitySettingsL(*iMobAccSettings); |
|
72 iMobAccSettings->SetLoginNameL(KMobLoginName); |
|
73 |
|
74 TImIAPChoice iapChoice; |
|
75 iapChoice.iIAP = 1; |
|
76 iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt; |
|
77 iIapPrefs->AddIAPL(iapChoice, 0); |
|
78 |
|
79 iIapList.AppendL(1); |
|
80 |
|
81 ResetAccountsL(); |
|
82 } |
|
83 |
|
84 /** |
|
85 Test cleanup |
|
86 */ |
|
87 void CTestSmtpMobilityAccounts::TearDownL() |
|
88 { |
|
89 ResetAccountsL(); |
|
90 |
|
91 delete iEmailAccounts; |
|
92 iEmailAccounts = NULL; |
|
93 |
|
94 delete iSmtpAccSettings; |
|
95 iSmtpAccSettings = NULL; |
|
96 |
|
97 delete iMobAccSettings; |
|
98 iMobAccSettings = NULL; |
|
99 |
|
100 delete iIapPrefs; |
|
101 iIapPrefs = NULL; |
|
102 |
|
103 iIapList.Reset(); |
|
104 } |
|
105 |
|
106 /** |
|
107 Delete all email accounts |
|
108 */ |
|
109 void CTestSmtpMobilityAccounts::ResetAccountsL() |
|
110 { |
|
111 RArray<TPopAccount> popAccounts; |
|
112 CleanupClosePushL(popAccounts); |
|
113 iEmailAccounts->GetPopAccountsL(popAccounts); |
|
114 for (TInt count = 0; count < popAccounts.Count(); ++count) |
|
115 { |
|
116 iEmailAccounts->DeletePopAccountL(popAccounts[count]); |
|
117 } |
|
118 CleanupStack::PopAndDestroy(&popAccounts); |
|
119 |
|
120 RArray<TImapAccount> imapAccounts; |
|
121 CleanupClosePushL(imapAccounts); |
|
122 iEmailAccounts->GetImapAccountsL(imapAccounts); |
|
123 for (TInt count = 0; count < imapAccounts.Count(); ++count) |
|
124 { |
|
125 iEmailAccounts->DeleteImapAccountL(imapAccounts[count]); |
|
126 } |
|
127 CleanupStack::PopAndDestroy(&imapAccounts); |
|
128 |
|
129 RArray<TSmtpAccount> smtpAccounts; |
|
130 CleanupClosePushL(smtpAccounts); |
|
131 iEmailAccounts->GetSmtpAccountsL(smtpAccounts); |
|
132 for (TInt count = 0; count < smtpAccounts.Count(); ++count) |
|
133 { |
|
134 iEmailAccounts->DeleteSmtpAccountL(smtpAccounts[count]); |
|
135 } |
|
136 CleanupStack::PopAndDestroy(&smtpAccounts); |
|
137 } |
|
138 |
|
139 /** |
|
140 Check number of SMTP accounts matches expected value |
|
141 |
|
142 @param aNum Number expected |
|
143 */ |
|
144 void CTestSmtpMobilityAccounts::CheckNumberSMTPAccountsL(TInt aNum) |
|
145 { |
|
146 RArray<TSmtpAccount> accounts; |
|
147 CleanupClosePushL(accounts); |
|
148 iEmailAccounts->GetSmtpAccountsL(accounts); |
|
149 ASSERT_EQUALS(aNum, accounts.Count()); |
|
150 CleanupStack::PopAndDestroy(&accounts); |
|
151 } |
|
152 |
|
153 /** |
|
154 Check SMTP account settings match expected values |
|
155 |
|
156 @param aAcount Account to check |
|
157 @param aSettings Settings to compare against |
|
158 */ |
|
159 void CTestSmtpMobilityAccounts::CheckSmtpAccountSettingsL(TSmtpAccount aAccount, const CImSmtpSettings& aSettings) |
|
160 { |
|
161 CImSmtpSettings* settings = new (ELeave) CImSmtpSettings(); |
|
162 CleanupStack::PushL(settings); |
|
163 |
|
164 iEmailAccounts->LoadSmtpSettingsL(aAccount, *settings); |
|
165 |
|
166 ASSERT_EQUALS(*settings, aSettings); |
|
167 |
|
168 CleanupStack::PopAndDestroy(settings); |
|
169 } |
|
170 |
|
171 /** |
|
172 Check number of SMTP mobility accounts matches expected value |
|
173 |
|
174 @param aNum Number expected |
|
175 */ |
|
176 void CTestSmtpMobilityAccounts::CheckNumberMobilityAccountsL(TInt aNum) |
|
177 { |
|
178 RArray<TSmtpMobilityAccount> accounts; |
|
179 CleanupClosePushL(accounts); |
|
180 iEmailAccounts->GetSmtpMobilityAccountsL(accounts); |
|
181 ASSERT_EQUALS(aNum, accounts.Count()); |
|
182 CleanupStack::PopAndDestroy(&accounts); |
|
183 } |
|
184 |
|
185 /** |
|
186 Check number of SMTP mobility accounts matches expected value for a |
|
187 given parent SMTP account |
|
188 |
|
189 @param aNum Number expected |
|
190 @param aSmtpAcc SMTP account |
|
191 */ |
|
192 void CTestSmtpMobilityAccounts::CheckNumberMobilityAccountsL(TInt aNum, TSmtpAccount aSmtpAcc) |
|
193 { |
|
194 RArray<TSmtpMobilityAccount> accounts; |
|
195 CleanupClosePushL(accounts); |
|
196 iEmailAccounts->GetSmtpMobilityAccountsL(aSmtpAcc, accounts); |
|
197 ASSERT_EQUALS(aNum, accounts.Count()); |
|
198 CleanupStack::PopAndDestroy(&accounts); |
|
199 } |
|
200 |
|
201 /** |
|
202 Check mobility account details match expected values. |
|
203 Looks up the account given the account name, and checks the settings, |
|
204 IAP list, and read only flag. |
|
205 |
|
206 @param aAccName Account name |
|
207 @param aSmtpSettings Expected settings |
|
208 @param aIapList Expected IAP list |
|
209 @param aReadOnly Expected read only flag value |
|
210 @param aSmtpAcc Parent SMTP account |
|
211 */ |
|
212 void CTestSmtpMobilityAccounts::CheckMobilityAccountDetailsL(const TDesC& aAccName, const CImSmtpSettings& aSmtpSettings, const RArrayIAP& aIapList, TBool aReadOnly, TSmtpAccount aSmtpAcc) |
|
213 { |
|
214 RArray<TSmtpMobilityAccount> accounts; |
|
215 CleanupClosePushL(accounts); |
|
216 iEmailAccounts->GetSmtpMobilityAccountsL(aSmtpAcc, accounts); |
|
217 for (TInt count = 0; count < accounts.Count(); ++count) |
|
218 { |
|
219 if (accounts[count].iName.Compare(aAccName) == 0) |
|
220 { |
|
221 CImSmtpMobilitySettings* mobAccSettings = CImSmtpMobilitySettings::NewLC(); |
|
222 iEmailAccounts->LoadSmtpMobilitySettingsL(accounts[count], *mobAccSettings); |
|
223 ASSERT_EQUALS(mobAccSettings->SmtpSettings(), aSmtpSettings); |
|
224 CleanupStack::PopAndDestroy(mobAccSettings); |
|
225 |
|
226 RArrayIAP iapList; |
|
227 CleanupClosePushL(iapList); |
|
228 iEmailAccounts->LoadSmtpMobilityAccountIapListL(accounts[count], iapList); |
|
229 ASSERT_EQUALS(iapList.Count(), aIapList.Count()); |
|
230 for (TInt iap = 0; iap < iapList.Count(); ++iap) |
|
231 { |
|
232 ASSERT_EQUALS(iapList[iap], aIapList[iap]); |
|
233 } |
|
234 CleanupStack::PopAndDestroy(&iapList); |
|
235 |
|
236 TBool isReadOnly = iEmailAccounts->IsAccountReadOnlyL(accounts[count]); |
|
237 ASSERT_EQUALS(isReadOnly, aReadOnly); |
|
238 CleanupStack::PopAndDestroy(&accounts); |
|
239 return; |
|
240 } |
|
241 } |
|
242 |
|
243 // Account not found, so signal a failure |
|
244 ASSERT_TRUE(EFalse); |
|
245 |
|
246 CleanupStack::PopAndDestroy(&accounts); |
|
247 } |
|
248 |
|
249 /** |
|
250 Checks that mobility account does not exist |
|
251 |
|
252 @param aAccName Mobility account name |
|
253 */ |
|
254 void CTestSmtpMobilityAccounts::CheckMobilityAccountMissingL(const TDesC& aAccName) |
|
255 { |
|
256 TBool found = EFalse; |
|
257 |
|
258 RArray<TSmtpMobilityAccount> accounts; |
|
259 CleanupClosePushL(accounts); |
|
260 iEmailAccounts->GetSmtpMobilityAccountsL(accounts); |
|
261 for (TInt count = 0; count < accounts.Count(); ++count) |
|
262 { |
|
263 if (accounts[count].iName.Compare(aAccName) == 0) |
|
264 { |
|
265 found = ETrue; |
|
266 break; |
|
267 } |
|
268 } |
|
269 |
|
270 CleanupStack::PopAndDestroy(&accounts); |
|
271 |
|
272 ASSERT_FALSE(found); |
|
273 } |
|
274 |
|
275 /** |
|
276 @SYMTestCaseID SMTP-MOB-BASE-0001 |
|
277 @SYMTestType CIT |
|
278 @SYMPREQ PREQ1307 |
|
279 @SYMREQ REQ6981 |
|
280 @SYMTestCaseDesc Tests SMTP account operations |
|
281 */ |
|
282 void CTestSmtpMobilityAccounts::TestSmtpAccountL() |
|
283 { |
|
284 INFO_PRINTF1(_L("TestSmtpAccountL - Start")); |
|
285 |
|
286 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
287 |
|
288 CheckNumberSMTPAccountsL(1); |
|
289 |
|
290 // Load SMTP settings |
|
291 CImSmtpSettings* smtpAccSettings = new (ELeave) CImSmtpSettings(); |
|
292 CleanupStack::PushL(smtpAccSettings); |
|
293 iEmailAccounts->LoadSmtpSettingsL(smtpAcc, *smtpAccSettings); |
|
294 |
|
295 // Check SMTP settings |
|
296 ASSERT_EQUALS(*iSmtpAccSettings, *smtpAccSettings); |
|
297 |
|
298 // Load IAP settings |
|
299 CImIAPPreferences* iapPrefs = CImIAPPreferences::NewLC(); |
|
300 iEmailAccounts->LoadSmtpIapSettingsL(smtpAcc, *iapPrefs); |
|
301 |
|
302 // Check IAP settings |
|
303 ASSERT_EQUALS(iapPrefs->NumberOfIAPs(), iIapPrefs->NumberOfIAPs()); |
|
304 TImIAPChoice iapChoice1; |
|
305 TImIAPChoice iapChoice2; |
|
306 for (TInt count = 0; count < iapPrefs->NumberOfIAPs(); ++count) |
|
307 { |
|
308 iapChoice1 = iapPrefs->IAPPreference(count); |
|
309 iapChoice2 = iIapPrefs->IAPPreference(count); |
|
310 ASSERT_EQUALS(iapChoice1.iIAP, iapChoice2.iIAP); |
|
311 ASSERT_EQUALS(iapChoice1.iDialogPref, iapChoice2.iDialogPref); |
|
312 } |
|
313 |
|
314 // Save new IAP settings |
|
315 iIapPrefs->RemoveIAPL(0); |
|
316 TImIAPChoice iapChoice; |
|
317 iapChoice.iIAP = 2; |
|
318 iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt; |
|
319 iIapPrefs->AddIAPL(iapChoice, 0); |
|
320 iEmailAccounts->SaveSmtpIapSettingsL(smtpAcc, *iIapPrefs); |
|
321 |
|
322 // Save new SMTP settings |
|
323 iSmtpAccSettings->SetLoginNameL(KTestLoginName); |
|
324 iEmailAccounts->SaveSmtpSettingsL(smtpAcc, *iSmtpAccSettings); |
|
325 |
|
326 iEmailAccounts->LoadSmtpIapSettingsL(smtpAcc, *iapPrefs); |
|
327 |
|
328 // Check IAP settings |
|
329 ASSERT_EQUALS(iapPrefs->NumberOfIAPs(), iIapPrefs->NumberOfIAPs()); |
|
330 for (TInt count = 0; count < iapPrefs->NumberOfIAPs(); ++count) |
|
331 { |
|
332 iapChoice1 = iapPrefs->IAPPreference(count); |
|
333 iapChoice2 = iIapPrefs->IAPPreference(count); |
|
334 ASSERT_EQUALS(iapChoice1.iIAP, iapChoice2.iIAP); |
|
335 ASSERT_EQUALS(iapChoice1.iDialogPref, iapChoice2.iDialogPref); |
|
336 } |
|
337 |
|
338 CheckSmtpAccountSettingsL(smtpAcc, *iSmtpAccSettings); |
|
339 |
|
340 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
341 |
|
342 CheckNumberSMTPAccountsL(0); |
|
343 |
|
344 CleanupStack::PopAndDestroy(2, smtpAccSettings); |
|
345 |
|
346 INFO_PRINTF1(_L("TestSmtpAccountL - End")); |
|
347 } |
|
348 |
|
349 /** |
|
350 @SYMTestCaseID SMTP-MOB-PAR-ACC-0001 |
|
351 @SYMTestType CIT |
|
352 @SYMPREQ PREQ1307 |
|
353 @SYMREQ REQ6981 |
|
354 @SYMTestCaseDesc Tests adding single SMTP mobility account |
|
355 */ |
|
356 void CTestSmtpMobilityAccounts::Test1MobilityAccountL() |
|
357 { |
|
358 INFO_PRINTF1(_L("Test1MobilityAccountL - Start")); |
|
359 |
|
360 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
361 |
|
362 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
363 |
|
364 CheckNumberMobilityAccountsL(1); |
|
365 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
366 |
|
367 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
368 |
|
369 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
370 |
|
371 CheckNumberMobilityAccountsL(0); |
|
372 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
373 |
|
374 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
375 |
|
376 CheckNumberSMTPAccountsL(1); |
|
377 |
|
378 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
379 |
|
380 INFO_PRINTF1(_L("Test1MobilityAccountL - End")); |
|
381 } |
|
382 |
|
383 /** |
|
384 @SYMTestCaseID SMTP-MOB-PAR-ACC-0002 |
|
385 @SYMTestType CIT |
|
386 @SYMPREQ PREQ1307 |
|
387 @SYMREQ REQ6981 |
|
388 @SYMTestCaseDesc Tests adding single SMTP mobility account and deleting parent |
|
389 */ |
|
390 void CTestSmtpMobilityAccounts::Test1MobilityAccountWithParentDeletionL() |
|
391 { |
|
392 INFO_PRINTF1(_L("Test1MobilityAccountWithParentDeletionL - Start")); |
|
393 |
|
394 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
395 |
|
396 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
397 |
|
398 CheckNumberMobilityAccountsL(1); |
|
399 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
400 |
|
401 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
402 |
|
403 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
404 |
|
405 CheckNumberMobilityAccountsL(0); |
|
406 |
|
407 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
408 |
|
409 CheckNumberSMTPAccountsL(0); |
|
410 |
|
411 INFO_PRINTF1(_L("Test1MobilityAccountWithParentDeletionL - End")); |
|
412 } |
|
413 |
|
414 /** |
|
415 @SYMTestCaseID SMTP-MOB-PAR-ACC-0003 |
|
416 @SYMTestType CIT |
|
417 @SYMPREQ PREQ1307 |
|
418 @SYMREQ REQ6981 |
|
419 @SYMTestCaseDesc Tests adding 2 SMTP mobility accounts |
|
420 */ |
|
421 void CTestSmtpMobilityAccounts::Test2MobilityAccountsL() |
|
422 { |
|
423 INFO_PRINTF1(_L("Test2MobilityAccountsL - Start")); |
|
424 |
|
425 TSmtpAccount smtpAcc1 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
426 TSmtpAccount smtpAcc2 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
427 |
|
428 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc1, *iMobAccSettings, EFalse); |
|
429 |
|
430 RArrayIAP iapList; |
|
431 CleanupClosePushL(iapList); |
|
432 iapList.AppendL(2); |
|
433 |
|
434 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc2, *iMobAccSettings, ETrue); |
|
435 |
|
436 CheckNumberMobilityAccountsL(2); |
|
437 CheckNumberMobilityAccountsL(1, smtpAcc1); |
|
438 CheckNumberMobilityAccountsL(1, smtpAcc2); |
|
439 |
|
440 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc1); |
|
441 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc2); |
|
442 |
|
443 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
444 |
|
445 CheckNumberMobilityAccountsL(1); |
|
446 CheckNumberMobilityAccountsL(1, smtpAcc1); |
|
447 CheckNumberMobilityAccountsL(0, smtpAcc2); |
|
448 |
|
449 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
450 |
|
451 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc1); |
|
452 |
|
453 CheckNumberSMTPAccountsL(2); |
|
454 |
|
455 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
456 |
|
457 CheckNumberMobilityAccountsL(0); |
|
458 CheckNumberMobilityAccountsL(0, smtpAcc1); |
|
459 CheckNumberMobilityAccountsL(0, smtpAcc2); |
|
460 |
|
461 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
462 |
|
463 CheckNumberSMTPAccountsL(2); |
|
464 |
|
465 CheckSmtpAccountSettingsL(smtpAcc1, *iSmtpAccSettings); |
|
466 CheckSmtpAccountSettingsL(smtpAcc2, *iSmtpAccSettings); |
|
467 |
|
468 iEmailAccounts->DeleteSmtpAccountL(smtpAcc1); |
|
469 iEmailAccounts->DeleteSmtpAccountL(smtpAcc2); |
|
470 |
|
471 CleanupStack::PopAndDestroy(&iapList); |
|
472 |
|
473 INFO_PRINTF1(_L("Test2MobilityAccountsL - End")); |
|
474 } |
|
475 |
|
476 /** |
|
477 @SYMTestCaseID SMTP-MOB-PAR-ACC-0004 |
|
478 @SYMTestType CIT |
|
479 @SYMPREQ PREQ1307 |
|
480 @SYMREQ REQ6981 |
|
481 @SYMTestCaseDesc Tests adding 2 SMTP mobility accounts and deleting parents |
|
482 */ |
|
483 void CTestSmtpMobilityAccounts::Test2MobilityAccountsWithParentDeletionL() |
|
484 { |
|
485 INFO_PRINTF1(_L("Test2MobilityAccountsWithParentDeletionL - Start")); |
|
486 |
|
487 TSmtpAccount smtpAcc1 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
488 TSmtpAccount smtpAcc2 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
489 |
|
490 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc1, *iMobAccSettings, EFalse); |
|
491 |
|
492 RArrayIAP iapList; |
|
493 CleanupClosePushL(iapList); |
|
494 iapList.AppendL(2); |
|
495 |
|
496 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc2, *iMobAccSettings, ETrue); |
|
497 |
|
498 CheckNumberMobilityAccountsL(2); |
|
499 CheckNumberMobilityAccountsL(1, smtpAcc1); |
|
500 CheckNumberMobilityAccountsL(1, smtpAcc2); |
|
501 |
|
502 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc1); |
|
503 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc2); |
|
504 |
|
505 iEmailAccounts->DeleteSmtpAccountL(smtpAcc2); |
|
506 |
|
507 CheckNumberMobilityAccountsL(1); |
|
508 CheckNumberMobilityAccountsL(1, smtpAcc1); |
|
509 |
|
510 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
511 |
|
512 CheckNumberSMTPAccountsL(1); |
|
513 |
|
514 iEmailAccounts->DeleteSmtpAccountL(smtpAcc1); |
|
515 |
|
516 CheckNumberMobilityAccountsL(0); |
|
517 |
|
518 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
519 |
|
520 CheckNumberSMTPAccountsL(0); |
|
521 |
|
522 CleanupStack::PopAndDestroy(&iapList); |
|
523 |
|
524 INFO_PRINTF1(_L("Test2MobilityAccountsWithParentDeletionL - End")); |
|
525 } |
|
526 |
|
527 /** |
|
528 @SYMTestCaseID SMTP-MOB-PAR-ACC-0005 |
|
529 @SYMTestType CIT |
|
530 @SYMPREQ PREQ1307 |
|
531 @SYMREQ REQ6981 |
|
532 @SYMTestCaseDesc Tests adding 2 SMTP mobility accounts with the same parent and deleting parent |
|
533 */ |
|
534 void CTestSmtpMobilityAccounts::Test2MobilityAccountsWithSameParentDeletionL() |
|
535 { |
|
536 INFO_PRINTF1(_L("Test2MobilityAccountsWithSameParentDeletionL - Start")); |
|
537 |
|
538 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
539 |
|
540 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
541 |
|
542 RArrayIAP iapList; |
|
543 CleanupClosePushL(iapList); |
|
544 iapList.AppendL(2); |
|
545 |
|
546 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, *iMobAccSettings, ETrue); |
|
547 |
|
548 CheckNumberMobilityAccountsL(2); |
|
549 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
550 |
|
551 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
552 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
553 |
|
554 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
555 |
|
556 CheckNumberMobilityAccountsL(0); |
|
557 |
|
558 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
559 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
560 |
|
561 CheckNumberSMTPAccountsL(0); |
|
562 |
|
563 CleanupStack::PopAndDestroy(&iapList); |
|
564 |
|
565 INFO_PRINTF1(_L("Test2MobilityAccountsWithSameParentDeletionL - End")); |
|
566 } |
|
567 |
|
568 /** |
|
569 @SYMTestCaseID SMTP-MOB-PAR-ACC-0006 |
|
570 @SYMTestType CIT |
|
571 @SYMPREQ PREQ1307 |
|
572 @SYMREQ REQ6981 |
|
573 @SYMTestCaseDesc Tests adding 2 mobility account with same parent |
|
574 */ |
|
575 void CTestSmtpMobilityAccounts::Test2MobilityAccountsWithSameParentL() |
|
576 { |
|
577 INFO_PRINTF1(_L("Test2MobilityAccountsWithSameParentL - Start")); |
|
578 |
|
579 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
580 |
|
581 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
582 |
|
583 RArrayIAP iapList; |
|
584 CleanupClosePushL(iapList); |
|
585 iapList.AppendL(2); |
|
586 |
|
587 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, *iMobAccSettings, ETrue); |
|
588 |
|
589 CheckNumberMobilityAccountsL(2); |
|
590 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
591 |
|
592 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
593 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
594 |
|
595 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
596 |
|
597 CheckNumberSMTPAccountsL(1); |
|
598 |
|
599 CheckNumberMobilityAccountsL(1); |
|
600 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
601 |
|
602 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
603 |
|
604 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
605 |
|
606 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
607 |
|
608 CheckNumberSMTPAccountsL(1); |
|
609 |
|
610 CheckNumberMobilityAccountsL(0); |
|
611 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
612 |
|
613 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
614 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
615 |
|
616 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
617 |
|
618 CleanupStack::PopAndDestroy(&iapList); |
|
619 |
|
620 INFO_PRINTF1(_L("Test2MobilityAccountsWithSameParentL - End")); |
|
621 } |
|
622 |
|
623 /** |
|
624 @SYMTestCaseID SMTP-MOB-PAR-ACC-0007 |
|
625 @SYMTestType CIT |
|
626 @SYMPREQ PREQ1307 |
|
627 @SYMREQ REQ6981 |
|
628 @SYMTestCaseDesc Tests adding single SMTP mobility account to POP associated SMTP account |
|
629 */ |
|
630 void CTestSmtpMobilityAccounts::TestMobilityAccountWithPopL() |
|
631 { |
|
632 INFO_PRINTF1(_L("TestMobilityAccountWithPopL - Start")); |
|
633 |
|
634 CImPop3Settings* settings = new (ELeave) CImPop3Settings(); |
|
635 |
|
636 TPopAccount popAcc = iEmailAccounts->CreatePopAccountL(KPopAcc1Name, *settings, *iIapPrefs, EFalse); |
|
637 |
|
638 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(popAcc, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
639 |
|
640 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
641 |
|
642 CheckNumberMobilityAccountsL(1); |
|
643 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
644 |
|
645 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
646 |
|
647 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
648 |
|
649 CheckNumberMobilityAccountsL(0); |
|
650 |
|
651 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
652 |
|
653 CheckNumberSMTPAccountsL(0); |
|
654 |
|
655 iEmailAccounts->DeletePopAccountL(popAcc); |
|
656 |
|
657 INFO_PRINTF1(_L("TestMobilityAccountWithPopL - End")); |
|
658 } |
|
659 |
|
660 /** |
|
661 @SYMTestCaseID SMTP-MOB-PAR-ACC-0008 |
|
662 @SYMTestType CIT |
|
663 @SYMPREQ PREQ1307 |
|
664 @SYMREQ REQ6981 |
|
665 @SYMTestCaseDesc Tests adding single SMTP mobility account to IMAP associated SMTP account |
|
666 */ |
|
667 void CTestSmtpMobilityAccounts::TestMobilityAccountWithImapL() |
|
668 { |
|
669 INFO_PRINTF1(_L("TestMobilityAccountWithImapL - Start")); |
|
670 |
|
671 CImImap4Settings* settings = new (ELeave) CImImap4Settings(); |
|
672 |
|
673 TImapAccount imapAcc = iEmailAccounts->CreateImapAccountL(KImapAcc1Name, *settings, *iIapPrefs, EFalse); |
|
674 |
|
675 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(imapAcc, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
676 |
|
677 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
678 |
|
679 CheckNumberMobilityAccountsL(1); |
|
680 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
681 |
|
682 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
683 |
|
684 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
685 |
|
686 CheckNumberMobilityAccountsL(0); |
|
687 |
|
688 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
689 |
|
690 CheckNumberSMTPAccountsL(0); |
|
691 |
|
692 iEmailAccounts->DeleteImapAccountL(imapAcc); |
|
693 |
|
694 INFO_PRINTF1(_L("TestMobilityAccountWithImapL - End")); |
|
695 } |
|
696 |
|
697 /** |
|
698 @SYMTestCaseID SMTP-MOB-PAR-ACC-0009 |
|
699 @SYMTestType CIT |
|
700 @SYMPREQ PREQ1307 |
|
701 @SYMREQ REQ6981 |
|
702 @SYMTestCaseDesc Tests adding 3 SMTP mobility accounts to same parent and deleting them in the order first, second, third |
|
703 */ |
|
704 void CTestSmtpMobilityAccounts::Test3MobilityAccountsDelete123L() |
|
705 { |
|
706 INFO_PRINTF1(_L("Test3MobilityAccountsDelete123L - Start")); |
|
707 |
|
708 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
709 |
|
710 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
711 |
|
712 RArrayIAP iapList; |
|
713 CleanupClosePushL(iapList); |
|
714 iapList.AppendL(2); |
|
715 |
|
716 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, *iMobAccSettings, ETrue); |
|
717 |
|
718 RArrayIAP iapList2; |
|
719 CleanupClosePushL(iapList2); |
|
720 iapList2.AppendL(3); |
|
721 |
|
722 TSmtpMobilityAccount mobAcc3 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc3Name, iapList2, smtpAcc, *iMobAccSettings, ETrue); |
|
723 |
|
724 CheckNumberMobilityAccountsL(3, smtpAcc); |
|
725 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
726 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
727 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
728 |
|
729 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
730 |
|
731 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
732 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
733 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
734 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
735 |
|
736 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
737 |
|
738 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
739 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
740 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
741 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
742 |
|
743 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc3); |
|
744 |
|
745 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
746 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
747 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
748 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
749 |
|
750 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
751 |
|
752 CleanupStack::PopAndDestroy(2, &iapList); |
|
753 |
|
754 INFO_PRINTF1(_L("Test3MobilityAccountsDelete123L - End")); |
|
755 } |
|
756 |
|
757 /** |
|
758 @SYMTestCaseID SMTP-MOB-PAR-ACC-0010 |
|
759 @SYMTestType CIT |
|
760 @SYMPREQ PREQ1307 |
|
761 @SYMREQ REQ6981 |
|
762 @SYMTestCaseDesc Tests adding 3 SMTP mobility accounts to same parent and deleting them in the order third, second, first |
|
763 */ |
|
764 void CTestSmtpMobilityAccounts::Test3MobilityAccountsDelete321L() |
|
765 { |
|
766 INFO_PRINTF1(_L("Test3MobilityAccountsDelete321L - Start")); |
|
767 |
|
768 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
769 |
|
770 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
771 |
|
772 RArrayIAP iapList; |
|
773 CleanupClosePushL(iapList); |
|
774 iapList.AppendL(2); |
|
775 |
|
776 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, *iMobAccSettings, ETrue); |
|
777 |
|
778 RArrayIAP iapList2; |
|
779 CleanupClosePushL(iapList2); |
|
780 iapList2.AppendL(3); |
|
781 |
|
782 TSmtpMobilityAccount mobAcc3 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc3Name, iapList2, smtpAcc, *iMobAccSettings, ETrue); |
|
783 |
|
784 CheckNumberMobilityAccountsL(3, smtpAcc); |
|
785 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
786 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
787 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
788 |
|
789 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc3); |
|
790 |
|
791 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
792 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
793 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
794 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
795 |
|
796 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
797 |
|
798 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
799 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
800 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
801 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
802 |
|
803 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
804 |
|
805 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
806 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
807 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
808 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
809 |
|
810 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
811 |
|
812 CleanupStack::PopAndDestroy(2, &iapList); |
|
813 |
|
814 INFO_PRINTF1(_L("Test3MobilityAccountsDelete321L - End")); |
|
815 } |
|
816 |
|
817 /** |
|
818 @SYMTestCaseID SMTP-MOB-PAR-ACC-0011 |
|
819 @SYMTestType CIT |
|
820 @SYMPREQ PREQ1307 |
|
821 @SYMREQ REQ6981 |
|
822 @SYMTestCaseDesc Tests adding 3 SMTP mobility accounts to same parent and deleting them in the order second, first, third |
|
823 */ |
|
824 void CTestSmtpMobilityAccounts::Test3MobilityAccountsDelete213L() |
|
825 { |
|
826 INFO_PRINTF1(_L("Test3MobilityAccountsDelete213L - Start")); |
|
827 |
|
828 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
829 |
|
830 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
831 |
|
832 RArrayIAP iapList; |
|
833 CleanupClosePushL(iapList); |
|
834 iapList.AppendL(2); |
|
835 |
|
836 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, *iMobAccSettings, ETrue); |
|
837 |
|
838 RArrayIAP iapList2; |
|
839 CleanupClosePushL(iapList2); |
|
840 iapList2.AppendL(3); |
|
841 |
|
842 TSmtpMobilityAccount mobAcc3 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc3Name, iapList2, smtpAcc, *iMobAccSettings, ETrue); |
|
843 |
|
844 CheckNumberMobilityAccountsL(3, smtpAcc); |
|
845 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
846 CheckMobilityAccountDetailsL(KMobAcc2Name, iMobAccSettings->SmtpSettings(), iapList, ETrue, smtpAcc); |
|
847 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
848 |
|
849 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
850 |
|
851 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
852 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
853 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
854 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
855 |
|
856 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
857 |
|
858 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
859 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
860 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
861 CheckMobilityAccountDetailsL(KMobAcc3Name, iMobAccSettings->SmtpSettings(), iapList2, ETrue, smtpAcc); |
|
862 |
|
863 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc3); |
|
864 |
|
865 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
866 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
867 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
868 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
869 |
|
870 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
871 |
|
872 CleanupStack::PopAndDestroy(2, &iapList); |
|
873 |
|
874 INFO_PRINTF1(_L("Test3MobilityAccountsDelete213L - End")); |
|
875 } |
|
876 |
|
877 /** |
|
878 @SYMTestCaseID SMTP-MOB-PAR-ACC-0012 |
|
879 @SYMTestType CIT |
|
880 @SYMPREQ PREQ1307 |
|
881 @SYMREQ REQ6981 |
|
882 @SYMTestCaseDesc Tests changing mobility account settings |
|
883 */ |
|
884 void CTestSmtpMobilityAccounts::TestChangeMobilityAccountSettingsL() |
|
885 { |
|
886 INFO_PRINTF1(_L("TestChangeMobilityAccountSettingsL - Start")); |
|
887 |
|
888 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
889 |
|
890 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
891 |
|
892 CheckNumberMobilityAccountsL(1); |
|
893 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
894 |
|
895 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
896 |
|
897 iMobAccSettings->SetLoginNameL(KTestLoginName); |
|
898 |
|
899 iEmailAccounts->SaveSmtpMobilitySettingsL(mobAcc, *iMobAccSettings); |
|
900 |
|
901 iMobAccSettings->SetLoginNameL(KMobLoginName); |
|
902 |
|
903 iEmailAccounts->LoadSmtpMobilitySettingsL(mobAcc, *iMobAccSettings); |
|
904 |
|
905 ASSERT_EQUALS(iMobAccSettings->LoginName().Compare(KTestLoginName), 0); |
|
906 |
|
907 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
908 |
|
909 INFO_PRINTF1(_L("TestChangeMobilityAccountSettingsL - End")); |
|
910 } |
|
911 |
|
912 /** |
|
913 @SYMTestCaseID SMTP-MOB-PAR-ACC-0013 |
|
914 @SYMTestType CIT |
|
915 @SYMPREQ PREQ1307 |
|
916 @SYMREQ REQ6981 |
|
917 @SYMTestCaseDesc Tests changing mobility account IAP list |
|
918 */ |
|
919 void CTestSmtpMobilityAccounts::TestChangeMobilityAccountIapListL() |
|
920 { |
|
921 INFO_PRINTF1(_L("TestChangeMobilityAccountIapListL - Start")); |
|
922 |
|
923 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
924 |
|
925 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
926 |
|
927 CheckNumberMobilityAccountsL(1); |
|
928 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
929 |
|
930 CheckMobilityAccountDetailsL(KMobAcc1Name, iMobAccSettings->SmtpSettings(), iIapList, EFalse, smtpAcc); |
|
931 |
|
932 iIapList.AppendL(2); |
|
933 |
|
934 iEmailAccounts->SaveSmtpMobilityAccountIapListL(mobAcc, iIapList); |
|
935 |
|
936 iIapList.Reset(); |
|
937 |
|
938 iEmailAccounts->LoadSmtpMobilityAccountIapListL(mobAcc, iIapList); |
|
939 |
|
940 ASSERT_EQUALS(iIapList.Count(), 2); |
|
941 ASSERT_TRUE(iIapList[0] == 1); |
|
942 ASSERT_TRUE(iIapList[1] == 2); |
|
943 |
|
944 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
945 |
|
946 INFO_PRINTF1(_L("TestChangeMobilityAccountIapListL - End")); |
|
947 } |
|
948 |
|
949 /** |
|
950 @SYMTestCaseID SMTP-MOB-LNK-ACC-0001 |
|
951 @SYMTestType CIT |
|
952 @SYMPREQ PREQ1307 |
|
953 @SYMREQ REQ6981 |
|
954 @SYMTestCaseDesc Tests adding single linked SMTP mobility account |
|
955 */ |
|
956 void CTestSmtpMobilityAccounts::Test1LinkedMobilityAccountL() |
|
957 { |
|
958 INFO_PRINTF1(_L("Test1LinkedMobilityAccountL - Start")); |
|
959 |
|
960 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
961 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
962 |
|
963 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
964 |
|
965 CheckNumberMobilityAccountsL(1); |
|
966 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
967 |
|
968 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
969 |
|
970 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
971 |
|
972 CheckNumberMobilityAccountsL(0); |
|
973 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
974 |
|
975 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
976 |
|
977 CheckNumberSMTPAccountsL(2); |
|
978 |
|
979 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
980 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
981 |
|
982 INFO_PRINTF1(_L("Test1LinkedMobilityAccountL - End")); |
|
983 } |
|
984 |
|
985 /** |
|
986 @SYMTestCaseID SMTP-MOB-LNK-ACC-0002 |
|
987 @SYMTestType CIT |
|
988 @SYMPREQ PREQ1307 |
|
989 @SYMREQ REQ6981 |
|
990 @SYMTestCaseDesc Tests adding single linked SMTP mobility account and deleting parent |
|
991 */ |
|
992 void CTestSmtpMobilityAccounts::Test1LinkedMobilityAccountWithLinkedDeletionL() |
|
993 { |
|
994 INFO_PRINTF1(_L("Test1LinkedMobilityAccountWithLinkedDeletionL - Start")); |
|
995 |
|
996 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
997 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
998 |
|
999 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1000 |
|
1001 CheckNumberMobilityAccountsL(1); |
|
1002 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1003 |
|
1004 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1005 |
|
1006 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1007 |
|
1008 CheckNumberMobilityAccountsL(0); |
|
1009 |
|
1010 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1011 |
|
1012 CheckNumberSMTPAccountsL(1); |
|
1013 |
|
1014 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1015 |
|
1016 INFO_PRINTF1(_L("Test1LinkedMobilityAccountWithLinkedDeletionL - End")); |
|
1017 } |
|
1018 |
|
1019 /** |
|
1020 @SYMTestCaseID SMTP-MOB-LNK-ACC-0003 |
|
1021 @SYMTestType CIT |
|
1022 @SYMPREQ PREQ1307 |
|
1023 @SYMREQ REQ6981 |
|
1024 @SYMTestCaseDesc Tests adding 2 linked SMTP mobility accounts |
|
1025 */ |
|
1026 void CTestSmtpMobilityAccounts::Test2LinkedMobilityAccountsL() |
|
1027 { |
|
1028 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsL - Start")); |
|
1029 |
|
1030 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1031 TSmtpAccount linkedAcc1 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1032 TSmtpAccount linkedAcc2 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc3Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1033 |
|
1034 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc1, EFalse); |
|
1035 |
|
1036 RArrayIAP iapList; |
|
1037 CleanupClosePushL(iapList); |
|
1038 iapList.AppendL(2); |
|
1039 |
|
1040 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc2, ETrue); |
|
1041 |
|
1042 CheckNumberMobilityAccountsL(2); |
|
1043 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1044 |
|
1045 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1046 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1047 |
|
1048 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
1049 |
|
1050 CheckNumberMobilityAccountsL(1); |
|
1051 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1052 |
|
1053 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1054 |
|
1055 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1056 |
|
1057 CheckNumberSMTPAccountsL(3); |
|
1058 |
|
1059 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
1060 |
|
1061 CheckNumberMobilityAccountsL(0); |
|
1062 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
1063 |
|
1064 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1065 |
|
1066 CheckNumberSMTPAccountsL(3); |
|
1067 |
|
1068 CheckSmtpAccountSettingsL(smtpAcc, *iSmtpAccSettings); |
|
1069 CheckSmtpAccountSettingsL(linkedAcc1, *iSmtpAccSettings); |
|
1070 CheckSmtpAccountSettingsL(linkedAcc2, *iSmtpAccSettings); |
|
1071 |
|
1072 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1073 iEmailAccounts->DeleteSmtpAccountL(linkedAcc1); |
|
1074 iEmailAccounts->DeleteSmtpAccountL(linkedAcc2); |
|
1075 |
|
1076 CleanupStack::PopAndDestroy(&iapList); |
|
1077 |
|
1078 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsL - End")); |
|
1079 } |
|
1080 |
|
1081 /** |
|
1082 @SYMTestCaseID SMTP-MOB-LNK-ACC-0004 |
|
1083 @SYMTestType CIT |
|
1084 @SYMPREQ PREQ1307 |
|
1085 @SYMREQ REQ6981 |
|
1086 @SYMTestCaseDesc Tests adding 2 linked SMTP mobility accounts and deleting parents |
|
1087 */ |
|
1088 void CTestSmtpMobilityAccounts::Test2LinkedMobilityAccountsWithLinkedDeletionL() |
|
1089 { |
|
1090 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsWithLinkedDeletionL - Start")); |
|
1091 |
|
1092 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1093 TSmtpAccount linkedAcc1 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1094 TSmtpAccount linkedAcc2 = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc3Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1095 |
|
1096 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc1, EFalse); |
|
1097 |
|
1098 RArrayIAP iapList; |
|
1099 CleanupClosePushL(iapList); |
|
1100 iapList.AppendL(2); |
|
1101 |
|
1102 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc2, ETrue); |
|
1103 |
|
1104 CheckNumberMobilityAccountsL(2); |
|
1105 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1106 |
|
1107 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1108 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1109 |
|
1110 iEmailAccounts->DeleteSmtpAccountL(linkedAcc2); |
|
1111 |
|
1112 CheckNumberMobilityAccountsL(1); |
|
1113 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1114 |
|
1115 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1116 |
|
1117 CheckNumberSMTPAccountsL(2); |
|
1118 |
|
1119 iEmailAccounts->DeleteSmtpAccountL(linkedAcc1); |
|
1120 |
|
1121 CheckNumberMobilityAccountsL(0); |
|
1122 |
|
1123 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1124 |
|
1125 CheckNumberSMTPAccountsL(1); |
|
1126 |
|
1127 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1128 |
|
1129 CleanupStack::PopAndDestroy(&iapList); |
|
1130 |
|
1131 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsWithLinkedDeletionL - End")); |
|
1132 } |
|
1133 |
|
1134 /** |
|
1135 @SYMTestCaseID SMTP-MOB-LNK-ACC-0005 |
|
1136 @SYMTestType CIT |
|
1137 @SYMPREQ PREQ1307 |
|
1138 @SYMREQ REQ6981 |
|
1139 @SYMTestCaseDesc Tests adding 2 linked SMTP mobility accounts with the same parent and deleting parent |
|
1140 */ |
|
1141 void CTestSmtpMobilityAccounts::Test2LinkedMobilityAccountsWithSameLinkedDeletionL() |
|
1142 { |
|
1143 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsWithSameLinkedDeletionL - Start")); |
|
1144 |
|
1145 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1146 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1147 |
|
1148 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1149 |
|
1150 RArrayIAP iapList; |
|
1151 CleanupClosePushL(iapList); |
|
1152 iapList.AppendL(2); |
|
1153 |
|
1154 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc, ETrue); |
|
1155 |
|
1156 CheckNumberMobilityAccountsL(2); |
|
1157 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1158 |
|
1159 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1160 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1161 |
|
1162 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1163 |
|
1164 CheckNumberMobilityAccountsL(0); |
|
1165 |
|
1166 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1167 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1168 |
|
1169 CheckNumberSMTPAccountsL(1); |
|
1170 |
|
1171 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1172 |
|
1173 CleanupStack::PopAndDestroy(&iapList); |
|
1174 |
|
1175 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsWithSameLinkedDeletionL - End")); |
|
1176 } |
|
1177 |
|
1178 /** |
|
1179 @SYMTestCaseID SMTP-MOB-LNK-ACC-0006 |
|
1180 @SYMTestType CIT |
|
1181 @SYMPREQ PREQ1307 |
|
1182 @SYMREQ REQ6981 |
|
1183 @SYMTestCaseDesc Tests adding 2 linked mobility account with same parent |
|
1184 */ |
|
1185 void CTestSmtpMobilityAccounts::Test2LinkedMobilityAccountsWithSameLinkedL() |
|
1186 { |
|
1187 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsWithSameLinkedL - Start")); |
|
1188 |
|
1189 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1190 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1191 |
|
1192 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1193 |
|
1194 RArrayIAP iapList; |
|
1195 CleanupClosePushL(iapList); |
|
1196 iapList.AppendL(2); |
|
1197 |
|
1198 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc, ETrue); |
|
1199 |
|
1200 CheckNumberMobilityAccountsL(2); |
|
1201 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1202 |
|
1203 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1204 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1205 |
|
1206 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
1207 |
|
1208 CheckNumberSMTPAccountsL(2); |
|
1209 |
|
1210 CheckNumberMobilityAccountsL(1); |
|
1211 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1212 |
|
1213 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1214 |
|
1215 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1216 |
|
1217 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
1218 |
|
1219 CheckNumberSMTPAccountsL(2); |
|
1220 |
|
1221 CheckNumberMobilityAccountsL(0); |
|
1222 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
1223 |
|
1224 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1225 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1226 |
|
1227 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1228 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1229 |
|
1230 CleanupStack::PopAndDestroy(&iapList); |
|
1231 |
|
1232 INFO_PRINTF1(_L("Test2LinkedMobilityAccountsWithSameLinkedL - End")); |
|
1233 } |
|
1234 |
|
1235 /** |
|
1236 @SYMTestCaseID SMTP-MOB-LNK-ACC-0007 |
|
1237 @SYMTestType CIT |
|
1238 @SYMPREQ PREQ1307 |
|
1239 @SYMREQ REQ6981 |
|
1240 @SYMTestCaseDesc Tests adding single linked SMTP mobility account to POP associated SMTP account |
|
1241 */ |
|
1242 void CTestSmtpMobilityAccounts::TestLinkedMobilityAccountWithPopL() |
|
1243 { |
|
1244 INFO_PRINTF1(_L("TestLinkedMobilityAccountWithPopL - Start")); |
|
1245 |
|
1246 CImPop3Settings* settings = new (ELeave) CImPop3Settings(); |
|
1247 |
|
1248 TPopAccount popAcc1 = iEmailAccounts->CreatePopAccountL(KPopAcc1Name, *settings, *iIapPrefs, EFalse); |
|
1249 TPopAccount popAcc2 = iEmailAccounts->CreatePopAccountL(KPopAcc2Name, *settings, *iIapPrefs, EFalse); |
|
1250 |
|
1251 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(popAcc1, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1252 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(popAcc2, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1253 |
|
1254 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1255 |
|
1256 CheckNumberMobilityAccountsL(1); |
|
1257 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1258 |
|
1259 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1260 |
|
1261 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1262 |
|
1263 CheckNumberMobilityAccountsL(0); |
|
1264 |
|
1265 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1266 |
|
1267 CheckNumberSMTPAccountsL(1); |
|
1268 |
|
1269 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1270 iEmailAccounts->DeletePopAccountL(popAcc1); |
|
1271 iEmailAccounts->DeletePopAccountL(popAcc2); |
|
1272 |
|
1273 INFO_PRINTF1(_L("TestLinkedMobilityAccountWithPopL - End")); |
|
1274 } |
|
1275 |
|
1276 /** |
|
1277 @SYMTestCaseID SMTP-MOB-LNK-ACC-0008 |
|
1278 @SYMTestType CIT |
|
1279 @SYMPREQ PREQ1307 |
|
1280 @SYMREQ REQ6981 |
|
1281 @SYMTestCaseDesc Tests adding single linked SMTP mobility account to IMAP associated SMTP account |
|
1282 */ |
|
1283 void CTestSmtpMobilityAccounts::TestLinkedMobilityAccountWithImapL() |
|
1284 { |
|
1285 INFO_PRINTF1(_L("TestLinkedMobilityAccountWithImapL - Start")); |
|
1286 |
|
1287 CImImap4Settings* settings = new (ELeave) CImImap4Settings(); |
|
1288 |
|
1289 TImapAccount imapAcc1 = iEmailAccounts->CreateImapAccountL(KImapAcc1Name, *settings, *iIapPrefs, EFalse); |
|
1290 TImapAccount imapAcc2 = iEmailAccounts->CreateImapAccountL(KImapAcc2Name, *settings, *iIapPrefs, EFalse); |
|
1291 |
|
1292 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(imapAcc1, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1293 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(imapAcc2, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1294 |
|
1295 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1296 |
|
1297 CheckNumberMobilityAccountsL(1); |
|
1298 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1299 |
|
1300 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1301 |
|
1302 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1303 |
|
1304 CheckNumberMobilityAccountsL(0); |
|
1305 |
|
1306 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1307 |
|
1308 CheckNumberSMTPAccountsL(1); |
|
1309 |
|
1310 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1311 iEmailAccounts->DeleteImapAccountL(imapAcc1); |
|
1312 iEmailAccounts->DeleteImapAccountL(imapAcc2); |
|
1313 |
|
1314 INFO_PRINTF1(_L("TestLinkedMobilityAccountWithImapL - End")); |
|
1315 } |
|
1316 |
|
1317 /** |
|
1318 @SYMTestCaseID SMTP-MOB-LNK-ACC-0009 |
|
1319 @SYMTestType CIT |
|
1320 @SYMPREQ PREQ1307 |
|
1321 @SYMREQ REQ6981 |
|
1322 @SYMTestCaseDesc Tests adding 3 linked SMTP mobility accounts to same parent and deleting them in the order first, second, third |
|
1323 */ |
|
1324 void CTestSmtpMobilityAccounts::Test3LinkedMobilityAccountsDelete123L() |
|
1325 { |
|
1326 INFO_PRINTF1(_L("Test3LinkedMobilityAccountsDelete123L - Start")); |
|
1327 |
|
1328 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1329 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1330 |
|
1331 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1332 |
|
1333 RArrayIAP iapList; |
|
1334 CleanupClosePushL(iapList); |
|
1335 iapList.AppendL(2); |
|
1336 |
|
1337 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc, ETrue); |
|
1338 |
|
1339 RArrayIAP iapList2; |
|
1340 CleanupClosePushL(iapList2); |
|
1341 iapList2.AppendL(3); |
|
1342 |
|
1343 TSmtpMobilityAccount mobAcc3 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc3Name, iapList2, smtpAcc, linkedAcc, ETrue); |
|
1344 |
|
1345 CheckNumberMobilityAccountsL(3, smtpAcc); |
|
1346 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1347 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1348 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1349 |
|
1350 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
1351 |
|
1352 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1353 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1354 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1355 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1356 |
|
1357 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
1358 |
|
1359 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1360 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1361 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1362 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1363 |
|
1364 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc3); |
|
1365 |
|
1366 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
1367 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1368 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1369 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
1370 |
|
1371 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1372 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1373 |
|
1374 CleanupStack::PopAndDestroy(2, &iapList); |
|
1375 |
|
1376 INFO_PRINTF1(_L("Test3LinkedMobilityAccountsDelete123L - End")); |
|
1377 } |
|
1378 |
|
1379 /** |
|
1380 @SYMTestCaseID SMTP-MOB-LNK-ACC-0010 |
|
1381 @SYMTestType CIT |
|
1382 @SYMPREQ PREQ1307 |
|
1383 @SYMREQ REQ6981 |
|
1384 @SYMTestCaseDesc Tests adding 3 linked SMTP mobility accounts to same parent and deleting them in the order third, second, first |
|
1385 */ |
|
1386 void CTestSmtpMobilityAccounts::Test3LinkedMobilityAccountsDelete321L() |
|
1387 { |
|
1388 INFO_PRINTF1(_L("Test3LinkedMobilityAccountsDelete321L - Start")); |
|
1389 |
|
1390 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1391 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1392 |
|
1393 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1394 |
|
1395 RArrayIAP iapList; |
|
1396 CleanupClosePushL(iapList); |
|
1397 iapList.AppendL(2); |
|
1398 |
|
1399 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc, ETrue); |
|
1400 |
|
1401 RArrayIAP iapList2; |
|
1402 CleanupClosePushL(iapList2); |
|
1403 iapList2.AppendL(3); |
|
1404 |
|
1405 TSmtpMobilityAccount mobAcc3 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc3Name, iapList2, smtpAcc, linkedAcc, ETrue); |
|
1406 |
|
1407 CheckNumberMobilityAccountsL(3, smtpAcc); |
|
1408 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1409 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1410 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1411 |
|
1412 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc3); |
|
1413 |
|
1414 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1415 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1416 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1417 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
1418 |
|
1419 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
1420 |
|
1421 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1422 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1423 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1424 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
1425 |
|
1426 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
1427 |
|
1428 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
1429 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1430 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1431 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
1432 |
|
1433 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1434 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1435 |
|
1436 CleanupStack::PopAndDestroy(2, &iapList); |
|
1437 |
|
1438 INFO_PRINTF1(_L("Test3LinkedMobilityAccountsDelete321L - End")); |
|
1439 } |
|
1440 |
|
1441 /** |
|
1442 @SYMTestCaseID SMTP-MOB-LNK-ACC-0011 |
|
1443 @SYMTestType CIT |
|
1444 @SYMPREQ PREQ1307 |
|
1445 @SYMREQ REQ6981 |
|
1446 @SYMTestCaseDesc Tests adding 3 linked SMTP mobility accounts to same parent and deleting them in the order second, first, third |
|
1447 */ |
|
1448 void CTestSmtpMobilityAccounts::Test3LinkedMobilityAccountsDelete213L() |
|
1449 { |
|
1450 INFO_PRINTF1(_L("Test3LinkedMobilityAccountsDelete213L - Start")); |
|
1451 |
|
1452 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1453 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1454 |
|
1455 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1456 |
|
1457 RArrayIAP iapList; |
|
1458 CleanupClosePushL(iapList); |
|
1459 iapList.AppendL(2); |
|
1460 |
|
1461 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, linkedAcc, ETrue); |
|
1462 |
|
1463 RArrayIAP iapList2; |
|
1464 CleanupClosePushL(iapList2); |
|
1465 iapList2.AppendL(3); |
|
1466 |
|
1467 TSmtpMobilityAccount mobAcc3 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc3Name, iapList2, smtpAcc, linkedAcc, ETrue); |
|
1468 |
|
1469 CheckNumberMobilityAccountsL(3, smtpAcc); |
|
1470 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1471 CheckMobilityAccountDetailsL(KMobAcc2Name, *iSmtpAccSettings, iapList, ETrue, smtpAcc); |
|
1472 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1473 |
|
1474 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc2); |
|
1475 |
|
1476 CheckNumberMobilityAccountsL(2, smtpAcc); |
|
1477 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1478 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1479 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1480 |
|
1481 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc1); |
|
1482 |
|
1483 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1484 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1485 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1486 CheckMobilityAccountDetailsL(KMobAcc3Name, *iSmtpAccSettings, iapList2, ETrue, smtpAcc); |
|
1487 |
|
1488 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc3); |
|
1489 |
|
1490 CheckNumberMobilityAccountsL(0, smtpAcc); |
|
1491 CheckMobilityAccountMissingL(KMobAcc1Name); |
|
1492 CheckMobilityAccountMissingL(KMobAcc2Name); |
|
1493 CheckMobilityAccountMissingL(KMobAcc3Name); |
|
1494 |
|
1495 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1496 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1497 |
|
1498 CleanupStack::PopAndDestroy(2, &iapList); |
|
1499 |
|
1500 INFO_PRINTF1(_L("Test3LinkedMobilityAccountsDelete213L - End")); |
|
1501 } |
|
1502 |
|
1503 /** |
|
1504 @SYMTestCaseID SMTP-MOB-LNK-ACC-0012 |
|
1505 @SYMTestType CIT |
|
1506 @SYMPREQ PREQ1307 |
|
1507 @SYMREQ REQ6981 |
|
1508 @SYMTestCaseDesc Tests changing linked mobility account IAP list |
|
1509 */ |
|
1510 void CTestSmtpMobilityAccounts::TestChangeLinkedMobilityAccountIapListL() |
|
1511 { |
|
1512 INFO_PRINTF1(_L("TestChangeLinkedMobilityAccountIapListL - Start")); |
|
1513 |
|
1514 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1515 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1516 |
|
1517 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1518 |
|
1519 CheckNumberMobilityAccountsL(1); |
|
1520 CheckNumberMobilityAccountsL(1, smtpAcc); |
|
1521 |
|
1522 CheckMobilityAccountDetailsL(KMobAcc1Name, *iSmtpAccSettings, iIapList, EFalse, smtpAcc); |
|
1523 |
|
1524 iIapList.AppendL(2); |
|
1525 |
|
1526 iEmailAccounts->SaveSmtpMobilityAccountIapListL(mobAcc, iIapList); |
|
1527 |
|
1528 iIapList.Reset(); |
|
1529 |
|
1530 iEmailAccounts->LoadSmtpMobilityAccountIapListL(mobAcc, iIapList); |
|
1531 |
|
1532 ASSERT_EQUALS(iIapList.Count(), 2); |
|
1533 ASSERT_TRUE(iIapList[0] == 1); |
|
1534 ASSERT_TRUE(iIapList[1] == 2); |
|
1535 |
|
1536 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1537 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1538 |
|
1539 INFO_PRINTF1(_L("TestChangeLinkedMobilityAccountIapListL - End")); |
|
1540 } |
|
1541 |
|
1542 /** |
|
1543 @SYMTestCaseID SMTP-MOB-OTH-ACC-0001 |
|
1544 @SYMTestType CIT |
|
1545 @SYMPREQ PREQ1307 |
|
1546 @SYMREQ REQ6981 |
|
1547 @SYMTestCaseDesc Tests adding SMTP mobility account linked to parent |
|
1548 */ |
|
1549 void CTestSmtpMobilityAccounts::TestMobilityAccountLinkedToParentL() |
|
1550 { |
|
1551 INFO_PRINTF1(_L("TestMobilityAccountLinkedToParentL - Start")); |
|
1552 |
|
1553 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1554 |
|
1555 TSmtpMobilityAccount mobAcc; |
|
1556 TRAPD(err, mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, smtpAcc, EFalse)); |
|
1557 |
|
1558 ASSERT_EQUALS(err, KErrArgument); |
|
1559 |
|
1560 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1561 |
|
1562 INFO_PRINTF1(_L("TestMobilityAccountLinkedToParentL - End")); |
|
1563 } |
|
1564 |
|
1565 /** |
|
1566 @SYMTestCaseID SMTP-MOB-OTH-ACC-0002 |
|
1567 @SYMTestType CIT |
|
1568 @SYMPREQ PREQ1307 |
|
1569 @SYMREQ REQ6981 |
|
1570 @SYMTestCaseDesc Tests adding 2 SMTP mobility accounts with same parent and IAP |
|
1571 */ |
|
1572 void CTestSmtpMobilityAccounts::Test2MobilityAccountsWithSameParentAndIapL() |
|
1573 { |
|
1574 INFO_PRINTF1(_L("Test2MobilityAccountsWithSameParentAndIapL - Start")); |
|
1575 |
|
1576 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1577 |
|
1578 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1579 |
|
1580 TSmtpMobilityAccount mobAcc2; |
|
1581 TRAPD(err, mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iIapList, smtpAcc, *iMobAccSettings, EFalse)); |
|
1582 |
|
1583 ASSERT_EQUALS(err, KErrAlreadyExists); |
|
1584 |
|
1585 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1586 |
|
1587 INFO_PRINTF1(_L("Test2MobilityAccountsWithSameParentAndIapL - End")); |
|
1588 } |
|
1589 |
|
1590 /** |
|
1591 @SYMTestCaseID SMTP-MOB-OTH-ACC-0003 |
|
1592 @SYMTestType CIT |
|
1593 @SYMPREQ PREQ1307 |
|
1594 @SYMREQ REQ6981 |
|
1595 @SYMTestCaseDesc Tests adding SMTP mobility account with no IAPs |
|
1596 */ |
|
1597 void CTestSmtpMobilityAccounts::TestMobilityAccountWith0IapsL() |
|
1598 { |
|
1599 INFO_PRINTF1(_L("TestMobilityAccountWith0IapsL - Start")); |
|
1600 |
|
1601 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1602 |
|
1603 RArrayIAP iapList; |
|
1604 CleanupClosePushL(iapList); |
|
1605 |
|
1606 TSmtpMobilityAccount mobAcc; |
|
1607 TRAPD(err, mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iapList, smtpAcc, smtpAcc, EFalse)); |
|
1608 |
|
1609 ASSERT_EQUALS(err, KErrArgument); |
|
1610 |
|
1611 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1612 |
|
1613 CleanupStack::PopAndDestroy(&iapList); |
|
1614 |
|
1615 INFO_PRINTF1(_L("TestMobilityAccountWith0IapsL - End")); |
|
1616 } |
|
1617 |
|
1618 /** |
|
1619 @SYMTestCaseID SMTP-MOB-OTH-ACC-0004 |
|
1620 @SYMTestType CIT |
|
1621 @SYMPREQ PREQ1307 |
|
1622 @SYMREQ REQ6981 |
|
1623 @SYMTestCaseDesc Tests adding SMTP mobility account with 33 IAPs |
|
1624 */ |
|
1625 void CTestSmtpMobilityAccounts::TestMobilityAccountWith33IapsL() |
|
1626 { |
|
1627 INFO_PRINTF1(_L("TestMobilityAccountWith33IapsL - Start")); |
|
1628 |
|
1629 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1630 |
|
1631 RArrayIAP iapList; |
|
1632 CleanupClosePushL(iapList); |
|
1633 for (TInt count = 1; count <= 33; ++count) |
|
1634 { |
|
1635 iapList.AppendL(count); |
|
1636 } |
|
1637 |
|
1638 TSmtpMobilityAccount mobAcc; |
|
1639 TRAPD(err, mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iapList, smtpAcc, smtpAcc, EFalse)); |
|
1640 |
|
1641 ASSERT_EQUALS(err, KErrArgument); |
|
1642 |
|
1643 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1644 |
|
1645 CleanupStack::PopAndDestroy(&iapList); |
|
1646 |
|
1647 INFO_PRINTF1(_L("TestMobilityAccountWith33IapsL - End")); |
|
1648 } |
|
1649 |
|
1650 /** |
|
1651 @SYMTestCaseID SMTP-MOB-OTH-ACC-0005 |
|
1652 @SYMTestType CIT |
|
1653 @SYMPREQ PREQ1307 |
|
1654 @SYMREQ REQ6981 |
|
1655 @SYMTestCaseDesc Tests adding 33 SMTP mobility accounts to same parent |
|
1656 */ |
|
1657 void CTestSmtpMobilityAccounts::TestCreate33MobilityAccountsWithSameParentL() |
|
1658 { |
|
1659 INFO_PRINTF1(_L("TestCreate33MobilityAccountsWithSameParentL - Start")); |
|
1660 |
|
1661 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1662 |
|
1663 RArrayIAP iapList; |
|
1664 CleanupClosePushL(iapList); |
|
1665 |
|
1666 TSmtpMobilityAccount mobAcc; |
|
1667 for (TInt count = 1; count <= 32; ++count) |
|
1668 { |
|
1669 iapList.AppendL(count); |
|
1670 mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1671 iapList.Remove(0); |
|
1672 } |
|
1673 |
|
1674 iapList.AppendL(33); |
|
1675 |
|
1676 TRAPD(err, mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iapList, smtpAcc, *iMobAccSettings, EFalse)); |
|
1677 |
|
1678 ASSERT_EQUALS(err, KErrOverflow); |
|
1679 |
|
1680 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1681 |
|
1682 CleanupStack::PopAndDestroy(&iapList); |
|
1683 |
|
1684 INFO_PRINTF1(_L("TestCreate33MobilityAccountsWithSameParentL - End")); |
|
1685 } |
|
1686 |
|
1687 /** |
|
1688 @SYMTestCaseID SMTP-MOB-OTH-ACC-0006 |
|
1689 @SYMTestType CIT |
|
1690 @SYMPREQ PREQ1307 |
|
1691 @SYMREQ REQ6981 |
|
1692 @SYMTestCaseDesc Tests adding SMTP mobility accounts with too long account name |
|
1693 */ |
|
1694 void CTestSmtpMobilityAccounts::TestCreateMobilityAccountWithTooLongAccountNameL() |
|
1695 { |
|
1696 INFO_PRINTF1(_L("TestCreateMobilityAccountWithTooLongAccountNameL - Start")); |
|
1697 |
|
1698 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1699 |
|
1700 _LIT(KMaxLengthName, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456"); |
|
1701 |
|
1702 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMaxLengthName, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1703 |
|
1704 _LIT(KTooLongName, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567"); |
|
1705 |
|
1706 TSmtpMobilityAccount mobAcc2; |
|
1707 TRAPD(err, mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KTooLongName, iIapList, smtpAcc, *iMobAccSettings, EFalse)); |
|
1708 |
|
1709 ASSERT_EQUALS(err, KErrArgument); |
|
1710 |
|
1711 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1712 |
|
1713 INFO_PRINTF1(_L("TestCreateMobilityAccountWithTooLongAccountNameL - End")); |
|
1714 } |
|
1715 |
|
1716 /** |
|
1717 @SYMTestCaseID SMTP-MOB-OTH-ACC-0007 |
|
1718 @SYMTestType CIT |
|
1719 @SYMPREQ PREQ1307 |
|
1720 @SYMREQ REQ6981 |
|
1721 @SYMTestCaseDesc Tests deleting non existing SMTP mobility account |
|
1722 */ |
|
1723 void CTestSmtpMobilityAccounts::TestDeleteNonExistentMobilityAccountL() |
|
1724 { |
|
1725 INFO_PRINTF1(_L("TestDeleteNonExistentMobilityAccountL - Start")); |
|
1726 |
|
1727 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1728 |
|
1729 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1730 |
|
1731 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
1732 |
|
1733 TRAPD(err, iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc)); |
|
1734 |
|
1735 ASSERT_EQUALS(err, KErrNotFound); |
|
1736 |
|
1737 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1738 |
|
1739 INFO_PRINTF1(_L("TestDeleteNonExistentMobilityAccountL - End")); |
|
1740 } |
|
1741 |
|
1742 /** |
|
1743 @SYMTestCaseID SMTP-MOB-OTH-ACC-0008 |
|
1744 @SYMTestType CIT |
|
1745 @SYMPREQ PREQ1307 |
|
1746 @SYMREQ REQ6981 |
|
1747 @SYMTestCaseDesc Tests loading settings for non existent SMTP mobility account |
|
1748 */ |
|
1749 void CTestSmtpMobilityAccounts::TestLoadMobilitySettingsForNonExistentMobilityAccountL() |
|
1750 { |
|
1751 INFO_PRINTF1(_L("TestLoadMobilitySettingsForNonExistentMobilityAccountL - Start")); |
|
1752 |
|
1753 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1754 |
|
1755 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1756 |
|
1757 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
1758 |
|
1759 TRAPD(err, iEmailAccounts->LoadSmtpMobilitySettingsL(mobAcc, *iMobAccSettings)); |
|
1760 |
|
1761 ASSERT_EQUALS(err, KErrNotFound); |
|
1762 |
|
1763 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1764 |
|
1765 INFO_PRINTF1(_L("TestLoadMobilitySettingsForNonExistentMobilityAccountL - End")); |
|
1766 } |
|
1767 |
|
1768 /** |
|
1769 @SYMTestCaseID SMTP-MOB-OTH-ACC-0009 |
|
1770 @SYMTestType CIT |
|
1771 @SYMPREQ PREQ1307 |
|
1772 @SYMREQ REQ6981 |
|
1773 @SYMTestCaseDesc Tests saving settings for linked SMTP mobility account |
|
1774 */ |
|
1775 void CTestSmtpMobilityAccounts::TestSaveMobilitySettingsForLinkedMobilityAccountL() |
|
1776 { |
|
1777 INFO_PRINTF1(_L("TestSaveMobilitySettingsForLinkedMobilityAccountL - Start")); |
|
1778 |
|
1779 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1780 TSmtpAccount linkedAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc2Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1781 |
|
1782 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, linkedAcc, EFalse); |
|
1783 |
|
1784 TRAPD(err, iEmailAccounts->SaveSmtpMobilitySettingsL(mobAcc, *iMobAccSettings)); |
|
1785 |
|
1786 ASSERT_EQUALS(err, KErrNotSupported); |
|
1787 |
|
1788 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1789 iEmailAccounts->DeleteSmtpAccountL(linkedAcc); |
|
1790 |
|
1791 INFO_PRINTF1(_L("TestSaveMobilitySettingsForLinkedMobilityAccountL - End")); |
|
1792 } |
|
1793 |
|
1794 /** |
|
1795 @SYMTestCaseID SMTP-MOB-OTH-ACC-0010 |
|
1796 @SYMTestType CIT |
|
1797 @SYMPREQ PREQ1307 |
|
1798 @SYMREQ REQ6981 |
|
1799 @SYMTestCaseDesc Tests saving settings for non existent SMTP mobility account |
|
1800 */ |
|
1801 void CTestSmtpMobilityAccounts::TestSaveMobilitySettingsForNonExistentMobilityAccountL() |
|
1802 { |
|
1803 INFO_PRINTF1(_L("TestSaveMobilitySettingsForNonExistentMobilityAccountL - Start")); |
|
1804 |
|
1805 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1806 |
|
1807 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1808 |
|
1809 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
1810 |
|
1811 TRAPD(err, iEmailAccounts->SaveSmtpMobilitySettingsL(mobAcc, *iMobAccSettings)); |
|
1812 |
|
1813 ASSERT_EQUALS(err, KErrNotFound); |
|
1814 |
|
1815 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1816 |
|
1817 INFO_PRINTF1(_L("TestSaveMobilitySettingsForNonExistentMobilityAccountL - End")); |
|
1818 } |
|
1819 |
|
1820 /** |
|
1821 @SYMTestCaseID SMTP-MOB-OTH-ACC-0011 |
|
1822 @SYMTestType CIT |
|
1823 @SYMPREQ PREQ1307 |
|
1824 @SYMREQ REQ6981 |
|
1825 @SYMTestCaseDesc Tests loading IAP list for non existent SMTP mobility account |
|
1826 */ |
|
1827 void CTestSmtpMobilityAccounts::TestLoadIapListForNonExistentMobilityAccountL() |
|
1828 { |
|
1829 INFO_PRINTF1(_L("TestLoadIapListForNonExistentMobilityAccountL - Start")); |
|
1830 |
|
1831 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1832 |
|
1833 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1834 |
|
1835 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
1836 |
|
1837 TRAPD(err, iEmailAccounts->LoadSmtpMobilityAccountIapListL(mobAcc, iIapList)); |
|
1838 |
|
1839 ASSERT_EQUALS(err, KErrNotFound); |
|
1840 |
|
1841 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1842 |
|
1843 INFO_PRINTF1(_L("TestLoadIapListForNonExistentMobilityAccountL - End")); |
|
1844 } |
|
1845 |
|
1846 /** |
|
1847 @SYMTestCaseID SMTP-MOB-OTH-ACC-0012 |
|
1848 @SYMTestType CIT |
|
1849 @SYMPREQ PREQ1307 |
|
1850 @SYMREQ REQ6981 |
|
1851 @SYMTestCaseDesc Tests saving IAP list with no IAPs |
|
1852 */ |
|
1853 void CTestSmtpMobilityAccounts::TestSaveIapListWith0IapsL() |
|
1854 { |
|
1855 INFO_PRINTF1(_L("TestSaveIapListWith0IapsL - Start")); |
|
1856 |
|
1857 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1858 |
|
1859 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1860 |
|
1861 RArrayIAP iapList; |
|
1862 CleanupClosePushL(iapList); |
|
1863 |
|
1864 TRAPD(err, iEmailAccounts->SaveSmtpMobilityAccountIapListL(mobAcc, iapList)); |
|
1865 |
|
1866 ASSERT_EQUALS(err, KErrArgument); |
|
1867 |
|
1868 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1869 |
|
1870 CleanupStack::PopAndDestroy(&iapList); |
|
1871 |
|
1872 INFO_PRINTF1(_L("TestSaveIapListWith0IapsL - End")); |
|
1873 } |
|
1874 |
|
1875 /** |
|
1876 @SYMTestCaseID SMTP-MOB-OTH-ACC-0013 |
|
1877 @SYMTestType CIT |
|
1878 @SYMPREQ PREQ1307 |
|
1879 @SYMREQ REQ6981 |
|
1880 @SYMTestCaseDesc Tests saving IAP list with 33 IAPs |
|
1881 */ |
|
1882 void CTestSmtpMobilityAccounts::TestSaveIapListWith33IapsL() |
|
1883 { |
|
1884 INFO_PRINTF1(_L("TestSaveIapListWith33IapsL - Start")); |
|
1885 |
|
1886 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1887 |
|
1888 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1889 |
|
1890 RArrayIAP iapList; |
|
1891 CleanupClosePushL(iapList); |
|
1892 for (TInt count = 1; count <= 33; ++count) |
|
1893 { |
|
1894 iapList.AppendL(count); |
|
1895 } |
|
1896 |
|
1897 TRAPD(err, iEmailAccounts->SaveSmtpMobilityAccountIapListL(mobAcc, iapList)); |
|
1898 |
|
1899 ASSERT_EQUALS(err, KErrArgument); |
|
1900 |
|
1901 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1902 |
|
1903 CleanupStack::PopAndDestroy(&iapList); |
|
1904 |
|
1905 INFO_PRINTF1(_L("TestSaveIapListWith33IapsL - End")); |
|
1906 } |
|
1907 |
|
1908 /** |
|
1909 @SYMTestCaseID SMTP-MOB-OTH-ACC-0014 |
|
1910 @SYMTestType CIT |
|
1911 @SYMPREQ PREQ1307 |
|
1912 @SYMREQ REQ6981 |
|
1913 @SYMTestCaseDesc Tests saving IAP list with IAP that already exists in the IAP list for another mobility account under the same parent SMTP account |
|
1914 */ |
|
1915 void CTestSmtpMobilityAccounts::TestSaveIapListWithExistingIapL() |
|
1916 { |
|
1917 INFO_PRINTF1(_L("TestSaveIapListWithExistingIapL - Start")); |
|
1918 |
|
1919 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1920 |
|
1921 TSmtpMobilityAccount mobAcc1 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1922 |
|
1923 RArrayIAP iapList; |
|
1924 CleanupClosePushL(iapList); |
|
1925 iapList.AppendL(2); |
|
1926 |
|
1927 TSmtpMobilityAccount mobAcc2 = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc2Name, iapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1928 |
|
1929 iapList.AppendL(1); |
|
1930 TRAPD(err, iEmailAccounts->SaveSmtpMobilityAccountIapListL(mobAcc2, iapList)); |
|
1931 |
|
1932 ASSERT_EQUALS(err, KErrAlreadyExists); |
|
1933 |
|
1934 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1935 |
|
1936 CleanupStack::PopAndDestroy(&iapList); |
|
1937 |
|
1938 INFO_PRINTF1(_L("TestSaveIapListWithExistingIapL - End")); |
|
1939 } |
|
1940 |
|
1941 /** |
|
1942 @SYMTestCaseID SMTP-MOB-OTH-ACC-0015 |
|
1943 @SYMTestType CIT |
|
1944 @SYMPREQ PREQ1307 |
|
1945 @SYMREQ REQ6981 |
|
1946 @SYMTestCaseDesc Tests saving IAP list for non existent SMTP mobility account |
|
1947 */ |
|
1948 void CTestSmtpMobilityAccounts::TestSaveIapListForNonExistentMobilityAccountL() |
|
1949 { |
|
1950 INFO_PRINTF1(_L("TestSaveIapListForNonExistentMobilityAccountL - Start")); |
|
1951 |
|
1952 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1953 |
|
1954 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1955 |
|
1956 iEmailAccounts->DeleteSmtpMobilityAccountL(mobAcc); |
|
1957 |
|
1958 TRAPD(err, iEmailAccounts->SaveSmtpMobilityAccountIapListL(mobAcc, iIapList)); |
|
1959 |
|
1960 ASSERT_EQUALS(err, KErrNotFound); |
|
1961 |
|
1962 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
1963 |
|
1964 INFO_PRINTF1(_L("TestSaveIapListForNonExistentMobilityAccountL - End")); |
|
1965 } |
|
1966 |
|
1967 /** |
|
1968 @SYMTestCaseID SMTP-MOB-OTH-ACC-0016 |
|
1969 @SYMTestType CIT |
|
1970 @SYMPREQ PREQ1307 |
|
1971 @SYMREQ REQ6981 |
|
1972 @SYMTestCaseDesc Tests trying to perform SMTP account operations on SMTP mobility accounts, and vice versa |
|
1973 */ |
|
1974 void CTestSmtpMobilityAccounts::TestWrongAccountTypesL() |
|
1975 { |
|
1976 INFO_PRINTF1(_L("TestWrongAccountTypesL - Start")); |
|
1977 |
|
1978 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
1979 |
|
1980 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
1981 |
|
1982 TInt err = KErrNone; |
|
1983 TSmtpAccount brokenSmtpAcc; |
|
1984 |
|
1985 TRAP(err, iEmailAccounts->GetSmtpAccountL(mobAcc.iAccountId, brokenSmtpAcc)); |
|
1986 ASSERT_EQUALS(err, KErrNotFound); |
|
1987 |
|
1988 brokenSmtpAcc = smtpAcc; |
|
1989 brokenSmtpAcc.iSmtpAccountId = mobAcc.iAccountId; |
|
1990 |
|
1991 TSmtpMobilityAccount brokenMobAcc = mobAcc; |
|
1992 brokenMobAcc.iAccountId = smtpAcc.iSmtpAccountId; |
|
1993 |
|
1994 TRAP(err, iEmailAccounts->DeleteSmtpAccountL(brokenSmtpAcc)); |
|
1995 ASSERT_EQUALS(err, KErrNotFound); |
|
1996 |
|
1997 TRAP(err, iEmailAccounts->DeleteSmtpMobilityAccountL(brokenMobAcc)); |
|
1998 ASSERT_EQUALS(err, KErrNotFound); |
|
1999 |
|
2000 TRAP(err, iEmailAccounts->SetDefaultSmtpAccountL(brokenSmtpAcc)); |
|
2001 ASSERT_EQUALS(err, KErrNotFound); |
|
2002 |
|
2003 TRAP(err, iEmailAccounts->LoadSmtpSettingsL(brokenSmtpAcc, *iSmtpAccSettings)); |
|
2004 ASSERT_EQUALS(err, KErrNotFound); |
|
2005 |
|
2006 TRAP(err, iEmailAccounts->SaveSmtpSettingsL(brokenSmtpAcc, *iSmtpAccSettings)); |
|
2007 ASSERT_EQUALS(err, KErrNotFound); |
|
2008 |
|
2009 TRAP(err, iEmailAccounts->LoadSmtpIapSettingsL(brokenSmtpAcc, *iIapPrefs)); |
|
2010 ASSERT_EQUALS(err, KErrNotFound); |
|
2011 |
|
2012 TRAP(err, iEmailAccounts->SaveSmtpIapSettingsL(brokenSmtpAcc, *iIapPrefs)); |
|
2013 ASSERT_EQUALS(err, KErrNotFound); |
|
2014 |
|
2015 TRAP(err, iEmailAccounts->LoadSmtpMobilitySettingsL(brokenMobAcc, *iMobAccSettings)); |
|
2016 ASSERT_EQUALS(err, KErrNotFound); |
|
2017 |
|
2018 TRAP(err, iEmailAccounts->SaveSmtpMobilitySettingsL(brokenMobAcc, *iMobAccSettings)); |
|
2019 ASSERT_EQUALS(err, KErrNotFound); |
|
2020 |
|
2021 TRAP(err, iEmailAccounts->SaveSmtpMobilityAccountIapListL(brokenMobAcc, iIapList)); |
|
2022 ASSERT_EQUALS(err, KErrNotFound); |
|
2023 |
|
2024 TRAP(err, iEmailAccounts->LoadSmtpMobilityAccountIapListL(brokenMobAcc, iIapList)); |
|
2025 ASSERT_EQUALS(err, KErrNotFound); |
|
2026 |
|
2027 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
2028 |
|
2029 INFO_PRINTF1(_L("TestWrongAccountTypesL - End")); |
|
2030 } |
|
2031 |
|
2032 /** |
|
2033 @SYMTestCaseID SMTP-MOB-UT-0001 |
|
2034 @SYMTestType UT |
|
2035 @SYMPREQ PREQ1307 |
|
2036 @SYMTestCaseDesc Tests loading the mobility settings for a given SMTP account and IAP |
|
2037 */ |
|
2038 void CTestSmtpMobilityAccounts::TestLoadMobilitySettingsForSmtpAccountAndIapL() |
|
2039 { |
|
2040 INFO_PRINTF1(_L("TestLoadMobilitySettingsForSmtpAccountAndIapL - Start")); |
|
2041 |
|
2042 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
2043 |
|
2044 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
2045 |
|
2046 CImSmtpMobilitySettings* mobAccSettings = CImSmtpMobilitySettings::NewLC(); |
|
2047 ASSERT_TRUE(iEmailAccounts->LoadSmtpMobilitySettingsL(smtpAcc.iSmtpAccountId, 1, *mobAccSettings)); |
|
2048 ASSERT_EQUALS(mobAccSettings->SmtpSettings(), iMobAccSettings->SmtpSettings()); |
|
2049 CleanupStack::PopAndDestroy(mobAccSettings); |
|
2050 |
|
2051 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
2052 |
|
2053 INFO_PRINTF1(_L("TestLoadMobilitySettingsForSmtpAccountAndIapL - End")); |
|
2054 } |
|
2055 |
|
2056 /** |
|
2057 @SYMTestCaseID SMTP-MOB-UT-0002 |
|
2058 @SYMTestType UT |
|
2059 @SYMPREQ PREQ1307 |
|
2060 @SYMTestCaseDesc Tests trying to load the mobility settings for a non existent SMTP account and IAP |
|
2061 */ |
|
2062 void CTestSmtpMobilityAccounts::TestLoadMobilitySettingsForNonExistentSmtpAccountAndIapL() |
|
2063 { |
|
2064 INFO_PRINTF1(_L("TestLoadMobilitySettingsForNonExistentSmtpAccountAndIapL - Start")); |
|
2065 |
|
2066 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
2067 |
|
2068 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
2069 |
|
2070 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
2071 |
|
2072 CImSmtpMobilitySettings* mobAccSettings = CImSmtpMobilitySettings::NewLC(); |
|
2073 ASSERT_FALSE(iEmailAccounts->LoadSmtpMobilitySettingsL(smtpAcc.iSmtpAccountId, 1, *mobAccSettings)); |
|
2074 CleanupStack::PopAndDestroy(mobAccSettings); |
|
2075 |
|
2076 INFO_PRINTF1(_L("TestLoadMobilitySettingsForNonExistentSmtpAccountAndIapL - End")); |
|
2077 } |
|
2078 |
|
2079 /** |
|
2080 @SYMTestCaseID SMTP-MOB-UT-0003 |
|
2081 @SYMTestType UT |
|
2082 @SYMPREQ PREQ1307 |
|
2083 @SYMTestCaseDesc Tests trying to load the mobility settings for a SMTP account and non existent IAP |
|
2084 */ |
|
2085 void CTestSmtpMobilityAccounts::TestLoadMobilitySettingsForSmtpAccountAndNonExistentIapL() |
|
2086 { |
|
2087 INFO_PRINTF1(_L("TestLoadMobilitySettingsForSmtpAccountAndNonExistentIapL - Start")); |
|
2088 |
|
2089 TSmtpAccount smtpAcc = iEmailAccounts->CreateSmtpAccountL(KSmtpAcc1Name, *iSmtpAccSettings, *iIapPrefs, EFalse); |
|
2090 |
|
2091 TSmtpMobilityAccount mobAcc = iEmailAccounts->CreateSmtpMobilityAccountL(KMobAcc1Name, iIapList, smtpAcc, *iMobAccSettings, EFalse); |
|
2092 |
|
2093 CImSmtpMobilitySettings* mobAccSettings = CImSmtpMobilitySettings::NewLC(); |
|
2094 ASSERT_FALSE(iEmailAccounts->LoadSmtpMobilitySettingsL(smtpAcc.iSmtpAccountId, 2, *mobAccSettings)); |
|
2095 CleanupStack::PopAndDestroy(mobAccSettings); |
|
2096 |
|
2097 iEmailAccounts->DeleteSmtpAccountL(smtpAcc); |
|
2098 |
|
2099 INFO_PRINTF1(_L("TestLoadMobilitySettingsForSmtpAccountAndNonExistentIapL - End")); |
|
2100 } |
|
2101 |
|
2102 /** |
|
2103 Creates the test suite |
|
2104 |
|
2105 @param aName Test suite name |
|
2106 |
|
2107 @return Test suite |
|
2108 */ |
|
2109 CTestSuite* CTestSmtpMobilityAccounts::CreateSuiteL(const TDesC& aName) |
|
2110 { |
|
2111 SUB_SUITE; |
|
2112 |
|
2113 ADD_ASYNC_TEST_STEP(TestSmtpAccountL); |
|
2114 |
|
2115 ADD_ASYNC_TEST_STEP(Test1MobilityAccountL); |
|
2116 ADD_ASYNC_TEST_STEP(Test1MobilityAccountWithParentDeletionL); |
|
2117 ADD_ASYNC_TEST_STEP(Test2MobilityAccountsL); |
|
2118 ADD_ASYNC_TEST_STEP(Test2MobilityAccountsWithParentDeletionL); |
|
2119 ADD_ASYNC_TEST_STEP(Test2MobilityAccountsWithSameParentDeletionL); |
|
2120 ADD_ASYNC_TEST_STEP(Test2MobilityAccountsWithSameParentL); |
|
2121 ADD_ASYNC_TEST_STEP(TestMobilityAccountWithPopL); |
|
2122 ADD_ASYNC_TEST_STEP(TestMobilityAccountWithImapL); |
|
2123 ADD_ASYNC_TEST_STEP(Test3MobilityAccountsDelete123L); |
|
2124 ADD_ASYNC_TEST_STEP(Test3MobilityAccountsDelete321L); |
|
2125 ADD_ASYNC_TEST_STEP(Test3MobilityAccountsDelete213L); |
|
2126 ADD_ASYNC_TEST_STEP(TestChangeMobilityAccountSettingsL); |
|
2127 ADD_ASYNC_TEST_STEP(TestChangeMobilityAccountIapListL); |
|
2128 |
|
2129 ADD_ASYNC_TEST_STEP(Test1LinkedMobilityAccountL); |
|
2130 ADD_ASYNC_TEST_STEP(Test1LinkedMobilityAccountWithLinkedDeletionL); |
|
2131 ADD_ASYNC_TEST_STEP(Test2LinkedMobilityAccountsL); |
|
2132 ADD_ASYNC_TEST_STEP(Test2LinkedMobilityAccountsWithLinkedDeletionL); |
|
2133 ADD_ASYNC_TEST_STEP(Test2LinkedMobilityAccountsWithSameLinkedDeletionL); |
|
2134 ADD_ASYNC_TEST_STEP(Test2LinkedMobilityAccountsWithSameLinkedL); |
|
2135 ADD_ASYNC_TEST_STEP(TestLinkedMobilityAccountWithPopL); |
|
2136 ADD_ASYNC_TEST_STEP(TestLinkedMobilityAccountWithImapL); |
|
2137 ADD_ASYNC_TEST_STEP(Test3LinkedMobilityAccountsDelete123L); |
|
2138 ADD_ASYNC_TEST_STEP(Test3LinkedMobilityAccountsDelete321L); |
|
2139 ADD_ASYNC_TEST_STEP(Test3LinkedMobilityAccountsDelete213L); |
|
2140 ADD_ASYNC_TEST_STEP(TestChangeLinkedMobilityAccountIapListL); |
|
2141 |
|
2142 ADD_ASYNC_TEST_STEP(TestMobilityAccountLinkedToParentL); |
|
2143 ADD_ASYNC_TEST_STEP(Test2MobilityAccountsWithSameParentAndIapL); |
|
2144 ADD_ASYNC_TEST_STEP(TestMobilityAccountWith0IapsL); |
|
2145 ADD_ASYNC_TEST_STEP(TestMobilityAccountWith33IapsL); |
|
2146 ADD_ASYNC_TEST_STEP(TestCreate33MobilityAccountsWithSameParentL); |
|
2147 ADD_ASYNC_TEST_STEP(TestCreateMobilityAccountWithTooLongAccountNameL); |
|
2148 ADD_ASYNC_TEST_STEP(TestDeleteNonExistentMobilityAccountL); |
|
2149 ADD_ASYNC_TEST_STEP(TestLoadMobilitySettingsForNonExistentMobilityAccountL); |
|
2150 ADD_ASYNC_TEST_STEP(TestSaveMobilitySettingsForLinkedMobilityAccountL); |
|
2151 ADD_ASYNC_TEST_STEP(TestSaveMobilitySettingsForNonExistentMobilityAccountL); |
|
2152 ADD_ASYNC_TEST_STEP(TestLoadIapListForNonExistentMobilityAccountL); |
|
2153 ADD_ASYNC_TEST_STEP(TestSaveIapListWith0IapsL); |
|
2154 ADD_ASYNC_TEST_STEP(TestSaveIapListWith33IapsL); |
|
2155 ADD_ASYNC_TEST_STEP(TestSaveIapListWithExistingIapL); |
|
2156 ADD_ASYNC_TEST_STEP(TestSaveIapListForNonExistentMobilityAccountL); |
|
2157 ADD_ASYNC_TEST_STEP(TestWrongAccountTypesL); |
|
2158 |
|
2159 ADD_ASYNC_TEST_STEP(TestLoadMobilitySettingsForSmtpAccountAndIapL); |
|
2160 ADD_ASYNC_TEST_STEP(TestLoadMobilitySettingsForNonExistentSmtpAccountAndIapL); |
|
2161 ADD_ASYNC_TEST_STEP(TestLoadMobilitySettingsForSmtpAccountAndNonExistentIapL); |
|
2162 |
|
2163 END_SUITE; |
|
2164 } |