telephonyserverplugins/common_tsy/test/component/src/cctsyapncontrollistfu.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 // The TEFUnit test suite for APNControlList in the Common TSY.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20 */
       
    21 
       
    22 #include "cctsyapncontrollistfu.h"
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <et_clsvr.h>
       
    26 #include <ctsy/mmtsy_names.h>
       
    27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    28 #include "tmockltsydata.h"
       
    29 #include <ctsy/serviceapi/gsmerror.h>
       
    30 
       
    31 CTestSuite* CCTsyAPNControlListFU::CreateSuiteL(const TDesC& aName)
       
    32 	{
       
    33 	SUB_SUITE;
       
    34 
       
    35 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNname0001L);
       
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNname0002L);
       
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNname0003L);
       
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNname0004L);
       
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNname0005L);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestEnumerateAPNEntries0001L);
       
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestEnumerateAPNEntries0002L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestEnumerateAPNEntries0004L);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestEnumerateAPNEntries0005L);
       
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestAppendAPNName0001L);
       
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestAppendAPNName0002L);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestAppendAPNName0004L);
       
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestAppendAPNName0005L);
       
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestDeleteAPNName0001L);
       
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestDeleteAPNName0002L);
       
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestDeleteAPNName0004L);
       
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestDeleteAPNName0005L);
       
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestNotifyAPNListChanged0001L);
       
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestNotifyAPNListChanged0002L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestNotifyAPNListChanged0004L);
       
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNControlListServiceStatus0001L);
       
    56 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNControlListServiceStatus0002L);
       
    57 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNControlListServiceStatus0004L);
       
    58 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestGetAPNControlListServiceStatus0005L);
       
    59 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestSetAPNControlListServiceStatus0001L);
       
    60 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestSetAPNControlListServiceStatus0002L);
       
    61 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestSetAPNControlListServiceStatus0003L);
       
    62 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestSetAPNControlListServiceStatus0004L);
       
    63 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestSetAPNControlListServiceStatus0005L);
       
    64 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestNotifyAPNControlListServiceStatusChange0001L);
       
    65 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestNotifyAPNControlListServiceStatusChange0002L);
       
    66 	ADD_TEST_STEP_ISO_CPP(CCTsyAPNControlListFU, TestNotifyAPNControlListServiceStatusChange0004L);
       
    67 
       
    68 	END_SUITE;
       
    69 	}
       
    70 
       
    71 
       
    72 //
       
    73 // Actual test cases
       
    74 //
       
    75 
       
    76 
       
    77 /**
       
    78 @SYMTestCaseID BA-CTSY-ACL-MGAN-0001
       
    79 @SYMComponent  telephony_ctsy
       
    80 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetAPNname
       
    81 @SYMTestPriority High
       
    82 @SYMTestActions Invokes RMobilePhone::GetAPNname
       
    83 @SYMTestExpectedResults Pass
       
    84 @SYMTestType CT
       
    85 */
       
    86 void CCTsyAPNControlListFU::TestGetAPNname0001L()
       
    87 	{
       
    88 	OpenEtelServerL(EUseExtendedError);
       
    89 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
    90 	OpenPhoneL();
       
    91 
       
    92 	RBuf8 dataExpect;
       
    93 	CleanupClosePushL(dataExpect);
       
    94 	
       
    95 	RBuf8 dataComplete;
       
    96 	CleanupClosePushL(dataComplete);
       
    97 	
       
    98 	// data for RMobilePhone::GetAPNname itself
       
    99 	TRequestStatus reqStatus;
       
   100 	TUint32 index = 0;
       
   101 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   102 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);	
       
   103 	
       
   104 	// data for ExpectL
       
   105 	TMockLtsyData1<TUint32> ltsyData(index);
       
   106 	ltsyData.SerialiseL(dataExpect);
       
   107 	
       
   108 	// data for CompleteL
       
   109 	RMobilePhone::TAPNEntryV3 apnEntryComplete;
       
   110 	_LIT8(KSameName, "SameName");
       
   111 	apnEntryComplete.iApn.Copy(KSameName);
       
   112 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData2(apnEntryComplete);
       
   113 	ltsyData2.SerialiseL(dataComplete);
       
   114 	
       
   115  	//-------------------------------------------------------------------------
       
   116 	// TEST A: failure to dispatch request to LTSY
       
   117  	//-------------------------------------------------------------------------
       
   118 	iMockLTSY.ExpectL(EMobilePhoneGetAPNname, dataExpect, KErrNotSupported);
       
   119 	
       
   120 	iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   121 	User::WaitForRequest(reqStatus);
       
   122    	AssertMockLtsyStatusL();
       
   123 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   124 	
       
   125 
       
   126 	//-------------------------------------------------------------------------
       
   127 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   128  	//-------------------------------------------------------------------------
       
   129 	iMockLTSY.ExpectL(EMobilePhoneGetAPNname, dataExpect);
       
   130 	iMockLTSY.CompleteL(EMobilePhoneGetAPNname, KErrGeneral, dataComplete);
       
   131 	
       
   132 	iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   133 	User::WaitForRequest(reqStatus);
       
   134    	AssertMockLtsyStatusL();
       
   135 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   136 	
       
   137 	//-------------------------------------------------------------------------
       
   138 	// TEST C: Successful completion request of
       
   139 	// RMobilePhone::GetAPNname when result is not cached.
       
   140  	//-------------------------------------------------------------------------
       
   141 	iMockLTSY.ExpectL(EMobilePhoneGetAPNname, dataExpect);
       
   142 	iMockLTSY.CompleteL(EMobilePhoneGetAPNname, KErrNone, dataComplete);
       
   143 	
       
   144 	iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   145 	User::WaitForRequest(reqStatus);
       
   146    	AssertMockLtsyStatusL();
       
   147 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   148 	ASSERT_EQUALS(apnEntryComplete.iApn, apnEntry.iApn);	
       
   149 	
       
   150  	//-------------------------------------------------------------------------
       
   151 	// TEST E: Unsolicited completion of RMobilePhone::GetAPNname
       
   152 	// from LTSY.
       
   153  	//-------------------------------------------------------------------------	
       
   154 	TRequestStatus mockLtsyStatus;
       
   155 	iMockLTSY.NotifyTerminated(mockLtsyStatus); 
       
   156  	// Issue the Complete...	
       
   157 	iMockLTSY.CompleteL(EMobilePhoneGetAPNname, KErrNone, dataComplete);
       
   158 	// wait for completion 
       
   159 	User::WaitForRequest(mockLtsyStatus);
       
   160 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   161 	
       
   162 	AssertMockLtsyStatusL();
       
   163 	CleanupStack::PopAndDestroy(3, this); // dataComplete, expectData, this
       
   164 	
       
   165 	}
       
   166 
       
   167 
       
   168 /**
       
   169 @SYMTestCaseID BA-CTSY-ACL-MGAN-0002
       
   170 @SYMComponent  telephony_ctsy
       
   171 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::GetAPNname
       
   172 @SYMTestPriority High
       
   173 @SYMTestActions Invokes cancelling of RMobilePhone::GetAPNname
       
   174 @SYMTestExpectedResults Pass
       
   175 @SYMTestType CT
       
   176 */
       
   177 void CCTsyAPNControlListFU::TestGetAPNname0002L()
       
   178 	{
       
   179 
       
   180 // This test should test cancellation of GetAPNname
       
   181 // If this API does not have a cancel, the test step should be completely removed.
       
   182 
       
   183 	OpenEtelServerL(EUseExtendedError);
       
   184 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   185 	OpenPhoneL();
       
   186 
       
   187 	TRequestStatus mockLtsyStatus;
       
   188 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   189 
       
   190 	RBuf8 dataExpect;
       
   191 	CleanupClosePushL(dataExpect);
       
   192 	
       
   193 	RBuf8 dataComplete;
       
   194 	CleanupClosePushL(dataComplete);
       
   195 	
       
   196 	// data for RMobilePhone::GetAPNname itself
       
   197 	TRequestStatus reqStatus;
       
   198 	TUint32 index = 0;
       
   199 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   200 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);	
       
   201 	
       
   202 	// data for ExpectL
       
   203 	TMockLtsyData1<TUint32> ltsyData(index);
       
   204 	ltsyData.SerialiseL(dataExpect);
       
   205 	
       
   206 	// data for CompleteL
       
   207 	RMobilePhone::TAPNEntryV3 apnEntryComplete;
       
   208 	_LIT8(KSameName, "SameName");
       
   209 	apnEntryComplete.iApn.Copy(KSameName);
       
   210 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData2(apnEntryComplete);
       
   211 	ltsyData2.SerialiseL(dataComplete);
       
   212 
       
   213  	//-------------------------------------------------------------------------
       
   214 	// Test cancelling of RMobilePhone::GetAPNname
       
   215  	//-------------------------------------------------------------------------
       
   216  	
       
   217 	iMockLTSY.ExpectL(EMobilePhoneGetAPNname, dataExpect);
       
   218 	iMockLTSY.CompleteL(EMobilePhoneGetAPNname, KErrNone, dataComplete, 20);
       
   219 	
       
   220 	iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   221 	//cancel reguest
       
   222 	iPhone.CancelAsyncRequest(EMobilePhoneGetAPNname);
       
   223 	
       
   224 	User::WaitForRequest(reqStatus);
       
   225 	
       
   226 	// This defect was fixed. For more information see defect description    
       
   227 	//ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 90101);
       
   228   	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
   229 	
       
   230 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   231 	User::WaitForRequest(mockLtsyStatus);	
       
   232 	AssertMockLtsyStatusL();
       
   233 	CleanupStack::PopAndDestroy(3); // dataComplete, dataExpect, this	
       
   234 	}
       
   235 
       
   236 
       
   237 /**
       
   238 @SYMTestCaseID BA-CTSY-ACL-MGAN-0003
       
   239 @SYMComponent  telephony_ctsy
       
   240 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetAPNname with bad parameter data
       
   241 @SYMTestPriority High
       
   242 @SYMTestActions Invokes RMobilePhone::GetAPNname with bad parameter data
       
   243 @SYMTestExpectedResults Pass
       
   244 @SYMTestType CT
       
   245 */
       
   246 void CCTsyAPNControlListFU::TestGetAPNname0003L()
       
   247     {
       
   248 
       
   249     OpenEtelServerL(EUseExtendedError);
       
   250     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   251     OpenPhoneL();
       
   252 
       
   253     TRequestStatus reqStatus;
       
   254     TUint32 index = 0;
       
   255 
       
   256     //-------------------------------------------------------------------------
       
   257     // Test A: Test passing wrong version of parameters to
       
   258     // RMobilePhone::GetAPNname
       
   259     //-------------------------------------------------------------------------
       
   260 
       
   261     // Bad argument
       
   262     TInt apnEntry;
       
   263     TPckg<TInt> pckgEntry(apnEntry);
       
   264 
       
   265     // Call GetAPNname with bad argument
       
   266     iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   267     User::WaitForRequest(reqStatus);
       
   268     AssertMockLtsyStatusL();
       
   269     ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
   270 
       
   271     CleanupStack::PopAndDestroy(this);
       
   272 	
       
   273 	}
       
   274 
       
   275 
       
   276 /**
       
   277 @SYMTestCaseID BA-CTSY-ACL-MGAN-0004
       
   278 @SYMComponent  telephony_ctsy
       
   279 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::GetAPNname
       
   280 @SYMTestPriority High
       
   281 @SYMTestActions Invokes multiple client requests to RMobilePhone::GetAPNname
       
   282 @SYMTestExpectedResults Pass
       
   283 @SYMTestType CT
       
   284 */
       
   285 void CCTsyAPNControlListFU::TestGetAPNname0004L()
       
   286 	{
       
   287 					
       
   288 	OpenEtelServerL(EUseExtendedError);
       
   289 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   290 	OpenPhoneL();
       
   291 
       
   292 	// Open second client
       
   293 	RTelServer telServer2;
       
   294 	TInt ret = telServer2.Connect();
       
   295 	ASSERT_EQUALS(KErrNone, ret);
       
   296 	CleanupClosePushL(telServer2);
       
   297 
       
   298 	RMobilePhone phone2;
       
   299 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   300 	ASSERT_EQUALS(KErrNone, ret);
       
   301 	CleanupClosePushL(phone2);
       
   302 	
       
   303 	RBuf8 dataExpect;
       
   304 	CleanupClosePushL(dataExpect);
       
   305 	
       
   306 	RBuf8 dataComplete;
       
   307 	CleanupClosePushL(dataComplete);
       
   308 	
       
   309 	// data for RMobilePhone::GetAPNname itself	
       
   310 	TRequestStatus reqStatus;	
       
   311 	TRequestStatus reqStatus2;
       
   312 	TUint32 index = 0;
       
   313 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   314 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);	
       
   315 	
       
   316 	// data for ExpectL
       
   317 	TMockLtsyData1<TUint32> ltsyData(index);
       
   318 	ltsyData.SerialiseL(dataExpect);
       
   319 	
       
   320 	// data for CompleteL
       
   321 	RMobilePhone::TAPNEntryV3 apnEntryComplete;
       
   322 	_LIT8(KSameName, "SameName");
       
   323 	apnEntryComplete.iApn.Copy(KSameName);
       
   324 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData2(apnEntryComplete);
       
   325 	ltsyData2.SerialiseL(dataComplete);
       
   326 	
       
   327 
       
   328 	//-------------------------------------------------------------------------
       
   329 	// Test A: Test multiple clients requesting RMobilePhone::GetAPNname
       
   330  	//------------------------------------------------------------------------- 	
       
   331  	// first client 	
       
   332  	iMockLTSY.ExpectL(EMobilePhoneGetAPNname, dataExpect);
       
   333 	iMockLTSY.CompleteL(EMobilePhoneGetAPNname, KErrNone, dataComplete);	
       
   334 	iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   335 	
       
   336 	// second client	
       
   337 	phone2.GetAPNname(reqStatus2, index, pckgEntry);
       
   338 	
       
   339 	// wait for the first client	
       
   340 	User::WaitForRequest(reqStatus);
       
   341 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   342 	ASSERT_EQUALS(apnEntryComplete.iApn, apnEntry.iApn);
       
   343 	
       
   344 	// wait for the second client	
       
   345 	User::WaitForRequest(reqStatus2);   
       
   346 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());
       
   347 	
       
   348 	AssertMockLtsyStatusL();
       
   349 	// Done !
       
   350 	CleanupStack::PopAndDestroy(5, this); // phone2, telServer2, dataComplete, dataExpect, this
       
   351 	}
       
   352 
       
   353 
       
   354 /**
       
   355 @SYMTestCaseID BA-CTSY-ACL-MGAN-0005
       
   356 @SYMComponent  telephony_ctsy
       
   357 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetAPNname with timeout
       
   358 @SYMTestPriority High
       
   359 @SYMTestActions Invokes RMobilePhone::GetAPNname and tests for timeout
       
   360 @SYMTestExpectedResults Pass
       
   361 @SYMTestType CT
       
   362 */
       
   363 void CCTsyAPNControlListFU::TestGetAPNname0005L()
       
   364 	{
       
   365 
       
   366 	OpenEtelServerL(EUseExtendedError);
       
   367 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   368 	OpenPhoneL();
       
   369 
       
   370 	RBuf8 data;
       
   371 	CleanupClosePushL(data);
       
   372 	
       
   373 		
       
   374 	// data for RMobilePhone::GetAPNname itself
       
   375 	TRequestStatus reqStatus;
       
   376 	TUint32 index = 0;
       
   377 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   378 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);	
       
   379 	
       
   380 	// data for ExpectL
       
   381 	TMockLtsyData1<TUint32> ltsyData(index);
       
   382 	ltsyData.SerialiseL(data);
       
   383 
       
   384 	//-------------------------------------------------------------------------
       
   385 	// Test A: Test timeout of RMobilePhone::GetAPNname
       
   386  	//-------------------------------------------------------------------------
       
   387 
       
   388 	iMockLTSY.ExpectL(EMobilePhoneGetAPNname, data);
       
   389 	
       
   390 	iPhone.GetAPNname(reqStatus, index, pckgEntry);
       
   391 	User::WaitForRequest(reqStatus);
       
   392    	AssertMockLtsyStatusL();
       
   393 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   394 
       
   395 	// Done !
       
   396 	CleanupStack::PopAndDestroy(2, this); // data, this
       
   397 
       
   398 	}
       
   399 
       
   400 
       
   401 /**
       
   402 @SYMTestCaseID BA-CTSY-ACL-MEAE-0001
       
   403 @SYMComponent  telephony_ctsy
       
   404 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::EnumerateAPNEntries
       
   405 @SYMTestPriority High
       
   406 @SYMTestActions Invokes RMobilePhone::EnumerateAPNEntries
       
   407 @SYMTestExpectedResults Pass
       
   408 @SYMTestType CT
       
   409 */
       
   410 void CCTsyAPNControlListFU::TestEnumerateAPNEntries0001L()
       
   411 	{
       
   412 
       
   413 	OpenEtelServerL(EUseExtendedError);
       
   414 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   415 	OpenPhoneL();
       
   416 
       
   417 	RBuf8 dataComplete;
       
   418 	CleanupClosePushL(dataComplete);	
       
   419 	
       
   420 	// data for EnumerateAPNEntries itself
       
   421 	TRequestStatus reqStatus;
       
   422 	TUint32 index = 0;
       
   423 	
       
   424 	// data for CompleteL
       
   425 	TUint32 indexComplete = 5;
       
   426 	TMockLtsyData1<TUint32> ltsyData(indexComplete);
       
   427 	ltsyData.SerialiseL(dataComplete);
       
   428 		
       
   429  	//-------------------------------------------------------------------------
       
   430 	// TEST A: failure to dispatch request to LTSY
       
   431  	//-------------------------------------------------------------------------
       
   432 	iMockLTSY.ExpectL(EMobilePhoneEnumerateAPNEntries, KErrNotSupported);
       
   433 		
       
   434 	iPhone.EnumerateAPNEntries( reqStatus, index );
       
   435 	User::WaitForRequest(reqStatus);
       
   436    	AssertMockLtsyStatusL();
       
   437 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   438 
       
   439 	//-------------------------------------------------------------------------
       
   440 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   441  	//-------------------------------------------------------------------------
       
   442 
       
   443 	iMockLTSY.ExpectL(EMobilePhoneEnumerateAPNEntries);
       
   444 	iMockLTSY.CompleteL(EMobilePhoneEnumerateAPNEntries, KErrGeneral, dataComplete);
       
   445 		
       
   446 	iPhone.EnumerateAPNEntries( reqStatus, index );
       
   447 	User::WaitForRequest(reqStatus);
       
   448    	AssertMockLtsyStatusL();
       
   449 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   450 
       
   451  	//-------------------------------------------------------------------------
       
   452 	// TEST C: Successful completion request of
       
   453 	// RMobilePhone::EnumerateAPNEntries when result is not cached.
       
   454  	//-------------------------------------------------------------------------
       
   455 
       
   456 	iMockLTSY.ExpectL(EMobilePhoneEnumerateAPNEntries);
       
   457 	iMockLTSY.CompleteL(EMobilePhoneEnumerateAPNEntries, KErrNone, dataComplete);
       
   458 		
       
   459 	iPhone.EnumerateAPNEntries( reqStatus, index );
       
   460 	User::WaitForRequest(reqStatus);
       
   461    	AssertMockLtsyStatusL();
       
   462 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   463 	ASSERT_EQUALS(indexComplete, index);
       
   464 
       
   465  	//-------------------------------------------------------------------------
       
   466 	// TEST E: Unsolicited completion of RMobilePhone::EnumerateAPNEntries
       
   467 	// from LTSY.
       
   468  	//-------------------------------------------------------------------------
       
   469 	TRequestStatus mockLtsyStatus;
       
   470 	iMockLTSY.NotifyTerminated(mockLtsyStatus); 
       
   471  	// Issue the Complete...	
       
   472 	iMockLTSY.CompleteL(EMobilePhoneEnumerateAPNEntries, KErrNone, dataComplete);
       
   473 	// wait for completion 
       
   474 	User::WaitForRequest(mockLtsyStatus);
       
   475 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   476 
       
   477 	AssertMockLtsyStatusL();
       
   478 	CleanupStack::PopAndDestroy(2, this); // dataComplete, this
       
   479 	
       
   480 	}
       
   481 
       
   482 
       
   483 /**
       
   484 @SYMTestCaseID BA-CTSY-ACL-MEAE-0002
       
   485 @SYMComponent  telephony_ctsy
       
   486 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::EnumerateAPNEntries
       
   487 @SYMTestPriority High
       
   488 @SYMTestActions Invokes cancelling of RMobilePhone::EnumerateAPNEntries
       
   489 @SYMTestExpectedResults Pass
       
   490 @SYMTestType CT
       
   491 */
       
   492 void CCTsyAPNControlListFU::TestEnumerateAPNEntries0002L()
       
   493 	{
       
   494 
       
   495 // This test should test cancellation of EnumerateAPNEntries
       
   496 // If this API does not have a cancel, the test step should be completely removed.
       
   497 
       
   498 	OpenEtelServerL(EUseExtendedError);
       
   499 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   500 	OpenPhoneL();
       
   501 
       
   502 	TRequestStatus mockLtsyStatus;
       
   503 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   504 
       
   505 	RBuf8 data;
       
   506 	CleanupClosePushL(data);
       
   507 	
       
   508 	// data for EnumerateAPNEntries itself
       
   509 	TRequestStatus reqStatus;
       
   510 	TUint32 index = 0;
       
   511 	
       
   512 	// data for CompleteL
       
   513 	TUint32 indexComplete = 5;
       
   514 	TMockLtsyData1<TUint32> ltsyData(indexComplete);
       
   515 	ltsyData.SerialiseL(data);
       
   516 
       
   517  	//-------------------------------------------------------------------------
       
   518 	// Test cancelling of RMobilePhone::EnumerateAPNEntries
       
   519  	//-------------------------------------------------------------------------
       
   520  	iMockLTSY.ExpectL(EMobilePhoneEnumerateAPNEntries);
       
   521 	iMockLTSY.CompleteL(EMobilePhoneEnumerateAPNEntries, KErrNone, data, 10);
       
   522 		
       
   523 	iPhone.EnumerateAPNEntries( reqStatus, index );	
       
   524 	//cancel reguest
       
   525 	iPhone.CancelAsyncRequest(EMobilePhoneEnumerateAPNEntries);
       
   526 	
       
   527 	User::WaitForRequest(reqStatus);
       
   528 	// This defect was fixed. For more information see defect description  
       
   529 	//ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 90201);
       
   530   	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
   531 
       
   532 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   533 	User::WaitForRequest(mockLtsyStatus);
       
   534 		
       
   535 	AssertMockLtsyStatusL();
       
   536 	CleanupStack::PopAndDestroy(2); // data, this	
       
   537 	}
       
   538 
       
   539 
       
   540 /**
       
   541 @SYMTestCaseID BA-CTSY-ACL-MEAE-0004
       
   542 @SYMComponent  telephony_ctsy
       
   543 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::EnumerateAPNEntries
       
   544 @SYMTestPriority High
       
   545 @SYMTestActions Invokes multiple client requests to RMobilePhone::EnumerateAPNEntries
       
   546 @SYMTestExpectedResults Pass
       
   547 @SYMTestType CT
       
   548 */
       
   549 void CCTsyAPNControlListFU::TestEnumerateAPNEntries0004L()
       
   550 	{
       
   551 				
       
   552 	OpenEtelServerL(EUseExtendedError);
       
   553 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   554 	OpenPhoneL();
       
   555 
       
   556 	RBuf8 data;
       
   557 	CleanupClosePushL(data);
       
   558 
       
   559 	// Open second client
       
   560 	RTelServer telServer2;
       
   561 	TInt ret = telServer2.Connect();
       
   562 	ASSERT_EQUALS(KErrNone, ret);
       
   563 	CleanupClosePushL(telServer2);
       
   564 
       
   565 	RMobilePhone phone2;
       
   566 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   567 	ASSERT_EQUALS(KErrNone, ret);
       
   568 	CleanupClosePushL(phone2);
       
   569 	
       
   570 	// data for EnumerateAPNEntrieses itself
       
   571 	TRequestStatus reqStatus;
       
   572 	TUint32 index = 0;	
       
   573 	TRequestStatus reqStatus2;
       
   574 	TUint32 index2 = 0;
       
   575 	
       
   576 	// data for CompleteL
       
   577 	TUint32 indexComplete = 5;
       
   578 	TMockLtsyData1<TUint32> ltsyData(indexComplete);
       
   579 	ltsyData.SerialiseL(data);
       
   580 	
       
   581 
       
   582 	//-------------------------------------------------------------------------
       
   583 	// Test A: Test multiple clients requesting RMobilePhone::EnumerateAPNEntries
       
   584  	//-------------------------------------------------------------------------
       
   585 	iMockLTSY.ExpectL(EMobilePhoneEnumerateAPNEntries);
       
   586 	iMockLTSY.CompleteL(EMobilePhoneEnumerateAPNEntries, KErrNone, data, 5);
       
   587 	
       
   588 	//send first request
       
   589 	iPhone.EnumerateAPNEntries( reqStatus, index );
       
   590 	
       
   591 	//send second request
       
   592 	phone2.EnumerateAPNEntries( reqStatus2, index2 );	
       
   593 	
       
   594 	// wait for the first client	
       
   595 	User::WaitForRequest(reqStatus);
       
   596 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   597 	ASSERT_EQUALS(indexComplete, index);
       
   598 	
       
   599 	// wait for the second client	
       
   600 	User::WaitForRequest(reqStatus2);
       
   601    	AssertMockLtsyStatusL();
       
   602 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());
       
   603 
       
   604 	// Done !
       
   605 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, data, this
       
   606 	}
       
   607 
       
   608 
       
   609 /**
       
   610 @SYMTestCaseID BA-CTSY-ACL-MEAE-0005
       
   611 @SYMComponent  telephony_ctsy
       
   612 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::EnumerateAPNEntries with timeout
       
   613 @SYMTestPriority High
       
   614 @SYMTestActions Invokes RMobilePhone::EnumerateAPNEntries and tests for timeout
       
   615 @SYMTestExpectedResults Pass
       
   616 @SYMTestType CT
       
   617 */
       
   618 void CCTsyAPNControlListFU::TestEnumerateAPNEntries0005L()
       
   619 	{
       
   620 	OpenEtelServerL(EUseExtendedError);
       
   621 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   622 	OpenPhoneL();
       
   623 	// data for EnumerateAPNEntries itself
       
   624 	TRequestStatus reqStatus;
       
   625 	TUint32 index = 0;
       
   626 	
       
   627 	//-------------------------------------------------------------------------
       
   628 	// Test A: Test timeout of RMobilePhone::EnumerateAPNEntries
       
   629  	//-------------------------------------------------------------------------	
       
   630 	iMockLTSY.ExpectL(EMobilePhoneEnumerateAPNEntries);
       
   631 	iPhone.EnumerateAPNEntries( reqStatus, index );
       
   632 	
       
   633 	User::WaitForRequest(reqStatus);
       
   634 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   635 	
       
   636 	AssertMockLtsyStatusL();
       
   637 	// Done !
       
   638 	CleanupStack::PopAndDestroy(1, this); // this
       
   639 	}
       
   640 
       
   641 
       
   642 /**
       
   643 @SYMTestCaseID BA-CTSY-ACL-MAAN-0001
       
   644 @SYMComponent  telephony_ctsy
       
   645 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::AppendAPNName
       
   646 @SYMTestPriority High
       
   647 @SYMTestActions Invokes RMobilePhone::AppendAPNName
       
   648 @SYMTestExpectedResults Pass
       
   649 @SYMTestType CT
       
   650 */
       
   651 void CCTsyAPNControlListFU::TestAppendAPNName0001L()
       
   652 	{
       
   653 
       
   654 	OpenEtelServerL(EUseExtendedError);
       
   655 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   656 	OpenPhoneL();
       
   657 
       
   658 	RBuf8 dataExpect;
       
   659 	CleanupClosePushL(dataExpect);
       
   660 
       
   661 	// data for AppendAPNName itself
       
   662 	TRequestStatus reqStatus;
       
   663 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   664 	_LIT8(KSomeName, "SomeName");
       
   665 	apnEntry.iApn.Copy(KSomeName);
       
   666 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);
       
   667 	// data for ExpectL
       
   668 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData( apnEntry );
       
   669 	ltsyData.SerialiseL(dataExpect);
       
   670 	
       
   671  	//-------------------------------------------------------------------------
       
   672 	// TEST A: failure to dispatch request to LTSY
       
   673  	//-------------------------------------------------------------------------
       
   674 	iMockLTSY.ExpectL(EMobilePhoneAppendAPNName, dataExpect, KErrNotSupported);
       
   675 			
       
   676 	iPhone.AppendAPNName(reqStatus, pckgEntry);
       
   677 	User::WaitForRequest(reqStatus);
       
   678 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   679 	AssertMockLtsyStatusL();
       
   680 
       
   681 	//-------------------------------------------------------------------------
       
   682 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   683  	//-------------------------------------------------------------------------
       
   684 	iMockLTSY.ExpectL(EMobilePhoneAppendAPNName, dataExpect);
       
   685 	iMockLTSY.CompleteL(EMobilePhoneAppendAPNName, KErrGeneral);
       
   686 		
       
   687 	iPhone.AppendAPNName(reqStatus, pckgEntry);
       
   688 	User::WaitForRequest(reqStatus);
       
   689 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   690 	AssertMockLtsyStatusL();
       
   691 	
       
   692  	//-------------------------------------------------------------------------
       
   693 	// TEST C: Successful completion request of
       
   694 	// RMobilePhone::AppendAPNName when result is not cached.
       
   695  	//-------------------------------------------------------------------------
       
   696 	iMockLTSY.ExpectL(EMobilePhoneAppendAPNName, dataExpect);
       
   697 	iMockLTSY.CompleteL(EMobilePhoneAppendAPNName, KErrNone);
       
   698 		
       
   699 	iPhone.AppendAPNName(reqStatus, pckgEntry);
       
   700 	User::WaitForRequest(reqStatus);
       
   701 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   702 	AssertMockLtsyStatusL();
       
   703 
       
   704  	//-------------------------------------------------------------------------
       
   705 	// TEST E: Unsolicited completion of RMobilePhone::AppendAPNName
       
   706 	// from LTSY.
       
   707  	//-------------------------------------------------------------------------	
       
   708 	TRequestStatus mockLtsyStatus;
       
   709 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   710 	
       
   711 	iMockLTSY.CompleteL(EMobilePhoneAppendAPNName, KErrNone);
       
   712 	
       
   713 	User::WaitForRequest(mockLtsyStatus);
       
   714 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   715 
       
   716 	AssertMockLtsyStatusL();
       
   717 	CleanupStack::PopAndDestroy(2, this); // dataExpect, this	 
       
   718 	}
       
   719 
       
   720 
       
   721 /**
       
   722 @SYMTestCaseID BA-CTSY-ACL-MAAN-0002
       
   723 @SYMComponent  telephony_ctsy
       
   724 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::AppendAPNName
       
   725 @SYMTestPriority High
       
   726 @SYMTestActions Invokes cancelling of RMobilePhone::AppendAPNName
       
   727 @SYMTestExpectedResults Pass
       
   728 @SYMTestType CT
       
   729 */
       
   730 void CCTsyAPNControlListFU::TestAppendAPNName0002L()
       
   731 	{
       
   732 
       
   733 	// This test should test cancellation of AppendAPNName
       
   734 	// If this API does not have a cancel, the test step should be completely removed.
       
   735 
       
   736 	OpenEtelServerL(EUseExtendedError);
       
   737 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   738 	OpenPhoneL();
       
   739 
       
   740 	TRequestStatus mockLtsyStatus;
       
   741 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   742 
       
   743 	RBuf8 data;
       
   744 	CleanupClosePushL(data);
       
   745 	
       
   746 	// data for AppendAPNName itself
       
   747 	TRequestStatus reqStatus;
       
   748 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   749 	_LIT8(KSomeName, "SomeName");
       
   750 	apnEntry.iApn.Copy(KSomeName);
       
   751 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);
       
   752 	// data for ExpectL
       
   753 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData( apnEntry );
       
   754 	ltsyData.SerialiseL(data);
       
   755 
       
   756 	//-------------------------------------------------------------------------
       
   757 	// For coverage increasing call Cancel without calling RMobilePhone::AppendAPNName
       
   758  	//------------------------------------------------------------------------- 	 	
       
   759  	iPhone.CancelAsyncRequest(EMobilePhoneAppendAPNName);
       
   760 
       
   761  	//-------------------------------------------------------------------------
       
   762 	// Test cancelling of RMobilePhone::AppendAPNName
       
   763  	//------------------------------------------------------------------------- 	
       
   764 	iMockLTSY.ExpectL(EMobilePhoneAppendAPNName, data);
       
   765 	iMockLTSY.CompleteL(EMobilePhoneAppendAPNName, KErrNone, 10);
       
   766 		
       
   767 	iPhone.AppendAPNName(reqStatus, pckgEntry);
       
   768 	//cancel reguest
       
   769 	iPhone.CancelAsyncRequest(EMobilePhoneAppendAPNName);
       
   770 	
       
   771 	User::WaitForRequest(reqStatus);
       
   772 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
   773 	
       
   774 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   775 	User::WaitForRequest(mockLtsyStatus);
       
   776 	AssertMockLtsyStatusL();
       
   777 	CleanupStack::PopAndDestroy(2); // data, this
       
   778 	
       
   779 	}
       
   780 
       
   781 
       
   782 /**
       
   783 @SYMTestCaseID BA-CTSY-ACL-MAAN-0004
       
   784 @SYMComponent  telephony_ctsy
       
   785 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::AppendAPNName
       
   786 @SYMTestPriority High
       
   787 @SYMTestActions Invokes multiple client requests to RMobilePhone::AppendAPNName
       
   788 @SYMTestExpectedResults Pass
       
   789 @SYMTestType CT
       
   790 */
       
   791 void CCTsyAPNControlListFU::TestAppendAPNName0004L()
       
   792 	{
       
   793 					
       
   794 	OpenEtelServerL(EUseExtendedError);
       
   795 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   796 	OpenPhoneL();
       
   797 
       
   798 	RBuf8 data;
       
   799 	CleanupClosePushL(data);
       
   800 
       
   801 	// Open second client
       
   802 	RTelServer telServer2;
       
   803 	TInt ret = telServer2.Connect();
       
   804 	ASSERT_EQUALS(KErrNone, ret);
       
   805 	CleanupClosePushL(telServer2);
       
   806 
       
   807 	RMobilePhone phone2;
       
   808 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   809 	ASSERT_EQUALS(KErrNone, ret);
       
   810 	CleanupClosePushL(phone2);	
       
   811 	
       
   812 	// data for first AppendAPNName()
       
   813 	TRequestStatus reqStatus;
       
   814 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   815 	_LIT8(KSomeName, "SomeName");
       
   816 	apnEntry.iApn.Copy(KSomeName);
       
   817 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);
       
   818 	
       
   819 	// data for second AppendAPNName()
       
   820 	TRequestStatus reqStatus2;
       
   821 	RMobilePhone::TAPNEntryV3 apnEntry2;
       
   822 	_LIT8(KSomeName2, "SomeName2");
       
   823 	apnEntry2.iApn.Copy(KSomeName2);
       
   824 	RMobilePhone::TAPNEntryV3Pckg pckgEntry2(apnEntry2);
       
   825 	
       
   826 	// data for first ExpectL
       
   827 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData( apnEntry );
       
   828 	ltsyData.SerialiseL(data);
       
   829 
       
   830 	//-------------------------------------------------------------------------
       
   831 	// Test A: Test multiple clients requesting RMobilePhone::AppendAPNName
       
   832  	//-------------------------------------------------------------------------
       
   833  	 	
       
   834  	// first request
       
   835  	iMockLTSY.ExpectL(EMobilePhoneAppendAPNName, data);
       
   836 	iMockLTSY.CompleteL(EMobilePhoneAppendAPNName, KErrNone, 10);		
       
   837 	iPhone.AppendAPNName(reqStatus, pckgEntry);
       
   838 	
       
   839 	// second request	
       
   840 	phone2.AppendAPNName(reqStatus2, pckgEntry2);
       
   841 	
       
   842 	// wait for the first answer
       
   843 	User::WaitForRequest(reqStatus);
       
   844 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   845 	
       
   846 	// wait for the second answer
       
   847 	User::WaitForRequest(reqStatus2);
       
   848 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());	
       
   849 	
       
   850 	AssertMockLtsyStatusL();
       
   851 	// Done !
       
   852 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, data, this
       
   853 	}
       
   854 
       
   855 
       
   856 /**
       
   857 @SYMTestCaseID BA-CTSY-ACL-MAAN-0005
       
   858 @SYMComponent  telephony_ctsy
       
   859 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::AppendAPNName with timeout
       
   860 @SYMTestPriority High
       
   861 @SYMTestActions Invokes RMobilePhone::AppendAPNName and tests for timeout
       
   862 @SYMTestExpectedResults Pass
       
   863 @SYMTestType CT
       
   864 */
       
   865 void CCTsyAPNControlListFU::TestAppendAPNName0005L()
       
   866 	{
       
   867 	OpenEtelServerL(EUseExtendedError);
       
   868 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   869 	OpenPhoneL();
       
   870 
       
   871 	RBuf8 data;
       
   872 	CleanupClosePushL(data);
       
   873 	
       
   874 	// data for AppendAPNName itself
       
   875 	TRequestStatus reqStatus;
       
   876 	RMobilePhone::TAPNEntryV3 apnEntry;
       
   877 	_LIT8(KSomeName, "SomeName");
       
   878 	apnEntry.iApn.Copy(KSomeName);
       
   879 	RMobilePhone::TAPNEntryV3Pckg pckgEntry(apnEntry);
       
   880 	// data for ExpectL
       
   881 	TMockLtsyData1<RMobilePhone::TAPNEntryV3> ltsyData( apnEntry );
       
   882 	ltsyData.SerialiseL(data);
       
   883 
       
   884 	//-------------------------------------------------------------------------
       
   885 	// Test A: Test timeout of RMobilePhone::AppendAPNName
       
   886  	//------------------------------------------------------------------------- 	
       
   887  	iMockLTSY.ExpectL(EMobilePhoneAppendAPNName, data);		
       
   888 	iPhone.AppendAPNName(reqStatus, pckgEntry);
       
   889 	
       
   890 	User::WaitForRequest(reqStatus);
       
   891 	
       
   892 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   893 	
       
   894 	AssertMockLtsyStatusL();
       
   895 	// Done !
       
   896 	CleanupStack::PopAndDestroy(2, this); // data, this
       
   897 
       
   898 	}
       
   899 
       
   900 
       
   901 /**
       
   902 @SYMTestCaseID BA-CTSY-ACL-MDAN-0001
       
   903 @SYMComponent  telephony_ctsy
       
   904 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::DeleteAPNName
       
   905 @SYMTestPriority High
       
   906 @SYMTestActions Invokes RMobilePhone::DeleteAPNName
       
   907 @SYMTestExpectedResults Pass
       
   908 @SYMTestType CT
       
   909 */
       
   910 void CCTsyAPNControlListFU::TestDeleteAPNName0001L()
       
   911 	{
       
   912 
       
   913 	OpenEtelServerL(EUseExtendedError);
       
   914 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   915 	OpenPhoneL();
       
   916 
       
   917 	RBuf8 dataExpect;
       
   918 	CleanupClosePushL(dataExpect);
       
   919 	
       
   920 	// data for DeleteAPNName itself
       
   921 	TRequestStatus reqStatus;
       
   922 	TUint32 index = 0;
       
   923 	
       
   924 	// data for ExpectL
       
   925 	TMockLtsyData1<TUint32> ltsyData( index );
       
   926 	ltsyData.SerialiseL(dataExpect);
       
   927 	
       
   928  	//-------------------------------------------------------------------------
       
   929 	// TEST A: failure to dispatch request to LTSY
       
   930  	//-------------------------------------------------------------------------
       
   931 	iMockLTSY.ExpectL(EMobilePhoneDeleteAPNName, dataExpect, KErrNotSupported);	
       
   932 	
       
   933 	iPhone.DeleteAPNName(reqStatus, index);
       
   934 	User::WaitForRequest(reqStatus);
       
   935 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   936 	AssertMockLtsyStatusL();
       
   937 
       
   938 	//-------------------------------------------------------------------------
       
   939 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   940  	//-------------------------------------------------------------------------
       
   941 	iMockLTSY.ExpectL(EMobilePhoneDeleteAPNName, dataExpect);	
       
   942 	iMockLTSY.CompleteL(EMobilePhoneDeleteAPNName, KErrGeneral);	
       
   943 	
       
   944 	iPhone.DeleteAPNName(reqStatus, index);
       
   945 	User::WaitForRequest(reqStatus);
       
   946 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   947 	AssertMockLtsyStatusL();
       
   948 
       
   949  	//-------------------------------------------------------------------------
       
   950 	// TEST C: Successful completion request of
       
   951 	// RMobilePhone::DeleteAPNName when result is not cached.
       
   952  	//-------------------------------------------------------------------------
       
   953 	iMockLTSY.ExpectL(EMobilePhoneDeleteAPNName, dataExpect);	
       
   954 	iMockLTSY.CompleteL(EMobilePhoneDeleteAPNName, KErrNone);	
       
   955 	
       
   956 	iPhone.DeleteAPNName(reqStatus, index);
       
   957 	User::WaitForRequest(reqStatus);
       
   958 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   959 	AssertMockLtsyStatusL();
       
   960 
       
   961  	//-------------------------------------------------------------------------
       
   962 	// TEST E: Unsolicited completion of RMobilePhone::DeleteAPNName
       
   963 	// from LTSY.
       
   964  	//-------------------------------------------------------------------------
       
   965 	TRequestStatus mockLtsyStatus;
       
   966 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   967 
       
   968 	iMockLTSY.CompleteL(EMobilePhoneDeleteAPNName, KErrNone);	
       
   969 
       
   970 	User::WaitForRequest(mockLtsyStatus);
       
   971 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   972 
       
   973 	AssertMockLtsyStatusL();
       
   974 	CleanupStack::PopAndDestroy(2, this); // dataExpect, this
       
   975 	
       
   976 	}
       
   977 
       
   978 
       
   979 /**
       
   980 @SYMTestCaseID BA-CTSY-ACL-MDAN-0002
       
   981 @SYMComponent  telephony_ctsy
       
   982 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::DeleteAPNName
       
   983 @SYMTestPriority High
       
   984 @SYMTestActions Invokes cancelling of RMobilePhone::DeleteAPNName
       
   985 @SYMTestExpectedResults Pass
       
   986 @SYMTestType CT
       
   987 */
       
   988 void CCTsyAPNControlListFU::TestDeleteAPNName0002L()
       
   989 	{
       
   990 
       
   991 // This test should test cancellation of DeleteAPNName
       
   992 // If this API does not have a cancel, the test step should be completely removed.
       
   993 
       
   994 	OpenEtelServerL(EUseExtendedError);
       
   995 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   996 	OpenPhoneL();
       
   997 
       
   998 	TRequestStatus mockLtsyStatus;
       
   999 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1000 
       
  1001 	RBuf8 dataExpect;
       
  1002 	CleanupClosePushL(dataExpect);
       
  1003 	
       
  1004 	// data for DeleteAPNName itself
       
  1005 	TRequestStatus reqStatus;
       
  1006 	TUint32 index = 0;
       
  1007 	
       
  1008 	// data for ExpectL
       
  1009 	TMockLtsyData1<TUint32> ltsyData( index );
       
  1010 	ltsyData.SerialiseL(dataExpect);
       
  1011 	
       
  1012 	//-------------------------------------------------------------------------
       
  1013 	// For coverage increasing call Cancel without calling RMobilePhone::DeleteAPNName
       
  1014  	//------------------------------------------------------------------------- 	 	
       
  1015  	iPhone.CancelAsyncRequest(EMobilePhoneDeleteAPNName);
       
  1016 
       
  1017  	//-------------------------------------------------------------------------
       
  1018 	// Test cancelling of RMobilePhone::DeleteAPNName
       
  1019  	//------------------------------------------------------------------------- 	
       
  1020 	iMockLTSY.ExpectL(EMobilePhoneDeleteAPNName, dataExpect);	
       
  1021 	iMockLTSY.CompleteL(EMobilePhoneDeleteAPNName, KErrNone, 10);	
       
  1022 	
       
  1023 	iPhone.DeleteAPNName(reqStatus, index);
       
  1024 	
       
  1025 	//cancel reguest
       
  1026 	iPhone.CancelAsyncRequest(EMobilePhoneDeleteAPNName);
       
  1027 	
       
  1028 	User::WaitForRequest(reqStatus);
       
  1029 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
  1030 	
       
  1031 
       
  1032 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1033 	User::WaitForRequest(mockLtsyStatus);
       
  1034 	AssertMockLtsyStatusL();
       
  1035 	CleanupStack::PopAndDestroy(2); // dataExpect, this
       
  1036 	
       
  1037 	}
       
  1038 
       
  1039 /**
       
  1040 @SYMTestCaseID BA-CTSY-ACL-MDAN-0004
       
  1041 @SYMComponent  telephony_ctsy
       
  1042 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::DeleteAPNName
       
  1043 @SYMTestPriority High
       
  1044 @SYMTestActions Invokes multiple client requests to RMobilePhone::DeleteAPNName
       
  1045 @SYMTestExpectedResults Pass
       
  1046 @SYMTestType CT
       
  1047 */
       
  1048 void CCTsyAPNControlListFU::TestDeleteAPNName0004L()
       
  1049 	{				
       
  1050 	OpenEtelServerL(EUseExtendedError);
       
  1051 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1052 	OpenPhoneL();
       
  1053 
       
  1054 	RBuf8 data;
       
  1055 	CleanupClosePushL(data);
       
  1056 
       
  1057 	// Open second client
       
  1058 	RTelServer telServer2;
       
  1059 	TInt ret = telServer2.Connect();
       
  1060 	ASSERT_EQUALS(KErrNone, ret);
       
  1061 	CleanupClosePushL(telServer2);
       
  1062 
       
  1063 	RMobilePhone phone2;
       
  1064 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1065 	ASSERT_EQUALS(KErrNone, ret);
       
  1066 	CleanupClosePushL(phone2);
       
  1067 	
       
  1068 	// data for the first DeleteAPNName itself
       
  1069 	TRequestStatus reqStatus;
       
  1070 	TUint32 index = 0;
       
  1071 	
       
  1072 	// data for the second DeleteAPNName itself
       
  1073 	TRequestStatus reqStatus2;
       
  1074 	TUint32 index2 = 1;
       
  1075 	
       
  1076 	// data for ExpectL
       
  1077 	TMockLtsyData1<TUint32> ltsyData( index );
       
  1078 	ltsyData.SerialiseL(data);		
       
  1079 
       
  1080 	//-------------------------------------------------------------------------
       
  1081 	// Test A: Test multiple clients requesting RMobilePhone::DeleteAPNName
       
  1082  	//-------------------------------------------------------------------------
       
  1083 	iMockLTSY.ExpectL(EMobilePhoneDeleteAPNName, data);	
       
  1084 	iMockLTSY.CompleteL(EMobilePhoneDeleteAPNName, KErrNone);	
       
  1085 	
       
  1086 	// first request
       
  1087 	iPhone.DeleteAPNName(reqStatus, index);	
       
  1088 	// second request
       
  1089 	phone2.DeleteAPNName(reqStatus2, index2);
       
  1090 		
       
  1091 	// wait for the first answer
       
  1092 	User::WaitForRequest(reqStatus);
       
  1093 	ASSERT_EQUALS(KErrNone, reqStatus.Int());	
       
  1094 	
       
  1095 	// wait for the second answer
       
  1096 	User::WaitForRequest(reqStatus2);
       
  1097 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());	
       
  1098 	
       
  1099 	AssertMockLtsyStatusL();
       
  1100 	// Done !
       
  1101 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, data, this
       
  1102 	}
       
  1103 
       
  1104 
       
  1105 /**
       
  1106 @SYMTestCaseID BA-CTSY-ACL-MDAN-0005
       
  1107 @SYMComponent  telephony_ctsy
       
  1108 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::DeleteAPNName with timeout
       
  1109 @SYMTestPriority High
       
  1110 @SYMTestActions Invokes RMobilePhone::DeleteAPNName and tests for timeout
       
  1111 @SYMTestExpectedResults Pass
       
  1112 @SYMTestType CT
       
  1113 */
       
  1114 void CCTsyAPNControlListFU::TestDeleteAPNName0005L()
       
  1115 	{
       
  1116 	OpenEtelServerL(EUseExtendedError);
       
  1117 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1118 	OpenPhoneL();
       
  1119 
       
  1120 	RBuf8 dataExpect;
       
  1121 	CleanupClosePushL(dataExpect);
       
  1122 	
       
  1123 	// data for DeleteAPNName itself
       
  1124 	TRequestStatus reqStatus;
       
  1125 	TUint32 index = 0;
       
  1126 	
       
  1127 	// data for ExpectL
       
  1128 	TMockLtsyData1<TUint32> ltsyData( index );
       
  1129 	ltsyData.SerialiseL(dataExpect);
       
  1130 
       
  1131 	//-------------------------------------------------------------------------
       
  1132 	// Test A: Test timeout of RMobilePhone::DeleteAPNName
       
  1133  	//-------------------------------------------------------------------------
       
  1134 	iMockLTSY.ExpectL(EMobilePhoneDeleteAPNName, dataExpect);		
       
  1135 	
       
  1136 	iPhone.DeleteAPNName(reqStatus, index);
       
  1137 	User::WaitForRequest(reqStatus);
       
  1138 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
  1139 	AssertMockLtsyStatusL();
       
  1140 
       
  1141 	// Done !
       
  1142 	CleanupStack::PopAndDestroy(2, this); // dataExpect, this
       
  1143 	}
       
  1144 
       
  1145 
       
  1146 /**
       
  1147 @SYMTestCaseID BA-CTSY-ACL-MNALC-0001
       
  1148 @SYMComponent  telephony_ctsy
       
  1149 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyAPNListChanged
       
  1150 @SYMTestPriority High
       
  1151 @SYMTestActions Invokes RMobilePhone::NotifyAPNListChanged
       
  1152 @SYMTestExpectedResults Pass
       
  1153 @SYMTestType CT
       
  1154 */
       
  1155 void CCTsyAPNControlListFU::TestNotifyAPNListChanged0001L()
       
  1156 	{	
       
  1157 	OpenEtelServerL(EUseExtendedError);
       
  1158 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1159 	OpenPhoneL();
       
  1160 	
       
  1161 	TRequestStatus reqStatus;
       
  1162 		
       
  1163 	//-------------------------------------------------------------------------
       
  1164 	// TEST E: Unsolicited completion of RMobilePhone::NotifyAPNListChanged
       
  1165 	// from LTSY.
       
  1166  	//-------------------------------------------------------------------------
       
  1167 	TRequestStatus mockLtsyStatus;
       
  1168 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1169 	
       
  1170 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNListChanged, KErrNone);
       
  1171 		
       
  1172 	User::WaitForRequest(mockLtsyStatus);
       
  1173 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1174 	
       
  1175 	//-------------------------------------------------------------------------
       
  1176 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  1177  	//-------------------------------------------------------------------------
       
  1178 	iPhone.NotifyAPNListChanged(reqStatus);		
       
  1179 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNListChanged, KErrGeneral);	
       
  1180 	
       
  1181 	User::WaitForRequest(reqStatus);
       
  1182 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1183 
       
  1184  	//-------------------------------------------------------------------------
       
  1185 	// TEST C: Successful completion request of
       
  1186 	// RMobilePhone::NotifyAPNListChanged when result is not cached.
       
  1187  	//-------------------------------------------------------------------------
       
  1188 	iPhone.NotifyAPNListChanged(reqStatus);		
       
  1189 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNListChanged, KErrNone);
       
  1190 		
       
  1191 	User::WaitForRequest(reqStatus);
       
  1192 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1193 	AssertMockLtsyStatusL();
       
  1194 		
       
  1195 	CleanupStack::PopAndDestroy(1, this); // this	
       
  1196 	}
       
  1197 
       
  1198 
       
  1199 /**
       
  1200 @SYMTestCaseID BA-CTSY-ACL-MNALC-0002
       
  1201 @SYMComponent  telephony_ctsy
       
  1202 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::NotifyAPNListChanged
       
  1203 @SYMTestPriority High
       
  1204 @SYMTestActions Invokes cancelling of RMobilePhone::NotifyAPNListChanged
       
  1205 @SYMTestExpectedResults Pass
       
  1206 @SYMTestType CT
       
  1207 */
       
  1208 void CCTsyAPNControlListFU::TestNotifyAPNListChanged0002L()
       
  1209 	{
       
  1210 
       
  1211 // This test should test cancellation of NotifyAPNListChanged
       
  1212 // If this API does not have a cancel, the test step should be completely removed.
       
  1213 
       
  1214 	OpenEtelServerL(EUseExtendedError);
       
  1215 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1216 	OpenPhoneL();
       
  1217 
       
  1218 	TRequestStatus mockLtsyStatus;
       
  1219 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1220 
       
  1221 	TRequestStatus reqStatus;
       
  1222 	
       
  1223 	//-------------------------------------------------------------------------
       
  1224 	// For coverage increasing call Cancel without calling RMobilePhone::NotifyAPNListChanged
       
  1225  	//------------------------------------------------------------------------- 	 	
       
  1226  	// It is useless call as there is a checking of active or waiting request in 
       
  1227  	//CTelObject::GeneralReq case EIsaCancelMessage:
       
  1228  	//iPhone.CancelAsyncRequest(EMobilePhoneNotifyAPNListChanged); 	
       
  1229 
       
  1230  	//-------------------------------------------------------------------------
       
  1231 	// Test cancelling of RMobilePhone::NotifyAPNListChanged
       
  1232  	//------------------------------------------------------------------------- 	
       
  1233  	iPhone.NotifyAPNListChanged(reqStatus);		
       
  1234 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNListChanged, KErrNone, 10);
       
  1235 	
       
  1236 	// cancel request
       
  1237 	iPhone.CancelAsyncRequest(EMobilePhoneNotifyAPNListChanged);
       
  1238 			
       
  1239 	User::WaitForRequest(reqStatus);
       
  1240 	ASSERT_EQUALS(KErrCancel, reqStatus.Int()); 	
       
  1241 	
       
  1242 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1243 	User::WaitForRequest(mockLtsyStatus);
       
  1244 	AssertMockLtsyStatusL();
       
  1245 	CleanupStack::PopAndDestroy(1); // this	
       
  1246 	}
       
  1247 
       
  1248 
       
  1249 /**
       
  1250 @SYMTestCaseID BA-CTSY-ACL-MNALC-0004
       
  1251 @SYMComponent  telephony_ctsy
       
  1252 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::NotifyAPNListChanged
       
  1253 @SYMTestPriority High
       
  1254 @SYMTestActions Invokes multiple client requests to RMobilePhone::NotifyAPNListChanged
       
  1255 @SYMTestExpectedResults Pass
       
  1256 @SYMTestType CT
       
  1257 */
       
  1258 void CCTsyAPNControlListFU::TestNotifyAPNListChanged0004L()
       
  1259 	{
       
  1260 					
       
  1261 	OpenEtelServerL(EUseExtendedError);
       
  1262 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1263 	OpenPhoneL();
       
  1264 
       
  1265 	RBuf8 data;
       
  1266 	CleanupClosePushL(data);
       
  1267 
       
  1268 	// Open second client
       
  1269 	RTelServer telServer2;
       
  1270 	TInt ret = telServer2.Connect();
       
  1271 	ASSERT_EQUALS(KErrNone, ret);
       
  1272 	CleanupClosePushL(telServer2);
       
  1273 
       
  1274 	RMobilePhone phone2;
       
  1275 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1276 	ASSERT_EQUALS(KErrNone, ret);
       
  1277 	CleanupClosePushL(phone2);
       
  1278 
       
  1279 	//-------------------------------------------------------------------------
       
  1280 	// Test A: Test multiple clients requesting RMobilePhone::NotifyAPNListChanged
       
  1281  	//-------------------------------------------------------------------------
       
  1282  	TRequestStatus reqStatus;
       
  1283  	TRequestStatus reqStatus2;
       
  1284  	
       
  1285  	//send first request
       
  1286  	iPhone.NotifyAPNListChanged(reqStatus);	
       
  1287  	
       
  1288  	//send second request
       
  1289  	phone2.NotifyAPNListChanged(reqStatus2);
       
  1290  	
       
  1291  	// send completion
       
  1292 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNListChanged, KErrNone);
       
  1293 	
       
  1294 	// wait for the first notification
       
  1295 	User::WaitForRequest(reqStatus);
       
  1296 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1297 	
       
  1298 	// wait for the second notification
       
  1299 	User::WaitForRequest(reqStatus2);
       
  1300 	ASSERT_EQUALS(KErrNone, reqStatus2.Int()); 
       
  1301 	
       
  1302 	AssertMockLtsyStatusL();
       
  1303 	// Done !
       
  1304 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, data, this
       
  1305 	}
       
  1306 
       
  1307 
       
  1308 /**
       
  1309 @SYMTestCaseID BA-CTSY-ACL-MGACLSS-0001
       
  1310 @SYMComponent  telephony_ctsy
       
  1311 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetAPNControlListServiceStatus
       
  1312 @SYMTestPriority High
       
  1313 @SYMTestActions Invokes RMobilePhone::GetAPNControlListServiceStatus
       
  1314 @SYMTestExpectedResults Pass
       
  1315 @SYMTestType CT
       
  1316 */
       
  1317 void CCTsyAPNControlListFU::TestGetAPNControlListServiceStatus0001L()
       
  1318 	{
       
  1319 
       
  1320 	OpenEtelServerL(EUseExtendedError);
       
  1321 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1322 	OpenPhoneL();
       
  1323 
       
  1324 	RBuf8 dataComplete;
       
  1325 	CleanupClosePushL(dataComplete);	
       
  1326 	
       
  1327 	// data for GetAPNControlListServiceStatus()
       
  1328 	TRequestStatus reqStatus;
       
  1329 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1330 	
       
  1331 	// data for CompleteL
       
  1332 	RMobilePhone::TAPNControlListServiceStatus apnStatusComplete = RMobilePhone::EAPNControlListServiceEnabled; 
       
  1333 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnStatusComplete);
       
  1334 	ltsyData.SerialiseL(dataComplete);	
       
  1335 
       
  1336  	//-------------------------------------------------------------------------
       
  1337 	// TEST A: failure to dispatch request to LTSY
       
  1338  	//-------------------------------------------------------------------------
       
  1339 	iMockLTSY.ExpectL(EMobilePhoneGetAPNControlListServiceStatus, KErrNotSupported);
       
  1340 		
       
  1341 	iPhone.GetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1342 	User::WaitForRequest(reqStatus);
       
  1343 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); 
       
  1344 	AssertMockLtsyStatusL();
       
  1345 	
       
  1346 	//-------------------------------------------------------------------------
       
  1347 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  1348  	//-------------------------------------------------------------------------
       
  1349 	iMockLTSY.ExpectL(EMobilePhoneGetAPNControlListServiceStatus);
       
  1350 	iMockLTSY.CompleteL(EMobilePhoneGetAPNControlListServiceStatus, KErrGeneral, dataComplete);
       
  1351 		
       
  1352 	iPhone.GetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1353 	User::WaitForRequest(reqStatus);
       
  1354 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int()); 	
       
  1355 	AssertMockLtsyStatusL();
       
  1356 
       
  1357  	//-------------------------------------------------------------------------
       
  1358 	// TEST C: Successful completion request of
       
  1359 	// RMobilePhone::GetAPNControlListServiceStatus when result is not cached.
       
  1360  	//-------------------------------------------------------------------------
       
  1361 	iMockLTSY.ExpectL(EMobilePhoneGetAPNControlListServiceStatus);
       
  1362 	iMockLTSY.CompleteL(EMobilePhoneGetAPNControlListServiceStatus, KErrNone, dataComplete);
       
  1363 		
       
  1364 	iPhone.GetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1365 	User::WaitForRequest(reqStatus);
       
  1366 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1367 	ASSERT_EQUALS(apnStatusComplete, apnControlListServiceStatus);	
       
  1368 	AssertMockLtsyStatusL();
       
  1369 
       
  1370   	//-------------------------------------------------------------------------
       
  1371 	// TEST E: Unsolicited completion of RMobilePhone::GetAPNControlListServiceStatus
       
  1372 	// from LTSY.
       
  1373  	//-------------------------------------------------------------------------
       
  1374 	TRequestStatus mockLtsyStatus;
       
  1375 	iMockLTSY.NotifyTerminated(mockLtsyStatus); 
       
  1376  	// Issue the Complete...	
       
  1377 	iMockLTSY.CompleteL(EMobilePhoneGetAPNControlListServiceStatus, KErrNone, dataComplete);
       
  1378 	// wait for completion 
       
  1379 	User::WaitForRequest(mockLtsyStatus);
       
  1380 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int())
       
  1381 
       
  1382 	AssertMockLtsyStatusL();
       
  1383 	CleanupStack::PopAndDestroy(2, this); // dataComplete, this
       
  1384 	
       
  1385 	}
       
  1386 
       
  1387 
       
  1388 /**
       
  1389 @SYMTestCaseID BA-CTSY-ACL-MGACLSS-0002
       
  1390 @SYMComponent  telephony_ctsy
       
  1391 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::GetAPNControlListServiceStatus
       
  1392 @SYMTestPriority High
       
  1393 @SYMTestActions Invokes cancelling of RMobilePhone::GetAPNControlListServiceStatus
       
  1394 @SYMTestExpectedResults Pass
       
  1395 @SYMTestType CT
       
  1396 */
       
  1397 void CCTsyAPNControlListFU::TestGetAPNControlListServiceStatus0002L()
       
  1398 	{
       
  1399 
       
  1400 // This test should test cancellation of GetAPNControlListServiceStatus
       
  1401 // If this API does not have a cancel, the test step should be completely removed.
       
  1402 
       
  1403 	OpenEtelServerL(EUseExtendedError);
       
  1404 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1405 	OpenPhoneL();
       
  1406 
       
  1407 	TRequestStatus mockLtsyStatus;
       
  1408 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1409 
       
  1410 	RBuf8 dataComplete;
       
  1411 	CleanupClosePushL(dataComplete);	
       
  1412 	
       
  1413 	// data for GetAPNControlListServiceStatus()
       
  1414 	TRequestStatus reqStatus;
       
  1415 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1416 	
       
  1417 	// data for CompleteL
       
  1418 	RMobilePhone::TAPNControlListServiceStatus apnStatusComplete = RMobilePhone::EAPNControlListServiceEnabled; 
       
  1419 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnStatusComplete);
       
  1420 	ltsyData.SerialiseL(dataComplete);	
       
  1421 
       
  1422  	//-------------------------------------------------------------------------
       
  1423 	// Test cancelling of RMobilePhone::GetAPNControlListServiceStatus
       
  1424  	//-------------------------------------------------------------------------
       
  1425  	iMockLTSY.ExpectL(EMobilePhoneGetAPNControlListServiceStatus);
       
  1426 	iMockLTSY.CompleteL(EMobilePhoneGetAPNControlListServiceStatus, KErrNone, dataComplete, 10);
       
  1427 		
       
  1428 	iPhone.GetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1429 	//cancel reguest
       
  1430 	iPhone.CancelAsyncRequest(EMobilePhoneGetAPNControlListServiceStatus);		
       
  1431 	User::WaitForRequest(reqStatus);
       
  1432 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());  	
       
  1433 
       
  1434 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1435 	User::WaitForRequest(mockLtsyStatus);
       
  1436 	
       
  1437 	AssertMockLtsyStatusL();
       
  1438 	CleanupStack::PopAndDestroy(2); // dataComplete, this
       
  1439 	
       
  1440 	}
       
  1441 
       
  1442 
       
  1443 /**
       
  1444 @SYMTestCaseID BA-CTSY-ACL-MGACLSS-0004
       
  1445 @SYMComponent  telephony_ctsy
       
  1446 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::GetAPNControlListServiceStatus
       
  1447 @SYMTestPriority High
       
  1448 @SYMTestActions Invokes multiple client requests to RMobilePhone::GetAPNControlListServiceStatus
       
  1449 @SYMTestExpectedResults Pass
       
  1450 @SYMTestType CT
       
  1451 */
       
  1452 void CCTsyAPNControlListFU::TestGetAPNControlListServiceStatus0004L()
       
  1453 	{
       
  1454 					
       
  1455 	OpenEtelServerL(EUseExtendedError);
       
  1456 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1457 	OpenPhoneL();
       
  1458 
       
  1459 	RBuf8 dataComplete;
       
  1460 	CleanupClosePushL(dataComplete);
       
  1461 
       
  1462 	// Open second client
       
  1463 	RTelServer telServer2;
       
  1464 	TInt ret = telServer2.Connect();
       
  1465 	ASSERT_EQUALS(KErrNone, ret);
       
  1466 	CleanupClosePushL(telServer2);
       
  1467 
       
  1468 	RMobilePhone phone2;
       
  1469 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1470 	ASSERT_EQUALS(KErrNone, ret);
       
  1471 	CleanupClosePushL(phone2);	
       
  1472 	
       
  1473 	// data for the first  GetAPNControlListServiceStatus()
       
  1474 	TRequestStatus reqStatus;
       
  1475 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1476 	
       
  1477 	// data for the second  GetAPNControlListServiceStatus()
       
  1478 	TRequestStatus reqStatus2;
       
  1479 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus2;
       
  1480 	
       
  1481 	// data for CompleteL
       
  1482 	RMobilePhone::TAPNControlListServiceStatus apnStatusComplete = RMobilePhone::EAPNControlListServiceEnabled; 
       
  1483 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnStatusComplete);
       
  1484 	ltsyData.SerialiseL(dataComplete);	
       
  1485 
       
  1486 	//-------------------------------------------------------------------------
       
  1487 	// Test A: Test multiple clients requesting RMobilePhone::GetAPNControlListServiceStatus
       
  1488  	//-------------------------------------------------------------------------
       
  1489 	
       
  1490 	// send first request
       
  1491 	iMockLTSY.ExpectL(EMobilePhoneGetAPNControlListServiceStatus);
       
  1492 	iMockLTSY.CompleteL(EMobilePhoneGetAPNControlListServiceStatus, KErrNone, dataComplete);		
       
  1493 	iPhone.GetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);	
       
  1494 	
       
  1495 	// send second request		
       
  1496 	phone2.GetAPNControlListServiceStatus(reqStatus2, apnControlListServiceStatus2);
       
  1497 	
       
  1498 	// wait for the first answer	
       
  1499 	User::WaitForRequest(reqStatus);
       
  1500 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1501 	ASSERT_EQUALS(apnStatusComplete, apnControlListServiceStatus);	
       
  1502 	
       
  1503 	// wait for the second answer	
       
  1504 	User::WaitForRequest(reqStatus2);
       
  1505 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int()); 
       
  1506 		
       
  1507 	AssertMockLtsyStatusL();	
       
  1508 	// Done !
       
  1509 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, dataComplete, this
       
  1510 
       
  1511 	}
       
  1512 
       
  1513 
       
  1514 /**
       
  1515 @SYMTestCaseID BA-CTSY-ACL-MGACLSS-0005
       
  1516 @SYMComponent  telephony_ctsy
       
  1517 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetAPNControlListServiceStatus with timeout
       
  1518 @SYMTestPriority High
       
  1519 @SYMTestActions Invokes RMobilePhone::GetAPNControlListServiceStatus and tests for timeout
       
  1520 @SYMTestExpectedResults Pass
       
  1521 @SYMTestType CT
       
  1522 */
       
  1523 void CCTsyAPNControlListFU::TestGetAPNControlListServiceStatus0005L()
       
  1524 	{
       
  1525 	
       
  1526 	OpenEtelServerL(EUseExtendedError);
       
  1527 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1528 	OpenPhoneL();
       
  1529 	
       
  1530 	// data for GetAPNControlListServiceStatus()
       
  1531 	TRequestStatus reqStatus;
       
  1532 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1533 	
       
  1534 	//-------------------------------------------------------------------------
       
  1535 	// Test A: Test timeout of RMobilePhone::GetAPNControlListServiceStatus
       
  1536  	//-------------------------------------------------------------------------
       
  1537  	iMockLTSY.ExpectL(EMobilePhoneGetAPNControlListServiceStatus);
       
  1538 	
       
  1539 	iPhone.GetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);	
       
  1540 	
       
  1541 	User::WaitForRequest(reqStatus);
       
  1542 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());  
       
  1543 		
       
  1544 	AssertMockLtsyStatusL();
       
  1545 	// Done !
       
  1546 	CleanupStack::PopAndDestroy(1, this); // this
       
  1547 
       
  1548 	}
       
  1549 
       
  1550 
       
  1551 /**
       
  1552 @SYMTestCaseID BA-CTSY-ACL-MSACLSS-0001
       
  1553 @SYMComponent  telephony_ctsy
       
  1554 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetAPNControlListServiceStatus
       
  1555 @SYMTestPriority High
       
  1556 @SYMTestActions Invokes RMobilePhone::SetAPNControlListServiceStatus
       
  1557 @SYMTestExpectedResults Pass
       
  1558 @SYMTestType CT
       
  1559 */
       
  1560 void CCTsyAPNControlListFU::TestSetAPNControlListServiceStatus0001L()
       
  1561 	{
       
  1562 
       
  1563 	OpenEtelServerL(EUseExtendedError);
       
  1564 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1565 	OpenPhoneL();
       
  1566 
       
  1567 	RBuf8 dataExpect;
       
  1568 	CleanupClosePushL(dataExpect);
       
  1569 	
       
  1570 	// data for SetAPNControlListServiceStatus() itself
       
  1571 	TRequestStatus reqStatus;
       
  1572 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1573 	apnControlListServiceStatus = RMobilePhone::EAPNControlListServiceEnabled;
       
  1574 	
       
  1575 	// data for ExpectL
       
  1576 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnControlListServiceStatus);
       
  1577 	ltsyData.SerialiseL(dataExpect);	
       
  1578 	
       
  1579  	//-------------------------------------------------------------------------
       
  1580 	// TEST A: failure to dispatch request to LTSY
       
  1581  	//-------------------------------------------------------------------------
       
  1582 	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect, KErrNotSupported);
       
  1583 	
       
  1584 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1585 	
       
  1586 	User::WaitForRequest(reqStatus);
       
  1587 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); 
       
  1588 	AssertMockLtsyStatusL();
       
  1589 
       
  1590 	//-------------------------------------------------------------------------
       
  1591 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  1592  	//-------------------------------------------------------------------------
       
  1593 	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect);
       
  1594 	iMockLTSY.CompleteL(EMobilePhoneSetAPNControlListServiceStatus, KErrGeneral);
       
  1595 	
       
  1596 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1597 	
       
  1598 	User::WaitForRequest(reqStatus);
       
  1599 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1600 	AssertMockLtsyStatusL();
       
  1601 
       
  1602  	//-------------------------------------------------------------------------
       
  1603 	// TEST C: Successful completion request of
       
  1604 	// RMobilePhone::SetAPNControlListServiceStatus when result is not cached.
       
  1605  	//-------------------------------------------------------------------------
       
  1606 	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect);
       
  1607 	iMockLTSY.CompleteL(EMobilePhoneSetAPNControlListServiceStatus, KErrNone);
       
  1608 	
       
  1609 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1610 	
       
  1611 	User::WaitForRequest(reqStatus);
       
  1612 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1613 	AssertMockLtsyStatusL();
       
  1614 		
       
  1615   	//-------------------------------------------------------------------------
       
  1616 	// TEST E: Unsolicited completion of RMobilePhone::SetAPNControlListServiceStatus
       
  1617 	// from LTSY.
       
  1618  	//-------------------------------------------------------------------------
       
  1619 	TRequestStatus mockLtsyStatus;
       
  1620 	iMockLTSY.NotifyTerminated(mockLtsyStatus); 
       
  1621  	// Issue the Complete...	
       
  1622 	iMockLTSY.CompleteL(EMobilePhoneSetAPNControlListServiceStatus, KErrNone);
       
  1623 	// wait for completion 
       
  1624 	User::WaitForRequest(mockLtsyStatus);
       
  1625 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int())
       
  1626 	AssertMockLtsyStatusL();
       
  1627 	CleanupStack::PopAndDestroy(2, this); // dataExpect, this
       
  1628 	
       
  1629 	}
       
  1630 
       
  1631 
       
  1632 /**
       
  1633 @SYMTestCaseID BA-CTSY-ACL-MSACLSS-0002
       
  1634 @SYMComponent  telephony_ctsy
       
  1635 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::SetAPNControlListServiceStatus
       
  1636 @SYMTestPriority High
       
  1637 @SYMTestActions Invokes cancelling of RMobilePhone::SetAPNControlListServiceStatus
       
  1638 @SYMTestExpectedResults Pass
       
  1639 @SYMTestType CT
       
  1640 */
       
  1641 void CCTsyAPNControlListFU::TestSetAPNControlListServiceStatus0002L()
       
  1642 	{
       
  1643 
       
  1644 // This test should test cancellation of SetAPNControlListServiceStatus
       
  1645 // If this API does not have a cancel, the test step should be completely removed.
       
  1646 
       
  1647 	OpenEtelServerL(EUseExtendedError);
       
  1648 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1649 	OpenPhoneL();
       
  1650 
       
  1651 	TRequestStatus mockLtsyStatus;
       
  1652 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1653 
       
  1654 	RBuf8 dataExpect;
       
  1655 	CleanupClosePushL(dataExpect);
       
  1656 	
       
  1657 	// data for SetAPNControlListServiceStatus() itself
       
  1658 	TRequestStatus reqStatus;
       
  1659 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1660 	apnControlListServiceStatus = RMobilePhone::EAPNControlListServiceEnabled;
       
  1661 	
       
  1662 	// data for ExpectL
       
  1663 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnControlListServiceStatus);
       
  1664 	ltsyData.SerialiseL(dataExpect);
       
  1665 	
       
  1666 	//-------------------------------------------------------------------------
       
  1667 	// Test cancelling of RMobilePhone::SetAPNControlListServiceStatus
       
  1668  	//-------------------------------------------------------------------------
       
  1669  	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect);
       
  1670 	iMockLTSY.CompleteL(EMobilePhoneSetAPNControlListServiceStatus, KErrNone, 10);
       
  1671 	
       
  1672 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1673 	//cancel reguest
       
  1674 	iPhone.CancelAsyncRequest(EMobilePhoneSetAPNControlListServiceStatus);	
       
  1675 	
       
  1676 	User::WaitForRequest(reqStatus);
       
  1677 	ASSERT_EQUALS(KErrCancel, reqStatus.Int()); 
       
  1678 	
       
  1679 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1680 	User::WaitForRequest(mockLtsyStatus);
       
  1681 	
       
  1682 	AssertMockLtsyStatusL();	
       
  1683 	CleanupStack::PopAndDestroy(2); // dataExpect, this	
       
  1684 	}
       
  1685 
       
  1686 
       
  1687 /**
       
  1688 @SYMTestCaseID BA-CTSY-ACL-MSACLSS-0003
       
  1689 @SYMComponent  telephony_ctsy
       
  1690 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetAPNControlListServiceStatus with bad parameter data
       
  1691 @SYMTestPriority High
       
  1692 @SYMTestActions Invokes RMobilePhone::SetAPNControlListServiceStatus with bad parameter data
       
  1693 @SYMTestExpectedResults Pass
       
  1694 @SYMTestType CT
       
  1695 */
       
  1696 void CCTsyAPNControlListFU::TestSetAPNControlListServiceStatus0003L()
       
  1697 	{
       
  1698 
       
  1699 // This test should test sending bad parameter data for SetAPNControlListServiceStatus
       
  1700 // If this API does not have any parameters, then remove this test completely.
       
  1701 
       
  1702 	OpenEtelServerL(EUseExtendedError);
       
  1703 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1704 	OpenPhoneL();
       
  1705 
       
  1706 	RBuf8 dataExpect;
       
  1707 	CleanupClosePushL(dataExpect);
       
  1708 
       
  1709 	//-------------------------------------------------------------------------
       
  1710 	// Test C: Test passing out of bounds parameters to
       
  1711 	// RMobilePhone::SetAPNControlListServiceStatus
       
  1712  	//------------------------------------------------------------------------- 	
       
  1713  	// data for SetAPNControlListServiceStatus() itself
       
  1714 	TRequestStatus reqStatus;
       
  1715 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;	
       
  1716 	// wrong value
       
  1717 	apnControlListServiceStatus = (RMobilePhone::TAPNControlListServiceStatus) -1;
       
  1718 	
       
  1719 	// data for ExpectL
       
  1720 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnControlListServiceStatus);
       
  1721 	ltsyData.SerialiseL(dataExpect);
       
  1722 	
       
  1723 	
       
  1724 	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect);
       
  1725 	iMockLTSY.CompleteL(EMobilePhoneSetAPNControlListServiceStatus, KErrNone);
       
  1726 	
       
  1727 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1728 	
       
  1729 	User::WaitForRequest(reqStatus);
       
  1730 	// there is no checking of passing parameters in CTSY,
       
  1731 	// but CTSY doesn't use passing parameters, it just sent it to LTSY
       
  1732 	// so, I think, it isn't defect	
       
  1733 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1734 	AssertMockLtsyStatusL();	
       
  1735 
       
  1736 	// Done !
       
  1737 	CleanupStack::PopAndDestroy(2, this); // dataExpect, this
       
  1738 
       
  1739 	}
       
  1740 
       
  1741 
       
  1742 /**
       
  1743 @SYMTestCaseID BA-CTSY-ACL-MSACLSS-0004
       
  1744 @SYMComponent  telephony_ctsy
       
  1745 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::SetAPNControlListServiceStatus
       
  1746 @SYMTestPriority High
       
  1747 @SYMTestActions Invokes multiple client requests to RMobilePhone::SetAPNControlListServiceStatus
       
  1748 @SYMTestExpectedResults Pass
       
  1749 @SYMTestType CT
       
  1750 */
       
  1751 void CCTsyAPNControlListFU::TestSetAPNControlListServiceStatus0004L()
       
  1752 	{
       
  1753 					
       
  1754 	OpenEtelServerL(EUseExtendedError);
       
  1755 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1756 	OpenPhoneL();
       
  1757 
       
  1758 	RBuf8 dataExpect;
       
  1759 	CleanupClosePushL(dataExpect);	
       
  1760 
       
  1761 	// Open second client
       
  1762 	RTelServer telServer2;
       
  1763 	TInt ret = telServer2.Connect();
       
  1764 	ASSERT_EQUALS(KErrNone, ret);
       
  1765 	CleanupClosePushL(telServer2);
       
  1766 
       
  1767 	RMobilePhone phone2;
       
  1768 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1769 	ASSERT_EQUALS(KErrNone, ret);
       
  1770 	CleanupClosePushL(phone2);	
       
  1771 	
       
  1772 	// data for the first SetAPNControlListServiceStatus() 
       
  1773 	TRequestStatus reqStatus;
       
  1774 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1775 	apnControlListServiceStatus = RMobilePhone::EAPNControlListServiceEnabled;
       
  1776 	
       
  1777 	// data for the second SetAPNControlListServiceStatus() 
       
  1778 	TRequestStatus reqStatus2;
       
  1779 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus2;
       
  1780 	apnControlListServiceStatus2 = RMobilePhone::EAPNControlListServiceDisabled;
       
  1781 	
       
  1782 	// data for ExpectL
       
  1783 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnControlListServiceStatus);
       
  1784 	ltsyData.SerialiseL(dataExpect);
       
  1785 
       
  1786 	//-------------------------------------------------------------------------
       
  1787 	// Test A: Test multiple clients requesting RMobilePhone::SetAPNControlListServiceStatus
       
  1788  	//-------------------------------------------------------------------------
       
  1789  	
       
  1790  	// send first request
       
  1791  	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect);
       
  1792 	iMockLTSY.CompleteL(EMobilePhoneSetAPNControlListServiceStatus, KErrNone);	
       
  1793 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1794 	
       
  1795 	
       
  1796 	// send second request
       
  1797 	phone2.SetAPNControlListServiceStatus(reqStatus2, apnControlListServiceStatus2);	
       
  1798 	
       
  1799 	//wait for the first answer
       
  1800 	User::WaitForRequest(reqStatus);
       
  1801 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1802 	
       
  1803 	//wait for the second answer
       
  1804 	User::WaitForRequest(reqStatus2);
       
  1805 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int()); 
       
  1806 		
       
  1807 	AssertMockLtsyStatusL();
       
  1808 	// Done !
       
  1809 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, dataExpect, this
       
  1810 
       
  1811 	}
       
  1812 
       
  1813 
       
  1814 /**
       
  1815 @SYMTestCaseID BA-CTSY-ACL-MSACLSS-0005
       
  1816 @SYMComponent  telephony_ctsy
       
  1817 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetAPNControlListServiceStatus with timeout
       
  1818 @SYMTestPriority High
       
  1819 @SYMTestActions Invokes RMobilePhone::SetAPNControlListServiceStatus and tests for timeout
       
  1820 @SYMTestExpectedResults Pass
       
  1821 @SYMTestType CT
       
  1822 */
       
  1823 void CCTsyAPNControlListFU::TestSetAPNControlListServiceStatus0005L()
       
  1824 	{
       
  1825 
       
  1826 	OpenEtelServerL(EUseExtendedError);
       
  1827 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1828 	OpenPhoneL();
       
  1829 
       
  1830 	RBuf8 dataExpect;
       
  1831 	CleanupClosePushL(dataExpect);
       
  1832 	
       
  1833 	// data for SetAPNControlListServiceStatus() itself
       
  1834 	TRequestStatus reqStatus;
       
  1835 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
       
  1836 	apnControlListServiceStatus = RMobilePhone::EAPNControlListServiceEnabled;
       
  1837 	
       
  1838 	// data for ExpectL
       
  1839 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnControlListServiceStatus);
       
  1840 	ltsyData.SerialiseL(dataExpect);	
       
  1841 
       
  1842 	//-------------------------------------------------------------------------
       
  1843 	// Test A: Test timeout of RMobilePhone::SetAPNControlListServiceStatus
       
  1844  	//-------------------------------------------------------------------------
       
  1845 	iMockLTSY.ExpectL(EMobilePhoneSetAPNControlListServiceStatus, dataExpect);
       
  1846 	
       
  1847 	iPhone.SetAPNControlListServiceStatus(reqStatus, apnControlListServiceStatus);
       
  1848 	User::WaitForRequest(reqStatus);
       
  1849 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int()); 
       
  1850 	
       
  1851 	AssertMockLtsyStatusL();
       
  1852 	// Done !
       
  1853 	CleanupStack::PopAndDestroy(2, this); // dataExpect, this
       
  1854 
       
  1855 	}
       
  1856 
       
  1857 
       
  1858 /**
       
  1859 @SYMTestCaseID BA-CTSY-ACL-MNACLSSC-0001
       
  1860 @SYMComponent  telephony_ctsy
       
  1861 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1862 @SYMTestPriority High
       
  1863 @SYMTestActions Invokes RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1864 @SYMTestExpectedResults Pass
       
  1865 @SYMTestType CT
       
  1866 */
       
  1867 void CCTsyAPNControlListFU::TestNotifyAPNControlListServiceStatusChange0001L()
       
  1868 	{
       
  1869 
       
  1870 	OpenEtelServerL(EUseExtendedError);
       
  1871 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1872 	OpenPhoneL();
       
  1873 
       
  1874 	RBuf8 dataComplete;
       
  1875 	CleanupClosePushL(dataComplete);	
       
  1876 	
       
  1877 	// data for CompleteL
       
  1878 	RMobilePhone::TAPNControlListServiceStatus apnStatusComplete = RMobilePhone::EAPNControlListServiceEnabled;
       
  1879 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnStatusComplete);
       
  1880 	ltsyData.SerialiseL(dataComplete);	
       
  1881 	
       
  1882 	// data for NotifyAPNControlListServiceStatusChange
       
  1883 	TRequestStatus reqStatus;
       
  1884 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;	
       
  1885 	
       
  1886 	//-------------------------------------------------------------------------
       
  1887 	// TEST E: Unsolicited completion of RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1888 	// from LTSY. 
       
  1889  	//-------------------------------------------------------------------------
       
  1890 	TRequestStatus mockLtsyStatus;
       
  1891 	iMockLTSY.NotifyTerminated(mockLtsyStatus); 
       
  1892  	// Issue the Complete...	
       
  1893 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNControlListServiceStatusChange, KErrNone, dataComplete);
       
  1894 	// wait for completion 
       
  1895 	User::WaitForRequest(mockLtsyStatus);
       
  1896 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1897 	AssertMockLtsyStatusL();		
       
  1898 	
       
  1899  	//-------------------------------------------------------------------------
       
  1900 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  1901  	//-------------------------------------------------------------------------
       
  1902 	iPhone.NotifyAPNControlListServiceStatusChange (reqStatus, apnControlListServiceStatus);
       
  1903 	
       
  1904 	// send completion 
       
  1905 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNControlListServiceStatusChange, KErrGeneral, dataComplete);
       
  1906 	
       
  1907 	User::WaitForRequest(reqStatus);
       
  1908 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int()); 
       
  1909 	AssertMockLtsyStatusL();
       
  1910 
       
  1911  	//-------------------------------------------------------------------------
       
  1912 	// TEST C: Successful completion request of
       
  1913 	// RMobilePhone::NotifyAPNControlListServiceStatusChange when result is not cached.
       
  1914  	//-------------------------------------------------------------------------
       
  1915 	iPhone.NotifyAPNControlListServiceStatusChange (reqStatus, apnControlListServiceStatus);
       
  1916 	
       
  1917 	// send completion 
       
  1918 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNControlListServiceStatusChange, KErrNone, dataComplete);
       
  1919 		
       
  1920 	User::WaitForRequest(reqStatus);
       
  1921 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  1922 	ASSERT_EQUALS(apnStatusComplete, apnControlListServiceStatus); 		
       
  1923 
       
  1924 	AssertMockLtsyStatusL();
       
  1925 	CleanupStack::PopAndDestroy(2, this); // dataComplete, this		
       
  1926 	}
       
  1927 
       
  1928 
       
  1929 /**
       
  1930 @SYMTestCaseID BA-CTSY-ACL-MNACLSSC-0002
       
  1931 @SYMComponent  telephony_ctsy
       
  1932 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1933 @SYMTestPriority High
       
  1934 @SYMTestActions Invokes cancelling of RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1935 @SYMTestExpectedResults Pass
       
  1936 @SYMTestType CT
       
  1937 */
       
  1938 void CCTsyAPNControlListFU::TestNotifyAPNControlListServiceStatusChange0002L()
       
  1939 	{
       
  1940 
       
  1941 // This test should test cancellation of NotifyAPNControlListServiceStatusChange
       
  1942 // If this API does not have a cancel, the test step should be completely removed.
       
  1943 
       
  1944 	OpenEtelServerL(EUseExtendedError);
       
  1945 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1946 	OpenPhoneL();
       
  1947 
       
  1948 	TRequestStatus mockLtsyStatus;
       
  1949 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1950 
       
  1951 	RBuf8 dataComplete;
       
  1952 	CleanupClosePushL(dataComplete);	
       
  1953 	
       
  1954 	// data for CompleteL
       
  1955 	RMobilePhone::TAPNControlListServiceStatus apnStatusComplete = RMobilePhone::EAPNControlListServiceEnabled;
       
  1956 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnStatusComplete);
       
  1957 	ltsyData.SerialiseL(dataComplete);	
       
  1958 	
       
  1959 	// data for NotifyAPNControlListServiceStatusChange
       
  1960 	TRequestStatus reqStatus;
       
  1961 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;	
       
  1962 
       
  1963  	//-------------------------------------------------------------------------
       
  1964 	// Test cancelling of RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1965  	//-------------------------------------------------------------------------
       
  1966  	iPhone.NotifyAPNControlListServiceStatusChange (reqStatus, apnControlListServiceStatus);	
       
  1967 	// send completion 
       
  1968 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNControlListServiceStatusChange, KErrNone, dataComplete, 10);
       
  1969 		
       
  1970 	// cancel request
       
  1971 	iPhone.CancelAsyncRequest(EMobilePhoneNotifyAPNControlListServiceStatusChange);
       
  1972 			
       
  1973 	User::WaitForRequest(reqStatus);
       
  1974 	ASSERT_EQUALS(KErrCancel, reqStatus.Int()); 				
       
  1975  	
       
  1976 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1977 	User::WaitForRequest(mockLtsyStatus);
       
  1978 	
       
  1979 	AssertMockLtsyStatusL();
       
  1980 	CleanupStack::PopAndDestroy(2); // dataComplete, this	
       
  1981 	}
       
  1982 
       
  1983 
       
  1984 /**
       
  1985 @SYMTestCaseID BA-CTSY-ACL-MNACLSSC-0004
       
  1986 @SYMComponent  telephony_ctsy
       
  1987 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1988 @SYMTestPriority High
       
  1989 @SYMTestActions Invokes multiple client requests to RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1990 @SYMTestExpectedResults Pass
       
  1991 @SYMTestType CT
       
  1992 */
       
  1993 void CCTsyAPNControlListFU::TestNotifyAPNControlListServiceStatusChange0004L()
       
  1994 	{
       
  1995 					
       
  1996 	OpenEtelServerL(EUseExtendedError);
       
  1997 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1998 	OpenPhoneL();
       
  1999 
       
  2000 	RBuf8 dataComplete;
       
  2001 	CleanupClosePushL(dataComplete);		
       
  2002 
       
  2003 	// Open second client
       
  2004 	RTelServer telServer2;
       
  2005 	TInt ret = telServer2.Connect();
       
  2006 	ASSERT_EQUALS(KErrNone, ret);
       
  2007 	CleanupClosePushL(telServer2);
       
  2008 
       
  2009 	RMobilePhone phone2;
       
  2010 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  2011 	ASSERT_EQUALS(KErrNone, ret);
       
  2012 	CleanupClosePushL(phone2);
       
  2013 	
       
  2014 	
       
  2015 	// data for CompleteL
       
  2016 	RMobilePhone::TAPNControlListServiceStatus apnStatusComplete = RMobilePhone::EAPNControlListServiceEnabled;
       
  2017 	TMockLtsyData1<RMobilePhone::TAPNControlListServiceStatus> ltsyData(apnStatusComplete);
       
  2018 	ltsyData.SerialiseL(dataComplete);	
       
  2019 	
       
  2020 	// data for the first NotifyAPNControlListServiceStatusChange
       
  2021 	TRequestStatus reqStatus;
       
  2022 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;	
       
  2023 	
       
  2024 	// data for the second NotifyAPNControlListServiceStatusChange
       
  2025 	TRequestStatus reqStatus2;
       
  2026 	RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus2;
       
  2027 
       
  2028 	//-------------------------------------------------------------------------
       
  2029 	// Test A: Test multiple clients requesting RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  2030  	//-------------------------------------------------------------------------
       
  2031  	
       
  2032  	// send first reques
       
  2033  	iPhone.NotifyAPNControlListServiceStatusChange (reqStatus, apnControlListServiceStatus);
       
  2034  	
       
  2035  	// send second reques
       
  2036  	phone2.NotifyAPNControlListServiceStatusChange (reqStatus2, apnControlListServiceStatus2);
       
  2037 	
       
  2038 	// send completion 
       
  2039 	iMockLTSY.CompleteL(EMobilePhoneNotifyAPNControlListServiceStatusChange, KErrNone, dataComplete);
       
  2040 		
       
  2041 	// wait for the first answer	
       
  2042 	User::WaitForRequest(reqStatus);
       
  2043 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  2044 	ASSERT_EQUALS(apnStatusComplete, apnControlListServiceStatus); 	
       
  2045 	
       
  2046 	// wait for the second answer	
       
  2047 	User::WaitForRequest(reqStatus);
       
  2048 	ASSERT_EQUALS(KErrNone, reqStatus.Int()); 
       
  2049 	ASSERT_EQUALS(apnStatusComplete, apnControlListServiceStatus); 
       
  2050 		
       
  2051 
       
  2052 	AssertMockLtsyStatusL();
       
  2053 	// Done !
       
  2054 	CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, dataComplete, this
       
  2055 
       
  2056 	}
       
  2057