mmsengine/mmssettings/test/src/T_MmsSettings.cpp
changeset 31 ebfee66fde93
parent 0 72b543305e3a
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #include "T_MmsSettings.h"
       
    18 #include <cmmssettings.h>
       
    19 #include <cmmsaccounts.h>
       
    20 #include <mmmssettingsobserver.h>
       
    21 #include <centralrepository.h>
       
    22 
       
    23 class CTestNotification : public CBase, public MMmsSettingsObserver
       
    24 	{
       
    25 public:
       
    26 	static CTestNotification* NewL( );
       
    27 	CTestNotification();	
       
    28 	void ConstructL();
       
    29 	~CTestNotification();
       
    30   	void HandleNotify(TMmsSettingsEvent aEvent);
       
    31   	void StartSetTestL();
       
    32   	void StartCreateTestL();
       
    33 	void StartDeleteTestL();
       
    34 	};
       
    35 
       
    36 
       
    37 
       
    38 
       
    39 RTest test(_L("MMS Settings"));
       
    40 CMmsAccounts* account;
       
    41 CMmsSettings* settings;
       
    42 CMmsSettings* settingsVerify;
       
    43 CTestNotification* notification;
       
    44 TMmsAccountId accountId;
       
    45 TBuf<KMmsAccountNameSize> buffer1;
       
    46 TBuf<KMmsAccountNameSize> buffer2;
       
    47 
       
    48 const TUid KProxy = {0x1001};
       
    49 const TUid KNapId = {0x1002};
       
    50 const TUid KMMSRepositoryUid = {0x10202D4C};
       
    51 
       
    52 _LIT(KAccountName, "MMS Account");
       
    53 _LIT(KAddress, "MMS Address");
       
    54 _LIT(KAccountNameBlank, "");
       
    55 
       
    56 _LIT(KAccount1, "AccountNo 1: %d");
       
    57 _LIT(KAccount2, "AccountNo 2: %d");
       
    58 _LIT(KAccount3, "AccountNo 3: %d");
       
    59 _LIT(KAccount4, "AccountNo 4: %d");
       
    60 	
       
    61 
       
    62 CTestNotification* CTestNotification::NewL()
       
    63 	{
       
    64 	CTestNotification* self = new(ELeave) CTestNotification();
       
    65 	CleanupStack::PushL(self);
       
    66 	self->ConstructL();
       
    67 	CleanupStack::Pop();
       
    68 	return self;
       
    69 	}
       
    70 
       
    71 void CTestNotification::ConstructL()
       
    72 	{
       
    73 	account->AddObserverL(*this);	
       
    74 	}
       
    75 
       
    76 CTestNotification::CTestNotification()
       
    77 	{
       
    78 	}
       
    79 
       
    80 CTestNotification::~CTestNotification() 
       
    81 	{
       
    82 	}
       
    83 	
       
    84 void CTestNotification::StartCreateTestL()
       
    85 	{		
       
    86 	//create a new account
       
    87 	settings = CMmsSettings::NewL();
       
    88 	account->PopulateDefaultSettingsL(*settings);
       
    89 	accountId = account->CreateMMSAccountL(KAccountName, *settings);
       
    90 
       
    91 	// cleanup
       
    92 	delete settings;	
       
    93 	}
       
    94 
       
    95 void CTestNotification::StartSetTestL()
       
    96 	{		
       
    97 	// change a setting
       
    98 	settings = CMmsSettings::NewL();
       
    99 	account->LoadSettingsL(accountId, *settings);
       
   100 	settings->SetApplicationID(4);
       
   101 	account->SaveSettingsL(accountId, *settings);
       
   102 	
       
   103 	// cleanup
       
   104 	delete settings;	
       
   105 	}
       
   106 
       
   107 void CTestNotification::StartDeleteTestL()
       
   108 	{		
       
   109 	// delete a account
       
   110 	account->DeleteMMSAccountL(accountId);
       
   111 	}
       
   112 
       
   113 
       
   114 void CTestNotification::HandleNotify(TMmsSettingsEvent /*aEvent*/)
       
   115 	{
       
   116 	_LIT(KComment, "\t\tNotification received");
       
   117 	theUtils->WriteComment(KComment);
       
   118 	CActiveScheduler::Stop();
       
   119 	}
       
   120 
       
   121 
       
   122 // Forward declarations and doTestL() are placed here to satisfy leavescan.
       
   123 // If leavescan is at the bottom of the file, a leavescan error is produces.
       
   124 void InitL();
       
   125 void TestCreateAccountL();
       
   126 void TestSaveSettingsL();
       
   127 void TestDefaultAccountL();
       
   128 void TestCopySettingsL();
       
   129 void TestDeleteAccountL();
       
   130 void TestDeletedDefaultAccountL();
       
   131 void TestMultipleAccountsWithBlankNameL();
       
   132 void TestMultipleAccountsL();
       
   133 void TestNotificationL();
       
   134 void CleanupL();
       
   135 	
       
   136 void doTestsL()
       
   137 	{
       
   138 	InitL();
       
   139 	
       
   140 	TestCreateAccountL();
       
   141 	TestSaveSettingsL();
       
   142 	TestDefaultAccountL();
       
   143 	TestCopySettingsL();
       
   144 	TestDeleteAccountL();
       
   145 	TestDeletedDefaultAccountL();
       
   146 	TestMultipleAccountsWithBlankNameL();
       
   147 	TestMultipleAccountsL();
       
   148 	TestNotificationL();
       
   149 
       
   150 	CleanupL();
       
   151 	}
       
   152 
       
   153 TBool CompareBooleans(TBool aBoolean1, TBool aBoolean2, const TDesC* aTestDescription)
       
   154 	{
       
   155 	_LIT(KErrorReason, "\t\tSettings not set correctly for %S");
       
   156 	TBuf<80> buf;
       
   157 	TBuf<80> temp;
       
   158 	temp.Copy(*aTestDescription);
       
   159 	TBool result = ((aBoolean1 && aBoolean2) || (!aBoolean1 && !aBoolean2));
       
   160 	if (!result)
       
   161 		{
       
   162 		buf.AppendFormat(KErrorReason, &temp);
       
   163 		theUtils->WriteComment(buf);
       
   164 		}
       
   165 
       
   166 	return result;
       
   167 	}
       
   168 
       
   169 TBool CompareDescriptors(TDesC& aDesC1, TDesC16& aDesC2, const TDesC* aTestDescription)
       
   170 	{
       
   171 	_LIT(KErrorReason, "\t\tSettings not set correctly for %S");
       
   172 	TBuf<80> buf;
       
   173 	TBuf<80> temp;
       
   174 	temp.Copy(*aTestDescription);
       
   175 	TBool result = (aDesC1 == aDesC2);
       
   176 	if (!result)
       
   177 		{
       
   178 		buf.AppendFormat(KErrorReason, &temp);
       
   179 		theUtils->WriteComment(buf);
       
   180 		}
       
   181 
       
   182 	return result;
       
   183 	}
       
   184 
       
   185 TBool CompareIntegers(TInt aInt1, TInt aInt2, const TDesC* aTestDescription)
       
   186 	{
       
   187 	_LIT(KErrorReason, "\t\tSettings not set correctly for %S");
       
   188 	TBuf<80> buf;
       
   189 	TBuf<80> temp;
       
   190 	temp.Copy(*aTestDescription);
       
   191 	TBool result = (aInt1 == aInt2);
       
   192 	if (!result)
       
   193 		{
       
   194 		buf.AppendFormat(KErrorReason, &temp);
       
   195 		theUtils->WriteComment(buf);
       
   196 		}
       
   197 
       
   198 	return result;
       
   199 	}
       
   200 	
       
   201 LOCAL_C void ResetSettings()
       
   202 	{
       
   203 	// Reset the repository by clearing any existing settings and restoring the 
       
   204    	// default settings
       
   205 	CRepository* repository = CRepository::NewL(KMMSRepositoryUid);
       
   206 	repository->Reset();
       
   207 	delete repository;
       
   208 	}
       
   209 
       
   210 void InitL()
       
   211 	{	
       
   212 	ResetSettings();	
       
   213 	account = CMmsAccounts::NewLC();
       
   214 	notification = CTestNotification::NewL();
       
   215 	CleanupStack::PushL(notification);	
       
   216 	}
       
   217 
       
   218 void CleanupL()
       
   219 	{
       
   220 	CleanupStack::PopAndDestroy(2, account);	// notification, account
       
   221 	}
       
   222 
       
   223 void FillSettings()
       
   224 	{
       
   225 	settings->SetApplicationID(6);
       
   226    	settings->SetAddressL(KAddress);	
       
   227    	settings->SetCreationModeL(ECreationModeWarning);
       
   228     settings->AddProxyL(KProxy);
       
   229     settings->AddProxyL(KProxy);
       
   230     settings->AddProxyL(KProxy);
       
   231     settings->AddNapIdL(KNapId);
       
   232     settings->AddNapIdL(KNapId);
       
   233     settings->AddNapIdL(KNapId);
       
   234     settings->SetDisplayNotification(ETrue);
       
   235     settings->SetAutomaticDownload(EAutomaticDownloadOnlyWhenRoaming);
       
   236     settings->SetCreationModeReadOnly(ETrue);
       
   237     settings->SetValidityPeriod(16);
       
   238     settings->SetMaxDownloadSize (20);
       
   239     settings->SetPriority (ETrue);
       
   240     settings->SetHideNumber(ETrue);
       
   241     settings->SetReadReport(ETrue);
       
   242     settings->SetDeliveryReport(ETrue);
       
   243     settings->SetReplyWithHistory (EFalse);
       
   244     settings->SetAllowDeliveryNotification(EFalse);
       
   245     settings->SetFilterAdvertisements(EFalse);
       
   246     settings->SetMaxDownloadRetries(ETrue);
       
   247     settings->SetDownloadRetryInterval(7);
       
   248     settings->SetMaxSendMsgSize (8);
       
   249     settings->SetFullScreenPreview(EFalse);
       
   250 	settings->SetDeviceContentClass(4);
       
   251 	settings->SetMaxImageHeight(3);
       
   252     settings->SetMaxImageWidth(6);   
       
   253 
       
   254 	_LIT(KComment, "\t\tCreated Filled POP3 Settings");
       
   255 	theUtils->WriteComment(KComment);
       
   256 	}
       
   257 
       
   258 TBool CompareSettings()
       
   259 	{
       
   260 	_LIT(KComment, "\t\tComparing Filled POP3 Settings");
       
   261 	theUtils->WriteComment(KComment);
       
   262 	TBool result = ETrue;
       
   263 
       
   264 	result &= CompareIntegers((settings->ApplicationID()), (settingsVerify->ApplicationID()), &KNullDesC);
       
   265 
       
   266 	buffer1 = settings->Address();
       
   267 	buffer2 = settingsVerify->Address();
       
   268 	result &= CompareDescriptors(buffer1, buffer2, &KNullDesC); 
       
   269 
       
   270 	TBool result1=((settings->CreationMode())==(settingsVerify->CreationMode()));
       
   271 	if (!result1)
       
   272 		{
       
   273 		_LIT(KComment, "\t\tCreationMode not Identical");
       
   274 		theUtils->WriteComment(KComment);
       
   275 		}
       
   276 	result &= result1;
       
   277 
       
   278 	result &= CompareIntegers((settings->ProxyCount()), (settingsVerify->ProxyCount()), &KNullDesC);
       
   279 
       
   280 	TBool result2 = EFalse;
       
   281 	for (TInt index = 0; index < settings->ProxyCount(); ++index)
       
   282 		{		
       
   283 		result2=((settings->GetProxy(index))==(settingsVerify->GetProxy(index)));
       
   284 		if (!result2)
       
   285 			{
       
   286 			_LIT(KComment, "\t\tProxy not Identical");
       
   287 			theUtils->WriteComment(KComment);
       
   288 			}
       
   289 		result &= result2;
       
   290 		}
       
   291 
       
   292 	result &= CompareIntegers((settings->NapIdCount()), (settingsVerify->NapIdCount()), &KNullDesC);
       
   293 
       
   294 	TBool result3 = EFalse;
       
   295 	for (TInt index = 0; index < settings->NapIdCount(); ++index)
       
   296 		{		
       
   297 		result3=((settings->GetNapId(index))==(settingsVerify->GetNapId(index)));
       
   298 		if (!result3)
       
   299 			{
       
   300 			_LIT(KComment, "\t\tNap Id not Identical");
       
   301 			theUtils->WriteComment(KComment);
       
   302 			}
       
   303 		result &= result3;
       
   304 		}
       
   305 
       
   306 	result &= CompareBooleans(settings->DisplayNotification(), settingsVerify->DisplayNotification(), &KNullDesC);
       
   307 
       
   308 	TBool result4=((settings->AutomaticDownload())==(settingsVerify->AutomaticDownload()));
       
   309 	if (!result4)
       
   310 		{
       
   311 		_LIT(KComment, "\t\tDisplayNotification not Identical");
       
   312 		theUtils->WriteComment(KComment);
       
   313 		}
       
   314 	result &= result4;
       
   315 
       
   316 	result &= CompareBooleans(settings->CreationModeReadOnly(), settingsVerify->CreationModeReadOnly(), &KNullDesC);
       
   317 	result &= CompareIntegers((settings->ValidityPeriod()), (settingsVerify->ValidityPeriod()), &KNullDesC);
       
   318 	result &= CompareIntegers((settings->MaxDownloadSize()), (settingsVerify->MaxDownloadSize()), &KNullDesC);
       
   319 	result &= CompareBooleans(settings->Priority(), settingsVerify->Priority(), &KNullDesC);
       
   320 	result &= CompareBooleans(settings->HideNumber(), settingsVerify->HideNumber(), &KNullDesC);
       
   321 	result &= CompareBooleans(settings->ReadReport(), settingsVerify->ReadReport(), &KNullDesC);
       
   322 	result &= CompareBooleans(settings->DeliveryReport(), settingsVerify->DeliveryReport(), &KNullDesC);
       
   323 	result &= CompareBooleans(settings->ReplyWithHistory(), settingsVerify->ReplyWithHistory(), &KNullDesC);
       
   324 	result &= CompareBooleans(settings->AllowDeliveryNotification(), settingsVerify->AllowDeliveryNotification(), &KNullDesC);
       
   325 	result &= CompareBooleans(settings->FilterAdvertisements(), settingsVerify->FilterAdvertisements(), &KNullDesC);
       
   326 	result &= CompareIntegers((settings->MaxDownloadRetries()), (settingsVerify->MaxDownloadRetries()), &KNullDesC);
       
   327 	result &= CompareIntegers((settings->DownloadRetryInterval()), (settingsVerify->DownloadRetryInterval()), &KNullDesC);
       
   328 	result &= CompareIntegers((settings->MaxSendMsgSize()), (settingsVerify->MaxSendMsgSize()), &KNullDesC);
       
   329 	result &= CompareBooleans(settings->FullScreenPreview(), settingsVerify->FullScreenPreview(), &KNullDesC);
       
   330 	result &= CompareIntegers((settings->DeviceContentClass()), (settingsVerify->DeviceContentClass()), &KNullDesC);
       
   331 	result &= CompareIntegers((settings->MaxImageHeight()), (settingsVerify->MaxImageHeight()), &KNullDesC);
       
   332 	result &= CompareIntegers((settings->MaxImageWidth()), (settingsVerify->MaxImageWidth()), &KNullDesC);
       
   333 
       
   334 	return result;
       
   335 	}
       
   336 
       
   337 void TestMultipleAccountsWithBlankNameL()
       
   338 	{
       
   339 	theUtils->Start(_L("Multiple Account With BlankName  Test"));
       
   340 	// check there are no accounts
       
   341 	RArray<TMmsAccountId> mmsAccounts;
       
   342 	account->GetMMSAccountsL(mmsAccounts);	
       
   343 	test(mmsAccounts.Count() == 0);
       
   344 	// create 4 accounts
       
   345 	settings = CMmsSettings::NewL();
       
   346 	account->PopulateDefaultSettingsL(*settings);
       
   347 
       
   348 	accountId = account->CreateMMSAccountL(KAccountNameBlank, *settings);
       
   349 	theUtils->Printf(KAccount1, accountId.iMmsAccountId);
       
   350 	test(accountId.iMmsAccountId == 1);
       
   351 	
       
   352 	TMmsAccountId accountId1 = account->CreateMMSAccountL(KAccountNameBlank, *settings);
       
   353 	theUtils->Printf(KAccount2, accountId1.iMmsAccountId);
       
   354     test(accountId1.iMmsAccountId == 2);
       
   355 	
       
   356 	TMmsAccountId accountId2 = account->CreateMMSAccountL(KAccountNameBlank, *settings);
       
   357 	theUtils->Printf(KAccount3, accountId2.iMmsAccountId);
       
   358 	test(accountId2.iMmsAccountId == 3);
       
   359 
       
   360 	TMmsAccountId accountId3 = account->CreateMMSAccountL(KAccountNameBlank, *settings);
       
   361 	theUtils->Printf(KAccount4, accountId3.iMmsAccountId);
       
   362     test(accountId3.iMmsAccountId == 4 );
       
   363 
       
   364 	// check accounts
       
   365 	mmsAccounts.Reset();
       
   366 	account->GetMMSAccountsL(mmsAccounts);	
       
   367 	test(mmsAccounts.Count() == 4);
       
   368     // delete the  accounts
       
   369 	account->DeleteMMSAccountL(accountId3);
       
   370 	account->DeleteMMSAccountL(accountId1);
       
   371    	account->DeleteMMSAccountL(accountId2);
       
   372 	account->DeleteMMSAccountL(accountId);
       
   373 	mmsAccounts.Reset();
       
   374 	account->GetMMSAccountsL(mmsAccounts);	
       
   375 	test(mmsAccounts.Count() == 0);
       
   376 	delete settings;
       
   377 	mmsAccounts.Close();
       
   378     theUtils->Complete( ); 	
       
   379 	}
       
   380 
       
   381 void TestMultipleAccountsL()
       
   382 	{
       
   383 	theUtils->Start(_L("Multiple Account Test"));
       
   384 	
       
   385 	// check there are no accounts
       
   386 	RArray<TMmsAccountId> mmsAccounts;
       
   387 	account->GetMMSAccountsL(mmsAccounts);	
       
   388 	test(mmsAccounts.Count() == 0);
       
   389 
       
   390 	// create 4 accounts
       
   391 	settings = CMmsSettings::NewL();
       
   392 	account->PopulateDefaultSettingsL(*settings);
       
   393 	accountId = account->CreateMMSAccountL(KAccountName, *settings);
       
   394 	TMmsAccountId accountId1 = account->CreateMMSAccountL(KAccountName, *settings);
       
   395 	TMmsAccountId accountId2 = account->CreateMMSAccountL(KAccountName, *settings);
       
   396 	TMmsAccountId accountId3 = account->CreateMMSAccountL(KAccountName, *settings);
       
   397 
       
   398 	// check accounts
       
   399 	mmsAccounts.Reset();
       
   400 	account->GetMMSAccountsL(mmsAccounts);	
       
   401 	test(mmsAccounts.Count() == 4);
       
   402 	
       
   403 	// delete 2 accounts
       
   404 	account->DeleteMMSAccountL(accountId3);
       
   405 	account->DeleteMMSAccountL(accountId1);
       
   406 
       
   407 	// check accounts
       
   408 	mmsAccounts.Reset();
       
   409 	account->GetMMSAccountsL(mmsAccounts);	
       
   410 	test(mmsAccounts.Count() == 2);
       
   411 	
       
   412 	// cleanup
       
   413 	account->DeleteMMSAccountL(accountId2);
       
   414 	account->DeleteMMSAccountL(accountId);
       
   415 	mmsAccounts.Reset();
       
   416 	account->GetMMSAccountsL(mmsAccounts);	
       
   417 	test(mmsAccounts.Count() == 0);
       
   418 	delete settings;
       
   419 	mmsAccounts.Close();
       
   420 
       
   421 	theUtils->Complete( );
       
   422 	}
       
   423 
       
   424 void TestDeleteAccountL()
       
   425 	{
       
   426 	theUtils->Start(_L("Delete Account Test"));
       
   427 	
       
   428 	// should be one account created previously
       
   429 	RArray<TMmsAccountId> mmsAccounts;
       
   430 	account->GetMMSAccountsL(mmsAccounts);	
       
   431 	test(mmsAccounts.Count() == 1);
       
   432 
       
   433 	// delete account and check
       
   434 	account->DeleteMMSAccountL(accountId);
       
   435 	mmsAccounts.Reset();
       
   436 	account->GetMMSAccountsL(mmsAccounts);	
       
   437 	test(mmsAccounts.Count() == 0);
       
   438 
       
   439 	// cleanup
       
   440 	mmsAccounts.Close();
       
   441 
       
   442 	theUtils->Complete();
       
   443 	}
       
   444 
       
   445 void TestDeletedDefaultAccountL()
       
   446 /**
       
   447 Checks if the default account has been deleted from the repository
       
   448 For Defect Number: ZEBRA00018625
       
   449 */
       
   450 	{
       
   451 	theUtils->Start(_L("Delete Default Account Test"));
       
   452 	
       
   453 	RArray<TMmsAccountId> mmsAccounts;
       
   454 	account->GetMMSAccountsL(mmsAccounts);	
       
   455 	test(mmsAccounts.Count() == 0);
       
   456 
       
   457 	TMmsAccountId deletedDefaultaccountId;
       
   458 	// if the default account exists in the repository, along with valid settings 
       
   459 	// then the account Id and name will be returned, else KErrNotFound will 
       
   460 	// be returned.
       
   461 	TRAPD( leaveCode,deletedDefaultaccountId = account->DefaultMMSAccountL() );
       
   462 	test(leaveCode == KErrNotFound);
       
   463 
       
   464 	// cleanup
       
   465 	mmsAccounts.Reset();
       
   466 	mmsAccounts.Close();
       
   467 	theUtils->Complete();
       
   468 	}
       
   469 
       
   470 void TestCopySettingsL()
       
   471 	{
       
   472 	theUtils->Start(_L("Copy Settings Test"));
       
   473 	settings = CMmsSettings::NewL();
       
   474 	account->PopulateDefaultSettingsL(*settings);
       
   475 	
       
   476 	// load settings to copy
       
   477 	settingsVerify = CMmsSettings::NewL();	
       
   478 	account->LoadSettingsL(accountId, *settingsVerify);	
       
   479 	
       
   480 	// copy setting and check
       
   481 	settings->CopyL(*settingsVerify);
       
   482 	test(CompareSettings() == 1);
       
   483 	
       
   484 	// cleanup
       
   485 	delete settingsVerify;
       
   486 	delete settings;
       
   487 
       
   488 	theUtils->Complete();
       
   489 	}
       
   490 
       
   491 void TestDefaultAccountL()
       
   492 	{
       
   493 	theUtils->Start(_L("Default Account Test"));
       
   494 	
       
   495 	account->SetDefaultMMSAccountL(accountId);
       
   496 	TMmsAccountId accountId2 = account->DefaultMMSAccountL();
       
   497 
       
   498 	test(accountId.iMmsAccountId == accountId2.iMmsAccountId);	
       
   499 	test(accountId.iMmsAccountName == accountId2.iMmsAccountName);	
       
   500 
       
   501 	theUtils->Complete();
       
   502 	}
       
   503 
       
   504 void TestSaveSettingsL()
       
   505 	{
       
   506 	theUtils->Start(_L("Save Settings Test"));
       
   507 	
       
   508 	// save settings
       
   509 	settings = CMmsSettings::NewL();
       
   510 	settingsVerify = CMmsSettings::NewL();	
       
   511 	account->PopulateDefaultSettingsL(*settings);
       
   512 	FillSettings();
       
   513 	account->SaveSettingsL(accountId, *settings);
       
   514 
       
   515 	// check settings and accounts
       
   516 	account->LoadSettingsL(accountId, *settingsVerify);
       
   517 	test(CompareSettings() == 1);
       
   518 	
       
   519 	// cleanup
       
   520 	delete settingsVerify;
       
   521 	delete settings;
       
   522 
       
   523 	theUtils->Complete();
       
   524 	}
       
   525 
       
   526 void TestCreateAccountL()
       
   527 	{
       
   528 	theUtils->Start(_L("Create Account Test"));
       
   529 	
       
   530 	// check there are no accounts
       
   531 	RArray<TMmsAccountId> mmsAccounts;
       
   532 	account->GetMMSAccountsL(mmsAccounts);	
       
   533 	test(mmsAccounts.Count() == 0);
       
   534 
       
   535 	// create accounts
       
   536 	settings = CMmsSettings::NewL();
       
   537 	settingsVerify = CMmsSettings::NewL();	
       
   538 	account->PopulateDefaultSettingsL(*settings);
       
   539 	FillSettings();
       
   540 	accountId = account->CreateMMSAccountL(KAccountName, *settings);
       
   541 
       
   542 	// check settings and accounts
       
   543 	account->LoadSettingsL(accountId, *settingsVerify);
       
   544 	test(CompareSettings() == 1);
       
   545 	mmsAccounts.Reset();
       
   546 	account->GetMMSAccountsL(mmsAccounts);	
       
   547 	test(mmsAccounts.Count() == 1);
       
   548 	
       
   549 	// cleanup
       
   550 	delete settingsVerify;
       
   551 	delete settings;
       
   552 	mmsAccounts.Close();
       
   553 
       
   554 	theUtils->Complete();
       
   555 	}
       
   556 
       
   557 
       
   558 void TestNotificationL()
       
   559 	{
       
   560 	theUtils->Start(_L("Notification Test1: Create"));		
       
   561 	notification->StartCreateTestL();
       
   562 	CActiveScheduler::Start();	
       
   563 	theUtils->Complete();	
       
   564 
       
   565 	theUtils->Start(_L("Notification Test2: Set"));		
       
   566 	notification->StartSetTestL();
       
   567 	CActiveScheduler::Start();	
       
   568 	theUtils->Complete();	
       
   569 	
       
   570 	theUtils->Start(_L("Notification Test3: Delete"));		
       
   571 	notification->StartDeleteTestL();
       
   572 	CActiveScheduler::Start();	
       
   573 	theUtils->Complete();	
       
   574 	}
       
   575