telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestenstore.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 // Test step definitions for the ENStore functional unit.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalTechnology
       
    20 */
       
    21 
       
    22 #include "cctsyintegrationtestenstore.h"
       
    23 
       
    24 #include "cetelsessionmgr.h"
       
    25 #include "tetelrequeststatus.h"
       
    26 #include "listretrievalhelpers.h"
       
    27 
       
    28 	
       
    29 CCTSYIntegrationTestENStoreBase::CCTSYIntegrationTestENStoreBase(CEtelSessionMgr& aEtelSessionMgr)
       
    30 	: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iSimTsyTestHelper(*this), iPhoneTsyTestHelper(*this)
       
    31 /**
       
    32  * Constructor
       
    33  */
       
    34 	{
       
    35 	}
       
    36 
       
    37 CCTSYIntegrationTestENStoreBase::~CCTSYIntegrationTestENStoreBase()
       
    38 /*
       
    39  * Destructor
       
    40  */
       
    41 	{
       
    42 	}
       
    43 	
       
    44 
       
    45 CCTSYIntegrationTestENStore0001::CCTSYIntegrationTestENStore0001(CEtelSessionMgr& aEtelSessionMgr)
       
    46 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
    47 /**
       
    48  * Constructor.
       
    49  */
       
    50 	{
       
    51 	SetTestStepName(CCTSYIntegrationTestENStore0001::GetTestStepName());
       
    52 	}
       
    53 
       
    54 CCTSYIntegrationTestENStore0001::~CCTSYIntegrationTestENStore0001()
       
    55 /**
       
    56  * Destructor.
       
    57  */
       
    58 	{
       
    59 	}
       
    60 
       
    61 TVerdict CCTSYIntegrationTestENStore0001::doTestStepL()
       
    62 /**
       
    63  * @SYMTestCaseID BA-CTSY-INT-EN-0001
       
    64  * @SYMFssID BA/CTSY/EN-0001
       
    65  * @SYMTestCaseDesc Get EN store info.
       
    66  * @SYMTestPriority High
       
    67  * @SYMTestActions 
       
    68  * @SYMTestExpectedResults Pass - Store information returned correctly.
       
    69  * @SYMTestType CIT
       
    70  * @SYMTestCaseDependencies live/automatic
       
    71  *
       
    72  * Reason for test: Verify EN store info. retrieved is valid.
       
    73  *
       
    74  * @return - TVerdict code
       
    75  */
       
    76 	{
       
    77 
       
    78 	//
       
    79 	// SET UP
       
    80 	//
       
    81 
       
    82 	RMobilePhoneBookStore& phoneBookStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer
       
    83 			, KMainPhone, KIccAdnPhoneBook);
       
    84 	
       
    85 	RMmCustomAPI& mmCustomAPI = iEtelSessionMgr.GetCustomApiL(KMainServer, KMainPhone,KMainCustomApi);
       
    86 	
       
    87 	iPhoneTsyTestHelper.WaitForPhoneBookStoreCacheReadyL(mmCustomAPI,KIccAdnPhoneBook);
       
    88 
       
    89 	//
       
    90 	// SET UP END
       
    91 	//
       
    92 	
       
    93 	StartTest();
       
    94 	
       
    95 	//
       
    96 	// TEST START
       
    97 	//
       
    98 	
       
    99 	// Get EN store info. using RMobilePhoneStore::GetInfo with RMobilePhoneStore::TMobilePhoneStoreInfoV1 
       
   100 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   101 	
       
   102 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
   103 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg (info);
       
   104 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
   105 	CleanupStack::PushL(getEnStoreInfoStatus);
       
   106 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg);
       
   107 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium), KErrNone,_L("RMobileENStore::GetInfo timed out"));
       
   108 	ASSERT_EQUALS(getEnStoreInfoStatus.Int(), KErrNone, _L("RMobileENStore::GetInfo returned an error"));
       
   109 	
       
   110 	// iName == KETelEmergencyNumberStore 
       
   111 	ASSERT_EQUALS_DES16(info.iName, KETelEmergencyNumberStore, _L("RMobileENStore::GetInfo returned an unexpected name of iName "));
       
   112 
       
   113 	// iType == RMobilePhoneStore::EEmergencyNumberStore 
       
   114 	ASSERT_EQUALS(info.iType, RMobilePhoneStore::EEmergencyNumberStore , _L("RMobileENStore::GetInfo returned an unexpected type of iType "));
       
   115 
       
   116 	// iTotalEntries >= -1 
       
   117 	ASSERT_TRUE(info.iTotalEntries >= -1, _L("RMobileENStore::GetInfo returned iTotalEntries < -1  "));
       
   118 
       
   119 	// iUsedEntries >= -1 
       
   120 	ASSERT_TRUE(info.iUsedEntries >= -1, _L("RMobileENStore::GetInfo returned iUsedEntries < -1  "));
       
   121 
       
   122 	// iCaps == RMobilePhoneStore::KCapsReadAccess 
       
   123 	TInt32 expectedCaps =  RMobilePhoneStore::KCapsReadAccess;
       
   124 	ASSERT_BITS_SET(info.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobileENStore::GetInfo returned incorrect Store Info Caps"));
       
   125 	
       
   126 	//
       
   127 	// TEST END
       
   128 	//
       
   129 
       
   130     StartCleanup();
       
   131 	
       
   132 		
       
   133 	// Pop
       
   134 	// getEnStoreInfoStatus
       
   135 	CleanupStack::PopAndDestroy(&getEnStoreInfoStatus);
       
   136 	
       
   137 	return TestStepResult();
       
   138 	}
       
   139 
       
   140 TPtrC CCTSYIntegrationTestENStore0001::GetTestStepName()
       
   141 /**
       
   142  * @return The test step name.
       
   143  */
       
   144 	{
       
   145 	return _L("CCTSYIntegrationTestENStore0001");
       
   146 	}
       
   147 
       
   148 
       
   149 
       
   150 CCTSYIntegrationTestENStore0002::CCTSYIntegrationTestENStore0002(CEtelSessionMgr& aEtelSessionMgr)
       
   151 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   152 /**
       
   153  * Constructor.
       
   154  */
       
   155 	{
       
   156 	SetTestStepName(CCTSYIntegrationTestENStore0002::GetTestStepName());
       
   157 	}
       
   158 
       
   159 CCTSYIntegrationTestENStore0002::~CCTSYIntegrationTestENStore0002()
       
   160 /**
       
   161  * Destructor.
       
   162  */
       
   163 	{
       
   164 	}
       
   165 
       
   166 TVerdict CCTSYIntegrationTestENStore0002::doTestStepL()
       
   167 /**
       
   168  * @SYMTestCaseID BA-CTSY-INT-EN-0002
       
   169  * @SYMFssID BA/CTSY/EN-0002
       
   170  * @SYMTestCaseDesc Read entries from the EN store.
       
   171  * @SYMTestPriority High
       
   172  * @SYMTestActions 
       
   173  * @SYMTestExpectedResults Pass - Entries read successfully.
       
   174  * @SYMTestType CIT
       
   175  * @SYMTestCaseDependencies live/automatic
       
   176  *
       
   177  * Reason for test: Verify entries are read correctly.
       
   178  *
       
   179  * @return - TVerdict code
       
   180  */
       
   181 	{
       
   182 
       
   183 	//
       
   184 	// SET UP
       
   185 	//
       
   186 
       
   187 	RMobilePhoneBookStore& phoneBookStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer
       
   188 			, KMainPhone, KIccAdnPhoneBook);
       
   189 	
       
   190 	RMmCustomAPI& mmCustomAPI = iEtelSessionMgr.GetCustomApiL(KMainServer, KMainPhone,KMainCustomApi);
       
   191 	
       
   192 	iPhoneTsyTestHelper.WaitForPhoneBookStoreCacheReadyL(mmCustomAPI,KIccAdnPhoneBook);
       
   193 
       
   194 	// Get EN store subsession. 
       
   195 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   196 
       
   197 	// Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsReadAccess
       
   198 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
   199 	CleanupStack::PushL(getEnStoreInfoStatus);
       
   200 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
   201 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg (info);
       
   202 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg);
       
   203 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium),KErrNone,_L("RMobileENStore::GetInfo timed out"));
       
   204 	CHECK_EQUALS_L(getEnStoreInfoStatus.Int(), KErrNone, _L("RMobileENStore::GetInfo returned an error"));
       
   205 	TInt32 expectedCaps =  RMobilePhoneStore::KCapsReadAccess;
       
   206 	CHECK_BITS_SET_L(info.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobileENStore::GetInfo returned incorrect Store Info Caps"));
       
   207 
       
   208 	// Check Used Entries are greater than zero
       
   209 	CHECK_TRUE_L(info.iUsedEntries > 0, _L("RMobileENStore::GetInfo returned wrong iUsedEntries, should be > 0"));
       
   210 	
       
   211 	//
       
   212 	// SET UP END
       
   213 	//
       
   214 	
       
   215 	StartTest();
       
   216 	
       
   217 	//
       
   218 	// TEST START
       
   219 	//
       
   220 		
       
   221 	// Read entry from the first slot with RMobileENStore::TMobileENEntryV1 as aEntry. 
       
   222 	RMobileENStore::TMobileENEntryV1 readFirstEntry;
       
   223 	RMobileENStore::TMobileENEntryV1Pckg readFirstPckgEntry(readFirstEntry);
       
   224 	readFirstEntry.iIndex = 1; 
       
   225 	readFirstEntry.iAlphaId.Zero();
       
   226 	readFirstEntry.iNetworkSpecific = ETrue;
       
   227 	TExtEtelRequestStatus readStatus (enstore,EMobilePhoneStoreWrite);	
       
   228 	CleanupStack::PushL(readStatus);
       
   229 	enstore.Read(readStatus,readFirstPckgEntry);		
       
   230 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium), KErrNone,_L("RMobileSmsStore::Read timed out"));
       
   231 	ASSERT_EQUALS(readStatus.Int(), KErrNone, _L("RMobileENStore::Read returned an error"));
       
   232 
       
   233 	// Check iNumber is valid with length>0.
       
   234 	ASSERT_TRUE(readFirstEntry.iNumber.Length()>0, _L("RMobileENStore::Read First Read Entry has invalid iNumber"));
       
   235 	
       
   236 	// Check iNetworkSpecific returns false.
       
   237 	ASSERT_TRUE(!(readFirstEntry.iNetworkSpecific), _L("RMobileENStore::Read First Read Entry has the wrong iNetworkSpecific"));
       
   238 		
       
   239 	// If iNetworkSpecific == ETrue: 
       
   240 	if(readFirstEntry.iNetworkSpecific)
       
   241 		{
       
   242 		// Check iCountryCode is valid with length>0.
       
   243 		ASSERT_TRUE(readFirstEntry.iCountryCode.Length()>0, _L("RMobileENStore::Read First Read Entry has invalid iCountryCode"));
       
   244 		
       
   245 		// Check iIdentity is valid with length>0.
       
   246 		ASSERT_TRUE(readFirstEntry.iIdentity.Length()>0, _L("RMobileENStore::Read First Read Entry has invalid iIdentity"));
       
   247 		
       
   248 		// Check iMode is RMobilePhone::ENetworkModeGsm
       
   249 		ASSERT_EQUALS(readFirstEntry.iMode, RMobilePhone::ENetworkModeGsm, _L("RMobileENStore::Read First Read Entry has the wrong iMode"));
       
   250 		}
       
   251 
       
   252 	//
       
   253 	// TEST END
       
   254 	//
       
   255 
       
   256     StartCleanup();
       
   257 	
       
   258 	// Pop
       
   259     // getEnStoreInfoStatus
       
   260 	// readStatus
       
   261     CleanupStack::PopAndDestroy(2, &getEnStoreInfoStatus);
       
   262 	
       
   263 	return TestStepResult();
       
   264 	}
       
   265 
       
   266 TPtrC CCTSYIntegrationTestENStore0002::GetTestStepName()
       
   267 /**
       
   268  * @return The test step name.
       
   269  */
       
   270 	{
       
   271 	return _L("CCTSYIntegrationTestENStore0002");
       
   272 	}
       
   273 
       
   274 
       
   275 
       
   276 CCTSYIntegrationTestENStore0003::CCTSYIntegrationTestENStore0003(CEtelSessionMgr& aEtelSessionMgr)
       
   277 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   278 /**
       
   279  * Constructor.
       
   280  */
       
   281 	{
       
   282 	SetTestStepName(CCTSYIntegrationTestENStore0003::GetTestStepName());
       
   283 	}
       
   284 
       
   285 CCTSYIntegrationTestENStore0003::~CCTSYIntegrationTestENStore0003()
       
   286 /**
       
   287  * Destructor.
       
   288  */
       
   289 	{
       
   290 	}
       
   291 
       
   292 TVerdict CCTSYIntegrationTestENStore0003::doTestStepL()
       
   293 /**
       
   294  * @SYMTestCaseID BA-CTSY-INT-EN-0003
       
   295  * @SYMFssID BA/CTSY/EN-0003
       
   296  * @SYMTestCaseDesc Read entry that is not present in the EN store.
       
   297  * @SYMTestPriority High
       
   298  * @SYMTestActions RMobilePhoneStore::Read
       
   299  * @SYMTestExpectedResults Pass - KErrNotFound returned when reading a non-existent entry.
       
   300  * @SYMTestType CIT
       
   301  * @SYMTestCaseDependencies live/automatic
       
   302  *
       
   303  * Reason for test: Verify KErrNotFound is returned.
       
   304  *
       
   305  * @return - TVerdict code
       
   306  */
       
   307 	{
       
   308 
       
   309 	//
       
   310 	// SET UP
       
   311 	//
       
   312 	
       
   313 	// Get EN store subsession. 
       
   314 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   315 	
       
   316 	// Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsReadAccess
       
   317 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
   318 	CleanupStack::PushL(getEnStoreInfoStatus);
       
   319 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
   320 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg(info);
       
   321 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg);
       
   322 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium), KErrNone,_L("RMobileENStore::GetInfo timed out"));
       
   323 	CHECK_EQUALS_L(getEnStoreInfoStatus.Int(), KErrNone, _L("RMobileENStore::GetInfo returned an error"));
       
   324 	 
       
   325 	TInt32 expectedCaps =  RMobilePhoneStore::KCapsReadAccess;
       
   326 	CHECK_BITS_SET_L(info.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobileENStore::GetInfo returned incorrect Store Info Caps"));
       
   327 
       
   328 	//
       
   329 	// SET UP END
       
   330 	//
       
   331 	
       
   332 	StartTest();
       
   333 	
       
   334 	//
       
   335 	// TEST START
       
   336 	//
       
   337 	
       
   338 	// Read an entry from a valid index. 
       
   339 	RMobileENStore::TMobileENEntryV1 readEntry;
       
   340 	RMobileENStore::TMobileENEntryV1Pckg readPckgEntry(readEntry);
       
   341 	TExtEtelRequestStatus readStatus(enstore, EMobilePhoneStoreRead);	
       
   342 	CleanupStack::PushL(readStatus);
       
   343 	readEntry.iIndex = info.iTotalEntries; 
       
   344 	enstore.Read(readStatus,readPckgEntry);
       
   345 
       
   346 	// Check KErrNotFound is returned.
       
   347 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Read timed out"));
       
   348 	ASSERT_EQUALS(readStatus.Int(), KErrNotFound, _L("RMobileENStore::Read returned an error"));
       
   349 	
       
   350 	//
       
   351 	// TEST END
       
   352 	//
       
   353 
       
   354     StartCleanup();
       
   355 	
       
   356 	// Pop
       
   357     // getEnStoreInfoStatus
       
   358 	// readStatus
       
   359 
       
   360 	CleanupStack::PopAndDestroy(2, &getEnStoreInfoStatus);
       
   361 	
       
   362 	
       
   363 	return TestStepResult();
       
   364 	}
       
   365 
       
   366 TPtrC CCTSYIntegrationTestENStore0003::GetTestStepName()
       
   367 /**
       
   368  * @return The test step name.
       
   369  */
       
   370 	{
       
   371 	return _L("CCTSYIntegrationTestENStore0003");
       
   372 	}
       
   373 
       
   374 
       
   375 
       
   376 CCTSYIntegrationTestENStore0004::CCTSYIntegrationTestENStore0004(CEtelSessionMgr& aEtelSessionMgr)
       
   377 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   378 /**
       
   379  * Constructor.
       
   380  */
       
   381 	{
       
   382 	SetTestStepName(CCTSYIntegrationTestENStore0004::GetTestStepName());
       
   383 	}
       
   384 
       
   385 CCTSYIntegrationTestENStore0004::~CCTSYIntegrationTestENStore0004()
       
   386 /**
       
   387  * Destructor.
       
   388  */
       
   389 	{
       
   390 	}
       
   391 
       
   392 TVerdict CCTSYIntegrationTestENStore0004::doTestStepL()
       
   393 /**
       
   394  * @SYMTestCaseID BA-CTSY-INT-EN-0004
       
   395  * @SYMFssID BA/CTSY/EN-0004
       
   396  * @SYMTestCaseDesc Read entries from the EN store specifying invalid indexes.
       
   397  * @SYMTestPriority High
       
   398  * @SYMTestActions 
       
   399  * @SYMTestExpectedResults Pass - Error returned on read.
       
   400  * @SYMTestType CIT
       
   401  * @SYMTestCaseDependencies live/automatic
       
   402  *
       
   403  * Reason for test: Verify KErrArgument is returned.
       
   404  *
       
   405  * @return - TVerdict code
       
   406  */
       
   407 	{
       
   408 
       
   409 	//
       
   410 	// SET UP
       
   411 	//
       
   412 
       
   413 	
       
   414 	// Get EN store subsession. 
       
   415 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   416 	
       
   417 	// Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsReadAccess 
       
   418 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
   419 	CleanupStack::PushL(getEnStoreInfoStatus);
       
   420 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
   421 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg(info);
       
   422 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg);
       
   423 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium), KErrNone,_L("RMobileENStore::GetInfo timed out"));
       
   424 	CHECK_EQUALS_L(getEnStoreInfoStatus.Int(), KErrNone, _L("RMobileENStore::GetInfo returned an error"));
       
   425  
       
   426 	TInt32 expectedCaps =  RMobilePhoneStore::KCapsReadAccess;
       
   427 	CHECK_BITS_SET_L(info.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobileENStore::GetInfo returned incorrect Store Info Caps"));
       
   428 
       
   429 	//
       
   430 	// SET UP END
       
   431 	//
       
   432 	
       
   433 	StartTest();
       
   434 	
       
   435 	//
       
   436 	// TEST START
       
   437 	//
       
   438 	
       
   439 	
       
   440 	// ===  Read an entry with an invalid slot number ===
       
   441 
       
   442 	// Read a single entry from the phone book using aIndex = -1 
       
   443 	RMobileENStore::TMobileENEntryV1 readEntry;
       
   444 	RMobileENStore::TMobileENEntryV1Pckg readPckgEntry(readEntry);
       
   445 	TExtEtelRequestStatus readStatus(enstore, EMobilePhoneStoreRead);	
       
   446 	CleanupStack::PushL(readStatus);
       
   447 	readEntry.iIndex = -1; 
       
   448 	enstore.Read(readStatus,readPckgEntry);
       
   449 	
       
   450 	// Check KErrArgument is returned.
       
   451 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Read timed out"));
       
   452 	ASSERT_EQUALS(readStatus.Int(), KErrArgument, _L("RMobileENStore::Read did not return KErrArgument as expected"));
       
   453 	
       
   454 	// Read a single entry from the phone book using aIndex = -10 
       
   455 	readEntry.iIndex=-10;
       
   456 	enstore.Read (readStatus, readPckgEntry);
       
   457 		
       
   458 	// Check KErrArgument is returned.
       
   459 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Read timed out"));
       
   460 	ASSERT_EQUALS(readStatus.Int(), KErrArgument, _L("RMobileENStore::Read did not return KErrArgument as expected"));
       
   461 	
       
   462 	// Read a single entry from the phone book using aIndex = -50 
       
   463 	readEntry.iIndex=-50;
       
   464 	enstore.Read (readStatus, readPckgEntry);
       
   465 		
       
   466 	// Check KErrArgument is returned.
       
   467 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Read timed out"));
       
   468 	ASSERT_EQUALS(readStatus.Int(), KErrArgument, _L("RMobileENStore::Read did not return KErrArgument as expected"));
       
   469 	
       
   470 	//
       
   471 	// TEST END
       
   472 	//
       
   473 
       
   474     StartCleanup();
       
   475 	
       
   476 	// Pop
       
   477     // getEnStoreInfoStatus
       
   478 	// readStatus
       
   479 	CleanupStack::PopAndDestroy(2, &getEnStoreInfoStatus);
       
   480 	
       
   481 	return TestStepResult();
       
   482 	}
       
   483 
       
   484 TPtrC CCTSYIntegrationTestENStore0004::GetTestStepName()
       
   485 /**
       
   486  * @return The test step name.
       
   487  */
       
   488 	{
       
   489 	return _L("CCTSYIntegrationTestENStore0004");
       
   490 	}
       
   491 
       
   492 
       
   493 
       
   494 CCTSYIntegrationTestENStore0005::CCTSYIntegrationTestENStore0005(CEtelSessionMgr& aEtelSessionMgr)
       
   495 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   496 /**
       
   497  * Constructor.
       
   498  */
       
   499 	{
       
   500 	SetTestStepName(CCTSYIntegrationTestENStore0005::GetTestStepName());
       
   501 	}
       
   502 
       
   503 CCTSYIntegrationTestENStore0005::~CCTSYIntegrationTestENStore0005()
       
   504 /**
       
   505  * Destructor.
       
   506  */
       
   507 	{
       
   508 	}
       
   509 
       
   510 TVerdict CCTSYIntegrationTestENStore0005::doTestStepL()
       
   511 /**
       
   512  * @SYMTestCaseID BA-CTSY-INT-EN-0005
       
   513  * @SYMFssID BA/CTSY/EN-0005
       
   514  * @SYMTestCaseDesc Cancel delete all entries from the EN store.
       
   515  * @SYMTestPriority High
       
   516  * @SYMTestActions 
       
   517  * @SYMTestExpectedResults Pass - Some entries deleted, request cancelled successfully. Store not empty.
       
   518  * @SYMTestType CIT
       
   519  * @SYMTestCaseDependencies live/automatic
       
   520  *
       
   521  * Reason for test: Verify KErrNotSupported returned.
       
   522  *
       
   523  * @return - TVerdict code
       
   524  */
       
   525 	{
       
   526 
       
   527 	//
       
   528 	// SET UP
       
   529 	//
       
   530 			
       
   531 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   532 	
       
   533 	// Get EN store subsession. 
       
   534 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   535 		
       
   536 	//
       
   537 	// SET UP END
       
   538 	//
       
   539 	
       
   540 	StartTest();
       
   541 	
       
   542 	//
       
   543 	// TEST START
       
   544 	//
       
   545 		
       
   546 	// Call RMobilePhoneStore::DeleteAll 
       
   547 	TExtEtelRequestStatus deleteAllStatus(enstore, EMobilePhoneStoreDeleteAll);
       
   548 	CleanupStack::PushL(deleteAllStatus);
       
   549 	enstore.DeleteAll(deleteAllStatus);
       
   550 
       
   551 	// Call RTelSubSessionBase::CancelAsyncRequest (EMobilePhoneStoreDeleteAll); 
       
   552 	mobilePhone.CancelAsyncRequest (EMobilePhoneStoreDeleteAll); 
       
   553 
       
   554 	// Check status of RMobilePhoneStore::Delete is KErrNotSupported.
       
   555 	ASSERT_EQUALS(deleteAllStatus.Int(), KErrNotSupported, _L("RMobileENStore::DeleteAll returned other than KErrNotSupported") );
       
   556 	
       
   557 	//
       
   558 	// TEST END
       
   559 	//
       
   560 
       
   561     StartCleanup();
       
   562 	
       
   563 	// Pop
       
   564 	// deleteAllStatus
       
   565 	
       
   566 	CleanupStack::PopAndDestroy(&deleteAllStatus);
       
   567 	
       
   568 	
       
   569 	return TestStepResult();
       
   570 	}
       
   571 
       
   572 TPtrC CCTSYIntegrationTestENStore0005::GetTestStepName()
       
   573 /**
       
   574  * @return The test step name.
       
   575  */
       
   576 	{
       
   577 	return _L("CCTSYIntegrationTestENStore0005");
       
   578 	}
       
   579 
       
   580 
       
   581 
       
   582 CCTSYIntegrationTestENStore0006::CCTSYIntegrationTestENStore0006(CEtelSessionMgr& aEtelSessionMgr)
       
   583 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   584 /**
       
   585  * Constructor.
       
   586  */
       
   587 	{
       
   588 	SetTestStepName(CCTSYIntegrationTestENStore0006::GetTestStepName());
       
   589 	}
       
   590 
       
   591 CCTSYIntegrationTestENStore0006::~CCTSYIntegrationTestENStore0006()
       
   592 /**
       
   593  * Destructor.
       
   594  */
       
   595 	{
       
   596 	}
       
   597 
       
   598 TVerdict CCTSYIntegrationTestENStore0006::doTestStepL()
       
   599 /**
       
   600  * @SYMTestCaseID BA-CTSY-INT-EN-0006
       
   601  * @SYMFssID BA/CTSY/EN-0006
       
   602  * @SYMTestCaseDesc Attempt to read emergency number into a wrongly sized buffer
       
   603  * @SYMTestPriority High
       
   604  * @SYMTestActions 
       
   605  * @SYMTestExpectedResults Pass - KErrArgument returned on attempt to read into an invalid buffer.
       
   606  * @SYMTestType CIT
       
   607  * @SYMTestCaseDependencies live/automatic
       
   608  *
       
   609  * Reason for test: Verify KErrArgument is returned.
       
   610  *
       
   611  * @return - TVerdict code
       
   612  */
       
   613 	{
       
   614 
       
   615 	//
       
   616 	// SET UP
       
   617 	//
       
   618 
       
   619 	
       
   620 	// Get EN store subsession. 
       
   621 
       
   622 	// Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsReadAccess 
       
   623 
       
   624 	// Ensure the EN store is not empty. 
       
   625 
       
   626 
       
   627 	//
       
   628 	// SET UP END
       
   629 	//
       
   630 	
       
   631 	StartTest();
       
   632 	
       
   633 	//
       
   634 	// TEST START
       
   635 	//
       
   636 	
       
   637 	
       
   638 	// Read an entry using RMobilePhoneStore::Read with aEntry as a TBuf8<1>. 
       
   639 
       
   640 	// Check KErrArgument is returned.
       
   641 
       
   642 	
       
   643 	//
       
   644 	// TEST END
       
   645 	//
       
   646 
       
   647     StartCleanup();
       
   648 	
       
   649 	// Put any required test clean up here, then remove this comment
       
   650 	
       
   651 	return TestStepResult();
       
   652 	}
       
   653 
       
   654 TPtrC CCTSYIntegrationTestENStore0006::GetTestStepName()
       
   655 /**
       
   656  * @return The test step name.
       
   657  */
       
   658 	{
       
   659 	return _L("CCTSYIntegrationTestENStore0006");
       
   660 	}
       
   661 
       
   662 
       
   663 
       
   664 CCTSYIntegrationTestENStore0007::CCTSYIntegrationTestENStore0007(CEtelSessionMgr& aEtelSessionMgr)
       
   665 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   666 /**
       
   667  * Constructor.
       
   668  */
       
   669 	{
       
   670 	SetTestStepName(CCTSYIntegrationTestENStore0007::GetTestStepName());
       
   671 	}
       
   672 
       
   673 CCTSYIntegrationTestENStore0007::~CCTSYIntegrationTestENStore0007()
       
   674 /**
       
   675  * Destructor.
       
   676  */
       
   677 	{
       
   678 	}
       
   679 
       
   680 TVerdict CCTSYIntegrationTestENStore0007::doTestStepL()
       
   681 /**
       
   682  * @SYMTestCaseID BA-CTSY-INT-EN-0007
       
   683  * @SYMFssID BA/CTSY/EN-0007
       
   684  * @SYMTestCaseDesc Read from the EN store with no SIM present
       
   685  * @SYMTestPriority High
       
   686  * @SYMTestActions 
       
   687  * @SYMTestExpectedResults Pass - Error returned on attempt to read from EN store when there is no SIM present.
       
   688  * @SYMTestType CIT
       
   689  * @SYMTestCaseDependencies live/manual
       
   690  *
       
   691  * Reason for test: Verify error is returned.
       
   692  *
       
   693  * @return - TVerdict code
       
   694  */
       
   695 	{
       
   696 
       
   697 	//
       
   698 	// SET UP
       
   699 	//
       
   700 
       
   701 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   702 	
       
   703 	// Get EN store subsession. 
       
   704 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   705 
       
   706 	// Ensure RMobilePhoneStore::GetInfo returns KErrGsmMMServiceOptionTemporaryOutOfOrder  
       
   707 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
   708 	CleanupStack::PushL(getEnStoreInfoStatus);
       
   709 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 mobilePhoneStoreinfo;
       
   710 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg mobilePhoneStoreinfoPckg(mobilePhoneStoreinfo);
       
   711 	enstore.GetInfo(getEnStoreInfoStatus, mobilePhoneStoreinfoPckg);
       
   712 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium), KErrNone, _L("RMobileENStore::GetInfo timed out"));
       
   713 	CHECK_EQUALS_L(getEnStoreInfoStatus.Int(),  KErrGsmMMServiceOptionTemporaryOutOfOrder , _L("RMobileENStore::GetInfo returned an error"));
       
   714 	
       
   715 	//
       
   716 	// SET UP END
       
   717 	//
       
   718 	
       
   719 	StartTest();
       
   720 	
       
   721 	//
       
   722 	// TEST START
       
   723 	//
       
   724 	
       
   725 	// Remove the SIM. 
       
   726 	DisplayUserInteractionPromptL(_L("Please remove the SIM card before running this test"), ETimeMedium);
       
   727 
       
   728 	// Attempt to read an entry from the EN store. 
       
   729 	RMobileENStore::TMobileENEntryV1 readEntry;
       
   730 	RMobileENStore::TMobileENEntryV1Pckg readPckgEntry(readEntry);
       
   731 	TExtEtelRequestStatus readEnEntryStatus(enstore, EMobilePhoneStoreRead);	
       
   732 	CleanupStack::PushL(readEnEntryStatus);
       
   733 	readEntry.iIndex = mobilePhoneStoreinfo.iTotalEntries; 
       
   734 	enstore.Read(readEnEntryStatus, readPckgEntry);
       
   735 
       
   736 	// Verify error is returned. 
       
   737 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readEnEntryStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Read timed out"));
       
   738 	ASSERT_TRUE(readEnEntryStatus.Int() != KErrNone, _L("RMobileENStore::Read did not return error as expected"));
       
   739 
       
   740 	//
       
   741 	// TEST END
       
   742 	//
       
   743 
       
   744     StartCleanup();
       
   745 	
       
   746 	// Pop
       
   747 	// getEnStoreInfoStatus
       
   748 	// readEnEntryStatus
       
   749 	CleanupStack::PopAndDestroy(2, &getEnStoreInfoStatus);	
       
   750 	
       
   751 	return TestStepResult();
       
   752 	}
       
   753 
       
   754 TPtrC CCTSYIntegrationTestENStore0007::GetTestStepName()
       
   755 /**
       
   756  * @return The test step name.
       
   757  */
       
   758 	{
       
   759 	return _L("CCTSYIntegrationTestENStore0007");
       
   760 	}
       
   761 
       
   762 
       
   763 
       
   764 CCTSYIntegrationTestENStore0008::CCTSYIntegrationTestENStore0008(CEtelSessionMgr& aEtelSessionMgr)
       
   765 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   766 /**
       
   767  * Constructor.
       
   768  */
       
   769 	{
       
   770 	SetTestStepName(CCTSYIntegrationTestENStore0008::GetTestStepName());
       
   771 	}
       
   772 
       
   773 CCTSYIntegrationTestENStore0008::~CCTSYIntegrationTestENStore0008()
       
   774 /**
       
   775  * Destructor.
       
   776  */
       
   777 	{
       
   778 	}
       
   779 
       
   780 TVerdict CCTSYIntegrationTestENStore0008::doTestStepL()
       
   781 /**
       
   782  * @SYMTestCaseID BA-CTSY-INT-EN-0008
       
   783  * @SYMFssID BA/CTSY/EN-0008
       
   784  * @SYMTestCaseDesc Cancel write one entry to EN Store.
       
   785  * @SYMTestPriority High
       
   786  * @SYMTestActions 
       
   787  * @SYMTestExpectedResults Pass - KErrCancel
       
   788  * @SYMTestType CIT
       
   789  * @SYMTestCaseDependencies live/automatic
       
   790  *
       
   791  * Reason for test: Verify KErrNotSupported is returned.
       
   792  *
       
   793  * @return - TVerdict code
       
   794  */
       
   795 	{
       
   796 
       
   797 	//
       
   798 	// SET UP
       
   799 	//
       
   800 
       
   801 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   802 	
       
   803 	// Get EN store subsession. 
       
   804 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   805 
       
   806 	//
       
   807 	// SET UP END
       
   808 	//
       
   809 	
       
   810 	StartTest();
       
   811 	
       
   812 	//
       
   813 	// TEST START
       
   814 	//
       
   815 	
       
   816 	
       
   817 	// Call RMobilePhoneStore::Write specifying a valid entry to write. 
       
   818 	TExtEtelRequestStatus writeStatus (enstore, EMobilePhoneStoreWrite);	
       
   819 	CleanupStack::PushL(writeStatus);
       
   820 	RMobileENStore::TMobileENEntryV1 entry;
       
   821 	RMobileENStore::TMobileENEntryV1Pckg pckgEntry(entry);
       
   822 	entry.iIndex = 1;
       
   823 	enstore.Write(writeStatus,pckgEntry);
       
   824 	
       
   825 	// Call RTelSubSessionBase::CancelAsyncRequest (EMobilePhoneStoreWrite); 
       
   826 	mobilePhone.CancelAsyncRequest(EMobilePhoneStoreWrite);
       
   827 	
       
   828 	// Check status of RMobilePhoneStore::Write is KErrNotSupported.
       
   829 	ASSERT_EQUALS(WaitForRequestWithTimeOut(writeStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Write timed out"));
       
   830 	ASSERT_EQUALS(writeStatus.Int(), KErrNotSupported, _L("RMobileENStore::Write did not return KErrNotSupported"));
       
   831 	
       
   832 	//
       
   833 	// TEST END
       
   834 	//
       
   835 
       
   836     StartCleanup();
       
   837 	
       
   838 	// Pop
       
   839 	// writeStatus
       
   840 	
       
   841 	CleanupStack::PopAndDestroy(&writeStatus);	
       
   842 	
       
   843 	
       
   844 	return TestStepResult();
       
   845 	}
       
   846 
       
   847 TPtrC CCTSYIntegrationTestENStore0008::GetTestStepName()
       
   848 /**
       
   849  * @return The test step name.
       
   850  */
       
   851 	{
       
   852 	return _L("CCTSYIntegrationTestENStore0008");
       
   853 	}
       
   854 
       
   855 
       
   856 
       
   857 CCTSYIntegrationTestENStore0009::CCTSYIntegrationTestENStore0009(CEtelSessionMgr& aEtelSessionMgr)
       
   858 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   859 /**
       
   860  * Constructor.
       
   861  */
       
   862 	{
       
   863 	SetTestStepName(CCTSYIntegrationTestENStore0009::GetTestStepName());
       
   864 	}
       
   865 
       
   866 CCTSYIntegrationTestENStore0009::~CCTSYIntegrationTestENStore0009()
       
   867 /**
       
   868  * Destructor.
       
   869  */
       
   870 	{
       
   871 	}
       
   872 
       
   873 TVerdict CCTSYIntegrationTestENStore0009::doTestStepL()
       
   874 /**
       
   875  * @SYMTestCaseID BA-CTSY-INT-EN-0009
       
   876  * @SYMFssID BA/CTSY/EN-0009
       
   877  * @SYMTestCaseDesc Cancel delete one entry from EN Store location by index
       
   878  * @SYMTestPriority High
       
   879  * @SYMTestActions 
       
   880  * @SYMTestExpectedResults Pass - KErrCancel, entry not deleted.
       
   881  * @SYMTestType CIT
       
   882  * @SYMTestCaseDependencies live/automatic
       
   883  *
       
   884  * Reason for test: Verify KErrNotSupported is returned.
       
   885  *
       
   886  * @return - TVerdict code
       
   887  */
       
   888 	{
       
   889 
       
   890 	//
       
   891 	// SET UP
       
   892 	//
       
   893 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   894 
       
   895 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   896 
       
   897 	// No need to write an entry. Deleting is cancelled.
       
   898 	
       
   899 	//
       
   900 	// SET UP END
       
   901 	//
       
   902 	
       
   903 	StartTest();
       
   904 	
       
   905 	//
       
   906 	// TEST START
       
   907 	//
       
   908 	
       
   909 	// Index to delete does not have to exist due deletion is cancelled
       
   910 	TInt indexToDelete = 1; 
       
   911 
       
   912 	// Call RMobilePhoneStore::Delete 		
       
   913 	TExtEtelRequestStatus deleteStatus (enstore, EMobilePhoneStoreDelete);
       
   914 	CleanupStack::PushL(deleteStatus);
       
   915 	enstore.Delete(deleteStatus, indexToDelete);
       
   916 
       
   917 	// Call RTelSubSessionBase::CancelAsyncRequest (EMobilePhoneStoreDelete); 
       
   918 	mobilePhone.CancelAsyncRequest (EMobilePhoneStoreDelete); 
       
   919 	
       
   920 	// Check status of RMobilePhoneStore::Delete is KErrNotSupported.
       
   921 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteStatus, ETimeMedium), KErrNone, _L("RMobileENStore::Delete timed out"));
       
   922 	ASSERT_EQUALS(deleteStatus.Int(), KErrNotSupported, _L("RMobileENStore::Delete did not return KErrNotSupported"));
       
   923 		
       
   924 	//
       
   925 	// TEST END
       
   926 	//
       
   927 
       
   928     StartCleanup();
       
   929 	
       
   930 	// Pop
       
   931 	// deleteStatus
       
   932 	CleanupStack::PopAndDestroy(&deleteStatus);	
       
   933 	
       
   934 	return TestStepResult();
       
   935 	}
       
   936 
       
   937 TPtrC CCTSYIntegrationTestENStore0009::GetTestStepName()
       
   938 /**
       
   939  * @return The test step name.
       
   940  */
       
   941 	{
       
   942 	return _L("CCTSYIntegrationTestENStore0009");
       
   943 	}
       
   944 
       
   945 
       
   946 
       
   947 CCTSYIntegrationTestENStore0010::CCTSYIntegrationTestENStore0010(CEtelSessionMgr& aEtelSessionMgr)
       
   948 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
   949 /**
       
   950  * Constructor.
       
   951  */
       
   952 	{
       
   953 	SetTestStepName(CCTSYIntegrationTestENStore0010::GetTestStepName());
       
   954 	}
       
   955 
       
   956 CCTSYIntegrationTestENStore0010::~CCTSYIntegrationTestENStore0010()
       
   957 /**
       
   958  * Destructor.
       
   959  */
       
   960 	{
       
   961 	}
       
   962 
       
   963 TVerdict CCTSYIntegrationTestENStore0010::doTestStepL()
       
   964 /**
       
   965  * @SYMTestCaseID BA-CTSY-INT-EN-0010
       
   966  * @SYMFssID BA/CTSY/EN-0010
       
   967  * @SYMTestCaseDesc Cancel notify EN Store event
       
   968  * @SYMTestPriority High
       
   969  * @SYMTestActions 
       
   970  * @SYMTestExpectedResults Pass - KErrCancel
       
   971  * @SYMTestType CIT
       
   972  * @SYMTestCaseDependencies live/automatic
       
   973  *
       
   974  * Reason for test: Verify KErrNotSupported is returned.
       
   975  *
       
   976  * @return - TVerdict code
       
   977  */
       
   978 	{
       
   979 
       
   980 	//
       
   981 	// SET UP
       
   982 	//
       
   983 	
       
   984 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
   985 	
       
   986 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   987 
       
   988 	//
       
   989 	// SET UP END
       
   990 	//
       
   991 	
       
   992 	StartTest();
       
   993 	
       
   994 	//
       
   995 	// TEST START
       
   996 	//
       
   997 	
       
   998 	// Call RMobilePhoneStore::NotifyStoreEvent 
       
   999 	TExtEtelRequestStatus notifyStatus(enstore, EMobilePhoneStoreNotifyStoreEvent);
       
  1000 	CleanupStack::PushL(notifyStatus);
       
  1001 	TInt index;
       
  1002 	TUint32 event;
       
  1003 	enstore.NotifyStoreEvent(notifyStatus, event, index);
       
  1004 	
       
  1005 	// Call RTelSubSessionBase::CancelAsyncRequest (EMobilePhoneStoreNotifyStoreEvent); 
       
  1006 	phone.CancelAsyncRequest(EMobilePhoneStoreNotifyStoreEvent);
       
  1007 
       
  1008 	// Check status of RMobilePhoneStore::NotifyStoreEvent is KErrNotSupported.
       
  1009 	ASSERT_EQUALS(notifyStatus.Int(), KErrNotSupported, _L("RMobileENStore::NotifyStoreEvent did not return KErrNotSupported"));
       
  1010 	
       
  1011 	//
       
  1012 	// TEST END
       
  1013 	//
       
  1014 
       
  1015     StartCleanup();
       
  1016 	
       
  1017 	// Pop
       
  1018 	// notifyStatus
       
  1019 	CleanupStack::PopAndDestroy(&notifyStatus);
       
  1020 	
       
  1021 	return TestStepResult();
       
  1022 	}
       
  1023 
       
  1024 TPtrC CCTSYIntegrationTestENStore0010::GetTestStepName()
       
  1025 /**
       
  1026  * @return The test step name.
       
  1027  */
       
  1028 	{
       
  1029 	return _L("CCTSYIntegrationTestENStore0010");
       
  1030 	}
       
  1031 
       
  1032 
       
  1033 
       
  1034 CCTSYIntegrationTestENStore0011::CCTSYIntegrationTestENStore0011(CEtelSessionMgr& aEtelSessionMgr)
       
  1035 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
  1036 /**
       
  1037  * Constructor.
       
  1038  */
       
  1039 	{
       
  1040 	SetTestStepName(CCTSYIntegrationTestENStore0011::GetTestStepName());
       
  1041 	}
       
  1042 
       
  1043 CCTSYIntegrationTestENStore0011::~CCTSYIntegrationTestENStore0011()
       
  1044 /**
       
  1045  * Destructor.
       
  1046  */
       
  1047 	{
       
  1048 	}
       
  1049 
       
  1050 TVerdict CCTSYIntegrationTestENStore0011::doTestStepL()
       
  1051 /**
       
  1052  * @SYMTestCaseID BA-CTSY-INT-EN-0011
       
  1053  * @SYMFssID BA/CTSY/EN-0011
       
  1054  * @SYMTestCaseDesc Read all EN store entries
       
  1055  * @SYMTestPriority High
       
  1056  * @SYMTestActions 
       
  1057  * @SYMTestExpectedResults Pass - All entries read correctly.
       
  1058  * @SYMTestType CIT
       
  1059  * @SYMTestCaseDependencies live/automatic
       
  1060  *
       
  1061  * Reason for test: Verify valid entries are read from the EN store.
       
  1062  *
       
  1063  * @return - TVerdict code
       
  1064  */
       
  1065 	{
       
  1066 
       
  1067 	//
       
  1068 	// SET UP
       
  1069 	//
       
  1070 
       
  1071 	RMobilePhoneBookStore& phoneBookStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer
       
  1072 			, KMainPhone, KIccAdnPhoneBook);
       
  1073 	
       
  1074 	RMmCustomAPI& mmCustomAPI = iEtelSessionMgr.GetCustomApiL(KMainServer, KMainPhone,KMainCustomApi);
       
  1075 	
       
  1076 	iPhoneTsyTestHelper.WaitForPhoneBookStoreCacheReadyL(mmCustomAPI,KIccAdnPhoneBook);
       
  1077 
       
  1078 	// Get EN store subsession. 
       
  1079 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
  1080 
       
  1081 	// Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsReadAccess
       
  1082 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
  1083 	CleanupStack::PushL(getEnStoreInfoStatus);
       
  1084 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
  1085 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg (info);
       
  1086 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg);
       
  1087 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium),KErrNone,_L("RMobileENStore::GetInfo timed out"));
       
  1088 	CHECK_EQUALS_L(getEnStoreInfoStatus.Int(), KErrNone, _L("RMobileENStore::GetInfo returned an error"));
       
  1089 	TInt32 expectedCaps =  RMobilePhoneStore::KCapsReadAccess;
       
  1090 	CHECK_BITS_SET_L(info.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobileENStore::GetInfo returned incorrect Store Info Caps"));
       
  1091 
       
  1092 	// Check Used Entries are greater than zero
       
  1093 	CHECK_TRUE_L(info.iUsedEntries > 0, _L("RMobileENStore::GetInfo returned wrong iUsedEntries, should be > 0"));
       
  1094 
       
  1095 	//
       
  1096 	// SET UP END
       
  1097 	//
       
  1098 	
       
  1099 	StartTest();
       
  1100 	
       
  1101 	//
       
  1102 	// TEST START
       
  1103 	//
       
  1104 	
       
  1105 	// Use helper class for CRetrieveMobilePhoneENList to read all of the entries from the EN store. 
       
  1106 	CRetrieveMobilePhoneENListExec* enListExec = CRetrieveMobilePhoneENListHelper::NewL(enstore);	
       
  1107 	CleanupStack::PushL(enListExec);
       
  1108 	TInt err;
       
  1109 	CMobilePhoneENList* enList = enListExec ->DoGetList(err);
       
  1110 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneENList::RetrieveListL is not able to get the list"));
       
  1111 	ASSERT_TRUE(enList != NULL, _L("CRetrieveMobilePhoneENList::RetrieveListL ENList is NULL"));
       
  1112 	TEST_CHECK_POINT_L(_L("CRetrieveMobilePhoneENList::DoGetList enList is NULL"));
       
  1113 
       
  1114 	// Check the number of entries returned > 0
       
  1115 	ASSERT_TRUE(enList->Enumerate()>0, _L("CRetrieveMobilePhoneENList::Enumerate return value not greater than 0 "));
       
  1116 
       
  1117 	// ===  Check each entry in the returned CMobilePhoneENList. ===
       
  1118 	
       
  1119 	// For each entry: 
       
  1120 	RMobileENStore::TMobileENEntryV1 entry;
       
  1121 	RMobileENStore::TMobileENEntryV1Pckg entryPckg(entry);
       
  1122 	for(TInt i=0;i<enList->Enumerate();i++)
       
  1123 		{
       
  1124 		entry = enList->GetEntryL(i);
       
  1125 				
       
  1126 		// Check iNumber has length > 0
       
  1127 		ASSERT_TRUE(entry.iNumber.Length()>0, _L("CRetrieveMobilePhoneENList::GetEntryL Entry iNumber length not greater than 0"));
       
  1128 		}
       
  1129 	
       
  1130 	//
       
  1131 	// TEST END
       
  1132 	//
       
  1133 
       
  1134     StartCleanup();
       
  1135 	
       
  1136 	// Pop
       
  1137 	// getEnStoreInfoStatus
       
  1138 	// enListExec
       
  1139 	CleanupStack::PopAndDestroy(2, &getEnStoreInfoStatus);
       
  1140 	
       
  1141 	
       
  1142 	return TestStepResult();
       
  1143 	}
       
  1144 
       
  1145 TPtrC CCTSYIntegrationTestENStore0011::GetTestStepName()
       
  1146 /**
       
  1147  * @return The test step name.
       
  1148  */
       
  1149 	{
       
  1150 	return _L("CCTSYIntegrationTestENStore0011");
       
  1151 	}
       
  1152 
       
  1153 
       
  1154 
       
  1155 CCTSYIntegrationTestENStore0012::CCTSYIntegrationTestENStore0012(CEtelSessionMgr& aEtelSessionMgr)
       
  1156 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
  1157 /**
       
  1158  * Constructor.
       
  1159  */
       
  1160 	{
       
  1161 	SetTestStepName(CCTSYIntegrationTestENStore0012::GetTestStepName());
       
  1162 	}
       
  1163 
       
  1164 CCTSYIntegrationTestENStore0012::~CCTSYIntegrationTestENStore0012()
       
  1165 /**
       
  1166  * Destructor.
       
  1167  */
       
  1168 	{
       
  1169 	}
       
  1170 
       
  1171 TVerdict CCTSYIntegrationTestENStore0012::doTestStepL()
       
  1172 /**
       
  1173  * @SYMTestCaseID BA-CTSY-INT-EN-0012
       
  1174  * @SYMFssID BA/CTSY/EN-0012
       
  1175  * @SYMTestCaseDesc Cancel read all EN store entries.
       
  1176  * @SYMTestPriority High
       
  1177  * @SYMTestActions 
       
  1178  * @SYMTestExpectedResults Pass - KErrCancel returned.
       
  1179  * @SYMTestType CIT
       
  1180  * @SYMTestCaseDependencies live/automatic
       
  1181  *
       
  1182  * Reason for test: Verify request is cancelled and some but not all entries are read before cancellation.
       
  1183  *
       
  1184  * @return - TVerdict code
       
  1185  */
       
  1186 	{
       
  1187 
       
  1188 	//
       
  1189 	// SET UP
       
  1190 	//
       
  1191 
       
  1192 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1193 	
       
  1194 	RMobilePhoneBookStore& phoneBookStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer
       
  1195 			, KMainPhone, KIccAdnPhoneBook);
       
  1196 	
       
  1197 	RMmCustomAPI& mmCustomAPI = iEtelSessionMgr.GetCustomApiL(KMainServer, KMainPhone,KMainCustomApi);
       
  1198 	
       
  1199 	iPhoneTsyTestHelper.WaitForPhoneBookStoreCacheReadyL(mmCustomAPI,KIccAdnPhoneBook);
       
  1200 
       
  1201 	// Get EN store subsession. 
       
  1202 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
  1203 
       
  1204 	// Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsReadAccess
       
  1205 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
  1206 	CleanupStack::PushL(getEnStoreInfoStatus);
       
  1207 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
  1208 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg (info);
       
  1209 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg);
       
  1210 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium),KErrNone,_L("RMobileENStore::GetInfo timed out"));
       
  1211 	CHECK_EQUALS_L(getEnStoreInfoStatus.Int(), KErrNone, _L("RMobileENStore::GetInfo returned an error"));
       
  1212 	TInt32 expectedCaps =  RMobilePhoneStore::KCapsReadAccess;
       
  1213 	CHECK_BITS_SET_L(info.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobileENStore::GetInfo returned incorrect Store Info Caps"));
       
  1214 
       
  1215 	// Check Used Entries are greater than zero
       
  1216 	CHECK_TRUE_L(info.iUsedEntries > 0, _L("RMobileENStore::GetInfo returned wrong iUsedEntries, should be > 0"));
       
  1217 
       
  1218 	//
       
  1219 	// SET UP END
       
  1220 	//
       
  1221 	
       
  1222 	StartTest();
       
  1223 	
       
  1224 	//
       
  1225 	// TEST START
       
  1226 	//
       
  1227 		
       
  1228 	// ===  Find out how many entries are used in the phone book ===
       
  1229 
       
  1230 	// Use helper class for  CRetrieveMobilePhoneENList to read all of the entries from the EN store. 
       
  1231 	TInt err;
       
  1232 	CRetrieveMobilePhoneENListExec* enListExec = CRetrieveMobilePhoneENListHelper::NewL(enstore);	
       
  1233 	CleanupStack::PushL(enListExec);
       
  1234 	CMobilePhoneENList* enList = enListExec ->DoGetList(err);
       
  1235 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneENList::DoGetList is not able to get the list"));
       
  1236 	ASSERT_TRUE(enList != NULL, _L("CRetrieveMobilePhoneENList::DoGetList callForwardingList is NULL"));
       
  1237 	TEST_CHECK_POINT_L(_L("CRetrieveMobilePhoneENList::DoGetList enList is NULL"));
       
  1238 
       
  1239 	// Wait for 1 second. 
       
  1240 	User::After(KOneSecond); 
       
  1241 	
       
  1242 	// Cancel the request  
       
  1243 	enListExec->CancelListRetrieval();
       
  1244 	
       
  1245 	// Check KErrCancel or KErrNone is returned.
       
  1246 	ASSERT_TRUE((err==KErrCancel)||(err== KErrNone), _L("CMobilePhoneENList::CancelListRetrieval returned an error"));
       
  1247 
       
  1248 	//
       
  1249 	// TEST END
       
  1250 	//
       
  1251 
       
  1252     StartCleanup();
       
  1253 	
       
  1254 	//Pop
       
  1255 	//getEnStoreInfoStatus
       
  1256 	//enListExec
       
  1257 	CleanupStack::PopAndDestroy(2, &getEnStoreInfoStatus);
       
  1258 	
       
  1259 	return TestStepResult();
       
  1260 	}
       
  1261 
       
  1262 TPtrC CCTSYIntegrationTestENStore0012::GetTestStepName()
       
  1263 /**
       
  1264  * @return The test step name.
       
  1265  */
       
  1266 	{
       
  1267 	return _L("CCTSYIntegrationTestENStore0012");
       
  1268 	}
       
  1269 
       
  1270 
       
  1271 
       
  1272 CCTSYIntegrationTestENStore0013::CCTSYIntegrationTestENStore0013(CEtelSessionMgr& aEtelSessionMgr)
       
  1273 	: CCTSYIntegrationTestENStoreBase(aEtelSessionMgr)
       
  1274 /**
       
  1275  * Constructor.
       
  1276  */
       
  1277 	{
       
  1278 	SetTestStepName(CCTSYIntegrationTestENStore0013::GetTestStepName());
       
  1279 	}
       
  1280 
       
  1281 CCTSYIntegrationTestENStore0013::~CCTSYIntegrationTestENStore0013()
       
  1282 /**
       
  1283  * Destructor.
       
  1284  */
       
  1285 	{
       
  1286 	}
       
  1287 
       
  1288 TVerdict CCTSYIntegrationTestENStore0013::doTestStepL()
       
  1289 /**
       
  1290  * @SYMTestCaseID BA-CTSY-INT-EN-0013
       
  1291  * @SYMFssID BA/CTSY/EN-0013
       
  1292  * @SYMTestCaseDesc Cancel get EN store info.
       
  1293  * @SYMTestPriority High
       
  1294  * @SYMTestActions 
       
  1295  * @SYMTestExpectedResults Pass - KErrCancel
       
  1296  * @SYMTestType CIT
       
  1297  * @SYMTestCaseDependencies live/automatic
       
  1298  *
       
  1299  * Reason for test: Verify request is cancelled.
       
  1300  *
       
  1301  * @return - TVerdict code
       
  1302  */
       
  1303 	{
       
  1304 
       
  1305 	//
       
  1306 	// SET UP
       
  1307 	//
       
  1308 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1309 	
       
  1310 	// Get EN store subsession. 
       
  1311 	RMobileENStore& enstore = iEtelSessionMgr.GetENStoreL(KMainServer, KMainPhone, KMainENStore);
       
  1312 	//
       
  1313 	// SET UP END
       
  1314 	//
       
  1315 	
       
  1316 	StartTest();
       
  1317 	
       
  1318 	//
       
  1319 	// TEST START
       
  1320 	//
       
  1321 		
       
  1322 	// Get phone store info with RMobilePhoneStore::GetInfo  
       
  1323 	TExtEtelRequestStatus getEnStoreInfoStatus(enstore, EMobilePhoneStoreGetInfo);
       
  1324 	CleanupStack::PushL(getEnStoreInfoStatus);
       
  1325 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
       
  1326 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg(info);
       
  1327 	enstore.GetInfo(getEnStoreInfoStatus, infoPckg );
       
  1328 
       
  1329 	// Cancel request with RMobilePhoneStore::CancelAsyncRequest(EMobilePhoneStoreGetInfo)  
       
  1330 	mobilePhone.CancelAsyncRequest(EMobilePhoneStoreGetInfo);
       
  1331 	
       
  1332 	// Check status of RMobilePhoneStore::GetInfo is KErrCancel or KErrNone if it was too late to cancel.	
       
  1333 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getEnStoreInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhoneStore::GetPhoneStoreInfo, timed out"));
       
  1334 	ASSERT_TRUE((getEnStoreInfoStatus.Int() == KErrCancel) || (getEnStoreInfoStatus.Int() == KErrNone), _L("RMobilePhoneStore::GetInfo did not return KErrCancel or KErrNone"));
       
  1335 	
       
  1336 	//
       
  1337 	// TEST END
       
  1338 	//
       
  1339 
       
  1340     StartCleanup();
       
  1341 	
       
  1342 	// Pop
       
  1343 	// getEnStoreInfoStatus
       
  1344 	CleanupStack::PopAndDestroy(&getEnStoreInfoStatus);
       
  1345 	
       
  1346 	return TestStepResult();
       
  1347 	}
       
  1348 
       
  1349 TPtrC CCTSYIntegrationTestENStore0013::GetTestStepName()
       
  1350 /**
       
  1351  * @return The test step name.
       
  1352  */
       
  1353 	{
       
  1354 	return _L("CCTSYIntegrationTestENStore0013");
       
  1355 	}
       
  1356 
       
  1357 
       
  1358