telephonyserverplugins/simatktsy/tests/src/ccsatrefreshfu.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file The TEFUnit test suite for Refresh in the SAT.
       
    20 */
       
    21 
       
    22 #include <cstktsy/bertlv_defs.h>
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <etelsat.h>
       
    26 #include <ctsy/serviceapi/gsmerror.h>
       
    27 #include <ctsy/mmtsy_names.h>
       
    28 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    29 #include <satcs.h>
       
    30 #include <ctsy/ltsy/sat_defs.h>
       
    31 #include <cstktsy/ttlv.h>
       
    32 
       
    33 
       
    34 #include <ctsy/ltsy/mltsydispatchsatinterface.h>
       
    35 #include <ctsy/ltsy/mltsydispatchphoneinterface.h> 
       
    36 #include <test/mockltsyindicatorids.h>
       
    37 
       
    38 #include <test/tmockltsydata.h>
       
    39 #include "ccsatrefreshfu.h"
       
    40 
       
    41 // ICC file identifier
       
    42 _LIT8(KICCID_file, "\x2F\xE2");	
       
    43 _LIT16(KICCID16, "\x2FE2");
       
    44 _LIT8(KAID, "123");
       
    45 const TInt KDelay = 10;
       
    46 
       
    47 CTestSuite* CCSatRefreshFU::CreateSuiteL(const TDesC& aName)
       
    48 	{
       
    49 	SUB_SUITE;
       
    50 
       
    51 	ADD_TEST_STEP_ISO_CPP(CCSatRefreshFU, TestNotifyRefreshPCmd0001L);
       
    52 	ADD_TEST_STEP_ISO_CPP(CCSatRefreshFU, TestNotifyRefreshPCmd0002L);
       
    53 	ADD_TEST_STEP_ISO_CPP(CCSatRefreshFU, TestNotifyRefreshPCmd0004L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCSatRefreshFU, TestNotifyRefreshPCmd0001bL);
       
    55 
       
    56 	END_SUITE;
       
    57 	}
       
    58 
       
    59 
       
    60 //
       
    61 // Actual test cases
       
    62 //
       
    63 
       
    64 
       
    65 /**
       
    66 @SYMTestCaseID BA-CSAT-RF-SNRFPC-0001
       
    67 @SYMPREQ 1780
       
    68 @SYMComponent  telephony_csat
       
    69 @SYMTestCaseDesc Test support in CSAT for RSat::NotifyRefreshPCmd
       
    70 @SYMTestPriority High
       
    71 @SYMTestActions Invokes RSat::NotifyRefreshPCmd
       
    72 @SYMTestExpectedResults Pass
       
    73 @SYMTestType CT
       
    74 */
       
    75 void CCSatRefreshFU::TestNotifyRefreshPCmd0001L()
       
    76 	{
       
    77 	OpenEtelServerL(EUseExtendedError);
       
    78 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
    79 	OpenPhoneL();
       
    80 	OpenSatL();	
       
    81 	
       
    82 	RBuf8 data;
       
    83 	CleanupClosePushL(data);
       
    84 
       
    85 	TUint8 KPCmdNumber = 1;
       
    86 
       
    87 	TTlv tlv;
       
    88 	PrepareTlv( tlv, KPCmdNumber, KFileChangeNotification);
       
    89 	TPtrC8 tlvDsc = tlv.End();
       
    90 	TDesC8* tlvDscPtr = &tlvDsc;
       
    91 	TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr);
       
    92 
       
    93 	TRequestStatus refreshStatus;
       
    94 	TRequestStatus refreshRequiredStatus;
       
    95 	RSat::TRefreshV2 refresh;
       
    96 	RSat::TRefreshV2Pckg refreshPck(refresh);
       
    97 	RSat::TRefreshV2 refreshRequired;
       
    98 	RSat::TRefreshV2Pckg refreshRequiredPck(refreshRequired);
       
    99 	
       
   100 	// test C
       
   101 	// calling both NotifyRefreshRequired() and NotifyRefreshPCmd(), 
       
   102 	// then completing NotifyRefreshRequired
       
   103 	// and then completing NotifyRefreshPCmd through using RefreshAllowed()
       
   104 	// making terminalResponse in the end
       
   105 	// Other test C variants implemented in TestNotifyRefreshPCmd0001bL()
       
   106 
       
   107 	PrepareRefreshDispatchL();
       
   108 
       
   109 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   110 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   111 
       
   112 	CompleteRefreshDispatchL( tlv.End() );
       
   113 	
       
   114 	User::WaitForRequest(refreshRequiredStatus);
       
   115 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   116 	ASSERT_EQUALS(RSat::EFileChangeNotification, refreshRequired.iType);
       
   117 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   118 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));
       
   119 
       
   120 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
       
   121 	
       
   122 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   123 	
       
   124 	User::WaitForRequest(refreshStatus);
       
   125 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   126 	ASSERT_EQUALS(RSat::EFileChangeNotification, refresh.iType);
       
   127 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   128 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
       
   129 	AssertMockLtsyStatusL();
       
   130 
       
   131 	//terminal response	
       
   132 	RSat::TRefreshRspV1 refreshTerminalRsp;
       
   133 	RSat::TRefreshRspV1Pckg refreshTerminalRspPckg(refreshTerminalRsp);
       
   134 	refreshTerminalRsp.SetPCmdNumber(KPCmdNumber);
       
   135 	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
       
   136 	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   137 	refreshTerminalRsp.iAdditionalInfo = KNullDesC;
       
   138 	
       
   139 	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KFileChangeNotification,
       
   140 			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
       
   141 			refreshTerminalRsp.iGeneralResult);
       
   142 	
       
   143 	AssertMockLtsyStatusL();
       
   144 
       
   145 	// test B, for RefreshAllowed
       
   146 
       
   147 	PrepareRefreshDispatchL();
       
   148 
       
   149 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   150 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   151 
       
   152 	CompleteRefreshDispatchL( tlv.End() );
       
   153 	
       
   154 	User::WaitForRequest(refreshRequiredStatus);
       
   155 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   156 	ASSERT_EQUALS(RSat::EFileChangeNotification, refreshRequired.iType);
       
   157 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   158 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));
       
   159 
       
   160 	refreshTerminalRsp.iGeneralResult = RSat::KMeUnableToProcessCmd;
       
   161 	refreshTerminalRsp.iInfoType = RSat::KMeProblem;	
       
   162 	refreshTerminalRsp.iAdditionalInfo.Zero();
       
   163 	refreshTerminalRsp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);;
       
   164 
       
   165 	PrepareTerminalResponseMockDataL( KPCmdNumber, KRefresh, KFileChangeNotification,
       
   166 			refreshTerminalRsp.iAdditionalInfo, refreshTerminalRsp.iGeneralResult, KNullDesC8);
       
   167 	
       
   168 	PrepareAndCallRefreshAllowedL(RSat::KMeUnableToProcessCmd);
       
   169 	
       
   170 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
       
   171 	
       
   172 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   173 	
       
   174 	User::WaitForRequest(refreshStatus);
       
   175 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   176 	ASSERT_EQUALS(RSat::EFileChangeNotification, refresh.iType);
       
   177 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   178 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
       
   179 	AssertMockLtsyStatusL();
       
   180 	
       
   181 	// test B, for NotifyRefreshRequired
       
   182 
       
   183 	PrepareRefreshDispatchL();
       
   184 
       
   185 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   186 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   187 
       
   188 	CompleteRefreshDispatchL( tlv.End(), KErrGeneral );
       
   189 
       
   190 	User::WaitForRequest(refreshRequiredStatus);
       
   191 	ASSERT_EQUALS(KErrGeneral, refreshRequiredStatus.Int());
       
   192 
       
   193 	AssertMockLtsyStatusL();
       
   194 	
       
   195 	// test E1	- Unsolicited completion, calling CSatNotifyRefresh::CompleteNotifyL() 		
       
   196 		
       
   197 	TRequestStatus requestStatus;
       
   198 	iMockLTSY.NotifyTerminated(requestStatus);	    
       
   199 	tlvDscPack.SerialiseL(data);
       
   200 	iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, KErrNone, data, KDelay);
       
   201 	data.Close();
       
   202 	
       
   203 	refreshTerminalRsp.iGeneralResult = RSat::KMeUnableToProcessCmd;
       
   204 	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   205 	refreshTerminalRsp.iAdditionalInfo.Zero();
       
   206 	refreshTerminalRsp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);;
       
   207 
       
   208 	PrepareTerminalResponseMockDataL( KPCmdNumber, KRefresh, KFileChangeNotification,
       
   209 			refreshTerminalRsp.iAdditionalInfo, refreshTerminalRsp.iGeneralResult, KNullDesC8);
       
   210 
       
   211 	User::WaitForRequest(requestStatus);
       
   212 	AssertMockLtsyStatusL();
       
   213 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   214 		
       
   215 	// test E2, calling CSatNotifyRefresh::CompleteRequest() 	
       
   216 	
       
   217 	iMockLTSY.NotifyTerminated(requestStatus);	    
       
   218 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId, KErrNone, KNullDesC8, KDelay);
       
   219 
       
   220 	User::WaitForRequest(requestStatus);
       
   221 	AssertMockLtsyStatusL();
       
   222 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   223 	
       
   224 	AssertMockLtsyStatusL();	
       
   225 	
       
   226 	//File Change Notification with no files in a filelist
       
   227 	
       
   228 	tlv.Begin(KBerTlvProactiveSimCommandTag);
       
   229 	tlv.AddTag(KTlvCommandDetailsTag);
       
   230 	tlv.AddByte(KPCmdNumber);//ETLV_CommandNumber
       
   231 	tlv.AddByte(KRefresh); //ETLV_TypeOfCommand
       
   232 	tlv.AddByte(KFileChangeNotification); //ETLV_CommandQualifier
       
   233 	tlv.AddTag(KTlvDeviceIdentityTag); 
       
   234 	tlv.AddByte(KSim); //ETLV_SourceDeviceIdentity
       
   235 	tlv.AddByte(KMe); //ETLV_DestinationDeviceIdentity
       
   236 		
       
   237 	PrepareRefreshDispatchL();
       
   238 
       
   239 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   240 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   241 
       
   242 	CompleteRefreshDispatchL( tlv.End() );
       
   243 	
       
   244 	refreshTerminalRsp.SetPCmdNumber(KPCmdNumber);
       
   245 	refreshTerminalRsp.iGeneralResult = RSat::KErrorRequiredValuesMissing;
       
   246 	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   247 	refreshTerminalRsp.iAdditionalInfo.Zero();
       
   248 
       
   249 	PrepareTerminalResponseMockDataL( KPCmdNumber, KRefresh, KFileChangeNotification,
       
   250 			refreshTerminalRsp.iAdditionalInfo, refreshTerminalRsp.iGeneralResult, KNullDesC8);
       
   251 		
       
   252 	User::WaitForRequest(refreshRequiredStatus);
       
   253 	ASSERT_EQUALS(KErrCorrupt, refreshRequiredStatus.Int());	
       
   254 	
       
   255 	AssertMockLtsyStatusL();		
       
   256 	
       
   257 	CleanupStack::PopAndDestroy(2, this); 	// data, this
       
   258 	}
       
   259 
       
   260 
       
   261 /**
       
   262 @SYMTestCaseID BA-CSAT-RF-SNRFPC-0002
       
   263 @SYMPREQ 1780
       
   264 @SYMComponent  telephony_csat
       
   265 @SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifyRefreshPCmd
       
   266 @SYMTestPriority High
       
   267 @SYMTestActions Invokes cancelling of RSat::NotifyRefreshPCmd
       
   268 @SYMTestExpectedResults Pass
       
   269 @SYMTestType CT
       
   270 */
       
   271 void CCSatRefreshFU::TestNotifyRefreshPCmd0002L()
       
   272 	{
       
   273 	OpenEtelServerL(EUseExtendedError);
       
   274 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   275 	OpenPhoneL();
       
   276 	OpenSatL();	
       
   277 	
       
   278 	PrepareRefreshDispatchL();
       
   279 	
       
   280 	RSat::TRefreshV2 refresh;
       
   281 	RSat::TRefreshV2Pckg refreshPck(refresh);
       
   282 	TRequestStatus refreshStatus;
       
   283 	TRequestStatus refreshRequiredStatus;
       
   284 
       
   285 	RSat::TRefreshV2 refreshRequired;
       
   286 	RSat::TRefreshV2Pckg refreshRequiredPck(refreshRequired);
       
   287 
       
   288 	// cancelling requests
       
   289 	
       
   290 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   291 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   292 	
       
   293 	iSat.CancelAsyncRequest(ESatNotifyRefreshRequiredParam);
       
   294 
       
   295 	User::WaitForRequest(refreshRequiredStatus);
       
   296 	ASSERT_EQUALS( KErrCancel, refreshRequiredStatus.Int());
       
   297 
       
   298 	iSat.CancelAsyncRequest(ESatNotifyRefreshPCmd);
       
   299 
       
   300 	User::WaitForRequest(refreshStatus);
       
   301 	ASSERT_EQUALS( KErrCancel, refreshStatus.Int());
       
   302 
       
   303 	AssertMockLtsyStatusL();
       
   304 	CleanupStack::PopAndDestroy(1, this); 
       
   305 	}
       
   306 
       
   307 
       
   308 /**
       
   309 @SYMTestCaseID BA-CSAT-RF-SNRFPC-0004
       
   310 @SYMPREQ 1780
       
   311 @SYMComponent  telephony_csat
       
   312 @SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifyRefreshPCmd
       
   313 @SYMTestPriority High
       
   314 @SYMTestActions Invokes multiple client requests to RSat::NotifyRefreshPCmd
       
   315 @SYMTestExpectedResults Pass
       
   316 @SYMTestType CT
       
   317 */
       
   318 void CCSatRefreshFU::TestNotifyRefreshPCmd0004L()
       
   319 	{
       
   320 	OpenEtelServerL(EUseExtendedError);
       
   321 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   322 	OpenPhoneL();
       
   323 	OpenSatL();
       
   324 
       
   325 	// Open second client
       
   326 	RTelServer telServer2;
       
   327 	TInt ret = telServer2.Connect();
       
   328 	ASSERT_EQUALS(KErrNone, ret);
       
   329 	CleanupClosePushL(telServer2);
       
   330 	
       
   331 	RMobilePhone phone2;
       
   332 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
   333 	ASSERT_EQUALS(KErrNone, ret);
       
   334 	CleanupClosePushL(phone2);
       
   335 	
       
   336 	RSat sat2;	
       
   337 	ret = sat2.Open(phone2);
       
   338 	ASSERT_EQUALS(KErrNone, ret);
       
   339 	CleanupClosePushL(sat2);
       
   340 	
       
   341 	TUint8 KPCmdNumber = 2;
       
   342 
       
   343 	TTlv tlv;
       
   344 	PrepareTlv( tlv, KPCmdNumber, KFileChangeNotification);
       
   345 
       
   346 	TRequestStatus refreshStatus;
       
   347 	TRequestStatus refreshRequiredStatus;
       
   348 	RSat::TRefreshV2 refresh;
       
   349 	RSat::TRefreshV2Pckg refreshPck(refresh);
       
   350 	RSat::TRefreshV2 refreshRequired;
       
   351 	RSat::TRefreshV2Pckg refreshRequiredPck(refreshRequired);
       
   352 
       
   353 	PrepareRefreshDispatchL();
       
   354 	
       
   355 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   356 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   357 
       
   358 	CompleteRefreshDispatchL( tlv.End() );
       
   359 	
       
   360 	TRequestStatus refreshStatus2;
       
   361 	RSat::TRefreshV2 refresh2;
       
   362 	RSat::TRefreshV2Pckg refreshPck2(refresh2);
       
   363 	
       
   364 	// only one client should call NotifyRefreshRequired(), others just call NotifyRefreshPCmd()
       
   365 	sat2.NotifyRefreshPCmd(refreshStatus2, refreshPck2);
       
   366 	
       
   367 	User::WaitForRequest(refreshRequiredStatus);
       
   368 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   369 	ASSERT_EQUALS(RSat::EFileChangeNotification, refreshRequired.iType);
       
   370 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   371 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));
       
   372 
       
   373 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
       
   374 		
       
   375 	// should be enough for all clients
       
   376 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   377 	
       
   378 	// first client
       
   379 	User::WaitForRequest(refreshStatus);
       
   380 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   381 	ASSERT_EQUALS(RSat::EFileChangeNotification, refresh.iType);
       
   382 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   383 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
       
   384 	AssertMockLtsyStatusL();
       
   385 	
       
   386 	// second client	
       
   387 	User::WaitForRequest(refreshStatus2);
       
   388 	ASSERT_EQUALS(KErrNone, refreshStatus2.Int());
       
   389 	ASSERT_EQUALS(RSat::EFileChangeNotification, refresh2.iType);
       
   390 	ASSERT_EQUALS(0, refresh2.iAid.Compare(KNullDesC8));
       
   391 	ASSERT_EQUALS(0, refresh2.iFileList.Compare(KICCID16));
       
   392 	AssertMockLtsyStatusL();
       
   393 
       
   394 	CleanupStack::PopAndDestroy(4, this); 	//sat2, phone2, telServer2, this
       
   395 	}
       
   396 
       
   397 
       
   398 /**
       
   399 @SYMTestCaseID BA-CSAT-RF-SNRFPC-0001b
       
   400 @SYMPREQ 1780
       
   401 @SYMComponent  telephony_csat
       
   402 @SYMTestCaseDesc additional test support in CSAT for RSat::NotifyRefreshPCmd 
       
   403 @SYMTestPriority High
       
   404 @SYMTestActions Invokes RSat::NotifyRefreshPCmd 
       
   405 @SYMTestExpectedResults Pass
       
   406 @SYMTestType CT
       
   407 */
       
   408 void CCSatRefreshFU::TestNotifyRefreshPCmd0001bL()
       
   409 	{
       
   410 	OpenEtelServerL(EUseExtendedError);
       
   411 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   412 	OpenPhoneL();
       
   413 	OpenSatL();
       
   414 
       
   415 	RBuf8 data;
       
   416 	CleanupClosePushL(data);
       
   417 	
       
   418 	//(REFRESH, SIM Initialization)
       
   419 
       
   420 	TUint8 KPCmdNumber = 1;
       
   421 
       
   422 	TTlv tlv;
       
   423 	
       
   424 	PrepareTlv( tlv, KPCmdNumber, KSimInit);
       
   425 	
       
   426 	TRequestStatus refreshStatus;
       
   427 	TRequestStatus refreshRequiredStatus;
       
   428 	RSat::TRefreshV2 refresh;
       
   429 	RSat::TRefreshV2Pckg refreshPck(refresh);
       
   430 	RSat::TRefreshV2 refreshRequired;
       
   431 	RSat::TRefreshV2Pckg refreshRequiredPck(refreshRequired);
       
   432 	
       
   433 	PrepareRefreshDispatchL();
       
   434 
       
   435 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   436 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   437 
       
   438 	CompleteRefreshDispatchL( tlv.End() );
       
   439 	
       
   440 	User::WaitForRequest(refreshRequiredStatus);
       
   441 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   442 	ASSERT_EQUALS(RSat::ESimInit, refreshRequired.iType);
       
   443 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   444 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));
       
   445 
       
   446 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
       
   447 	
       
   448 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   449 	
       
   450 	User::WaitForRequest(refreshStatus);
       
   451 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   452 	ASSERT_EQUALS(RSat::ESimInit, refresh.iType);
       
   453 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   454 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
       
   455 	AssertMockLtsyStatusL();	
       
   456 	
       
   457 	RSat::TRefreshRspV1 refreshTerminalRsp;
       
   458 	RSat::TRefreshRspV1Pckg refreshTerminalRspPckg(refreshTerminalRsp);
       
   459 	refreshTerminalRsp.SetPCmdNumber(KPCmdNumber);
       
   460 	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
       
   461 	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   462 	refreshTerminalRsp.iAdditionalInfo = KNullDesC;
       
   463 
       
   464 	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KSimInit,
       
   465 			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
       
   466 			refreshTerminalRsp.iGeneralResult);
       
   467 	
       
   468 	AssertMockLtsyStatusL();	
       
   469 
       
   470 	// completion of ESatTsyImsiChanged after terminal responce for full test coverage 	
       
   471 	TRequestStatus requestStatus;
       
   472 	iMockLTSY.NotifyTerminated(requestStatus);	    
       
   473 	iMockLTSY.CompleteL(KMockLtsyDispatchSatImsiChangedIndId, KErrNone, KDelay);
       
   474 	User::WaitForRequest(requestStatus);
       
   475 	AssertMockLtsyStatusL();
       
   476 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   477 	//(REFRESH, File Change Notification)
       
   478 
       
   479 	PrepareTlv( tlv, KPCmdNumber, KFileChangeNotification);
       
   480 		
       
   481 	PrepareRefreshDispatchL();
       
   482 
       
   483 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   484 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   485 
       
   486 	CompleteRefreshDispatchL( tlv.End() );
       
   487 	
       
   488 	User::WaitForRequest(refreshRequiredStatus);
       
   489 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   490 	ASSERT_EQUALS(RSat::EFileChangeNotification, refreshRequired.iType);
       
   491 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   492 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));
       
   493 
       
   494 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
       
   495 	
       
   496 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   497 	
       
   498 	User::WaitForRequest(refreshStatus);
       
   499 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   500 	ASSERT_EQUALS(RSat::EFileChangeNotification, refresh.iType);
       
   501 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   502 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
       
   503 	AssertMockLtsyStatusL();
       
   504 
       
   505 	refreshTerminalRsp.iGeneralResult = RSat::KMeUnableToProcessCmd;
       
   506 	refreshTerminalRsp.iInfoType = RSat::KMeProblem;	
       
   507 	refreshTerminalRsp.iAdditionalInfo.Zero();
       
   508 	refreshTerminalRsp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);;
       
   509 	
       
   510 	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KFileChangeNotification,
       
   511 			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
       
   512 			refreshTerminalRsp.iGeneralResult);
       
   513 	
       
   514 	AssertMockLtsyStatusL();	
       
   515 	
       
   516 	//(REFRESH, USIM Initialization and File Change Notification)
       
   517 
       
   518 	PrepareTlv( tlv, KPCmdNumber, KSimInitFileChangeNotification);
       
   519 		
       
   520 	PrepareRefreshDispatchL();
       
   521 
       
   522 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   523 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   524 
       
   525 	CompleteRefreshDispatchL( tlv.End() );
       
   526 	
       
   527 	User::WaitForRequest(refreshRequiredStatus);
       
   528 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   529 	ASSERT_EQUALS(RSat::ESimInitFileChangeNotification, refreshRequired.iType);
       
   530 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   531 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));
       
   532 
       
   533 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
       
   534 	
       
   535 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   536 	
       
   537 	User::WaitForRequest(refreshStatus);
       
   538 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   539 	ASSERT_EQUALS(RSat::ESimInitFileChangeNotification, refresh.iType);
       
   540 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   541 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
       
   542 	AssertMockLtsyStatusL();
       
   543 
       
   544 	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
       
   545 	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   546 	refreshTerminalRsp.iAdditionalInfo.Zero();
       
   547 	
       
   548 	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KSimInitFileChangeNotification,
       
   549 			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
       
   550 			refreshTerminalRsp.iGeneralResult);
       
   551 	
       
   552 	AssertMockLtsyStatusL();	
       
   553 	
       
   554 	//(REFRESH, USIM Initialization and Full File Change Notification)
       
   555 
       
   556 	PrepareTlv( tlv, KPCmdNumber, KSimInitFullFileChangeNotification);
       
   557 		
       
   558 	PrepareRefreshDispatchL();
       
   559 
       
   560 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   561 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   562 
       
   563 	CompleteRefreshDispatchL( tlv.End() );
       
   564 	
       
   565 	User::WaitForRequest(refreshRequiredStatus);
       
   566 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   567 	ASSERT_EQUALS(RSat::ESimInitFullFileChangeNotification, refreshRequired.iType);
       
   568 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   569 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));
       
   570 
       
   571 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
       
   572 	
       
   573 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   574 
       
   575 	// calling terminal responce through CSatNotifyRefresh::CompleteTerminalRespDataL
       
   576 	RSat::TAdditionalInfo additionalInfo(KNullDesC);
       
   577 	TDesC* addInfoPtr = &additionalInfo;
       
   578     RSat::TPCmdResult generalResult = RSat::KSuccess;
       
   579     TMockLtsyData2<RSat::TPCmdResult,TDesC*> refreshDataPck(generalResult,addInfoPtr);
       
   580     refreshDataPck.SerialiseL(data);	
       
   581 	iMockLTSY.CompleteL(KMockLtsyDispatchSatCreateRefreshTerminalRspIndId,KErrNone,data, KDelay);
       
   582 	data.Close();		
       
   583 		
       
   584 	PrepareTerminalResponseMockDataL( KPCmdNumber, KRefresh, KSimInitFullFileChangeNotification,
       
   585 			refreshTerminalRsp.iAdditionalInfo, refreshTerminalRsp.iGeneralResult, KNullDesC8);
       
   586 
       
   587 	User::WaitForRequest(refreshStatus);
       
   588 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   589 	ASSERT_EQUALS(RSat::ESimInitFullFileChangeNotification, refresh.iType);
       
   590 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   591 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
       
   592 	
       
   593 	AssertMockLtsyStatusL();	
       
   594 	
       
   595 	//(REFRESH, UICC Reset)
       
   596 
       
   597 	PrepareTlv( tlv, KPCmdNumber, KSimReset);
       
   598 		
       
   599 	PrepareRefreshDispatchL();
       
   600 
       
   601 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   602 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   603 
       
   604 	CompleteRefreshDispatchL( tlv.End() );
       
   605 	
       
   606 	User::WaitForRequest(refreshRequiredStatus);
       
   607 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   608 	ASSERT_EQUALS(RSat::ESimReset, refreshRequired.iType);
       
   609 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   610 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));
       
   611 
       
   612 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
       
   613 	
       
   614 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   615 	
       
   616 	User::WaitForRequest(refreshStatus);
       
   617 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   618 	ASSERT_EQUALS(RSat::ESimReset, refresh.iType);
       
   619 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   620 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
       
   621 	AssertMockLtsyStatusL();
       
   622 
       
   623 	// for refresh terminal response processed without calling ltsy 
       
   624 	TerminalResponseL( RSat::ERefresh, refreshTerminalRspPckg);
       
   625 	
       
   626 	AssertMockLtsyStatusL();	
       
   627 	
       
   628 	// IMSI refresh through SIM init
       
   629 	
       
   630 	PrepareTlv( tlv, KPCmdNumber, KSimInit);
       
   631 	
       
   632 	PrepareRefreshDispatchL();
       
   633 
       
   634 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   635 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   636 
       
   637 	CompleteRefreshDispatchL( tlv.End() );
       
   638 	
       
   639 	User::WaitForRequest(refreshRequiredStatus);
       
   640 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   641 	ASSERT_EQUALS(RSat::ESimInit, refreshRequired.iType);
       
   642 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   643 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));
       
   644 
       
   645 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
       
   646 	
       
   647 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   648 	
       
   649 	User::WaitForRequest(refreshStatus);
       
   650 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   651 	ASSERT_EQUALS(RSat::ESimInit, refresh.iType);
       
   652 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   653 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
       
   654 	AssertMockLtsyStatusL();
       
   655 
       
   656 	// completion of ESatTsyImsiChanged		
       
   657 	iMockLTSY.NotifyTerminated(requestStatus);	    
       
   658 	iMockLTSY.CompleteL(KMockLtsyDispatchSatImsiChangedIndId, KErrNone, KDelay);
       
   659 	User::WaitForRequest(requestStatus);
       
   660 	AssertMockLtsyStatusL();
       
   661 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   662 		
       
   663 	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
       
   664 	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   665 	refreshTerminalRsp.iAdditionalInfo = KNullDesC;
       
   666 
       
   667 	//SIM Init shall not be used if EFIMSI is changed, and TerminalResponse will not reach ltsy
       
   668 	TerminalResponseL( RSat::ERefresh, refreshTerminalRspPckg, KErrNone);	
       
   669 	
       
   670 	AssertMockLtsyStatusL();	
       
   671 	
       
   672 	//(REFRESH, USIM Application Reset)
       
   673 
       
   674 	PrepareTlv( tlv, KPCmdNumber, KUSIMApplicationReset);
       
   675 		
       
   676 	PrepareRefreshDispatchL();
       
   677 
       
   678 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   679 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   680 
       
   681 	CompleteRefreshDispatchL( tlv.End() );
       
   682 	
       
   683 	User::WaitForRequest(refreshRequiredStatus);
       
   684 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   685 	ASSERT_EQUALS(RSat::EUsimApplicationReset, refreshRequired.iType);
       
   686 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KAID));
       
   687 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));
       
   688 
       
   689 	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID, KNullDesC8, KAID);
       
   690 	
       
   691 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   692 	
       
   693 	User::WaitForRequest(refreshStatus);
       
   694 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   695 	ASSERT_EQUALS(RSat::EUsimApplicationReset, refresh.iType);
       
   696 	ASSERT_EQUALS(0, refresh.iAid.Compare(KAID));
       
   697 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
       
   698 	AssertMockLtsyStatusL();
       
   699 
       
   700 	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KUSIMApplicationReset,
       
   701 			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
       
   702 			refreshTerminalRsp.iGeneralResult);
       
   703 	
       
   704 	AssertMockLtsyStatusL();	
       
   705 	
       
   706 	// 3G session reset
       
   707 
       
   708 	PrepareTlv( tlv, KPCmdNumber, K3GSessionReset);
       
   709 		
       
   710 	PrepareRefreshDispatchL();
       
   711 
       
   712 	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
       
   713 	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);
       
   714 
       
   715 	CompleteRefreshDispatchL( tlv.End() );
       
   716 	
       
   717 	User::WaitForRequest(refreshRequiredStatus);
       
   718 	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
       
   719 	ASSERT_EQUALS(RSat::E3GSessionReset, refreshRequired.iType);
       
   720 	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
       
   721 	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));
       
   722 
       
   723 	PrepareAndCallRefreshAllowedL();
       
   724 	
       
   725 	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
       
   726 	
       
   727 	User::WaitForRequest(refreshStatus);
       
   728 	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
       
   729 	ASSERT_EQUALS(RSat::E3GSessionReset, refresh.iType);
       
   730 	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
       
   731 	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
       
   732 	AssertMockLtsyStatusL();
       
   733 
       
   734 	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	K3GSessionReset,
       
   735 			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
       
   736 			refreshTerminalRsp.iGeneralResult);
       
   737 	
       
   738 	AssertMockLtsyStatusL();	
       
   739 	
       
   740 	CleanupStack::PopAndDestroy(2, this);
       
   741 	}
       
   742 
       
   743 
       
   744 
       
   745 void CCSatRefreshFU::PrepareTlv(TTlv& aTlv, TUint8 aCmdNum, TUint8 aCmdQualifier) 
       
   746 	{
       
   747 	aTlv.Begin(KBerTlvProactiveSimCommandTag);
       
   748 	aTlv.AddTag(KTlvCommandDetailsTag);
       
   749 	aTlv.AddByte(aCmdNum);//ETLV_CommandNumber
       
   750 	aTlv.AddByte(KRefresh); //ETLV_TypeOfCommand
       
   751 	aTlv.AddByte(aCmdQualifier); //ETLV_CommandQualifier
       
   752 
       
   753 	aTlv.AddTag(KTlvDeviceIdentityTag); 
       
   754 	aTlv.AddByte(KSim); //ETLV_SourceDeviceIdentity
       
   755 	aTlv.AddByte(KMe); //ETLV_DestinationDeviceIdentity
       
   756 
       
   757 	switch(aCmdQualifier)
       
   758 		{
       
   759 		case KFileChangeNotification:
       
   760 		case KSimInitFileChangeNotification:
       
   761 			{
       
   762 		   	aTlv.AddTag(KTlvFileListTag);
       
   763 		   	aTlv.AddByte(1);	// num files
       
   764 		   	aTlv.AddData(KICCID_file);	
       
   765 		   	break;
       
   766 			}
       
   767 		case KUSIMApplicationReset:
       
   768 			{
       
   769 			aTlv.AddTag(KTlvAIDTag);	//ETLV_AID 
       
   770 			aTlv.AddData(KAID);
       
   771 			break;
       
   772 			}
       
   773 		default:
       
   774 			break;
       
   775 		}
       
   776 	}
       
   777 
       
   778 void CCSatRefreshFU::CompleteRefreshDispatchL(const TDesC8& aTlvDsc, TInt aRes)
       
   779 	{
       
   780 	RBuf8 data;
       
   781 	CleanupClosePushL(data);
       
   782 	
       
   783 	TDesC8* tlvDscPtr = const_cast<TDesC8*>(&aTlvDsc);
       
   784 	TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr);
       
   785 
       
   786 	tlvDscPack.SerialiseL(data);
       
   787 	iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, aRes, data, KDelay);
       
   788 	data.Close();		
       
   789 
       
   790 	CleanupStack::PopAndDestroy(1); 
       
   791 	}
       
   792 
       
   793 void CCSatRefreshFU::PrepareRefreshDispatchL()
       
   794 	{
       
   795 	RBuf8 data;
       
   796 	CleanupClosePushL(data);
       
   797 
       
   798 	TUint8 pcmdCode = KRefresh;
       
   799 	TMockLtsyData1<TUint8> expLtsyData(pcmdCode);
       
   800 	expLtsyData.SerialiseL(data);
       
   801 	
       
   802 	iMockLTSY.ExpectL(MLtsyDispatchSatPCmdNotification::KLtsyDispatchSatPCmdNotificationApiId,data);
       
   803 	data.Close();
       
   804  	
       
   805 	CleanupStack::PopAndDestroy(1); 
       
   806 	}
       
   807 
       
   808 void CCSatRefreshFU::PrepareAndCallRefreshAllowedL(RSat::TPCmdResult aRes, TUint16 aCache, 
       
   809 		const TDesC8& aFileList, const TDesC8& aAid)
       
   810 	{
       
   811 	RBuf8 data;
       
   812 	CleanupClosePushL(data);
       
   813 
       
   814 	if(RSat::KSuccess == aRes)
       
   815 		{
       
   816 	    //RSat::TAid aid(aAid); 
       
   817 		TDesC8* aidPtr = const_cast<TDesC8*>(&aAid);
       
   818 		TDesC8* refreshFileListPtr = const_cast<TDesC8*>(&aFileList);
       
   819 		TUint16 cache = aCache;
       
   820 		TMockLtsyData3<TDesC8*, TDesC8*, TUint16> refreshAllowedPack(refreshFileListPtr,aidPtr,cache);
       
   821 		refreshAllowedPack.SerialiseL(data);
       
   822 		iMockLTSY.ExpectL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,data,KErrNone);
       
   823 		data.Close();
       
   824 		}
       
   825 
       
   826 	RSat::TRefreshRspV1 refreshAllowedRsp;
       
   827 	refreshAllowedRsp.iGeneralResult = aRes;
       
   828 	if(RSat::KSuccess == aRes)
       
   829 		{
       
   830 		refreshAllowedRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   831 		refreshAllowedRsp.iAdditionalInfo = KNullDesC;		
       
   832 		}
       
   833 	else
       
   834 		{		
       
   835 		refreshAllowedRsp.iInfoType = RSat::KMeProblem;	
       
   836 		refreshAllowedRsp.iAdditionalInfo.Zero();
       
   837 		refreshAllowedRsp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);;
       
   838 		}		
       
   839 	RSat::TRefreshRspV1Pckg refreshAllowedRspPckg(refreshAllowedRsp);	
       
   840 	TRequestStatus refreshAllowedReqStatus;
       
   841 	
       
   842 	iSat.RefreshAllowed(refreshAllowedReqStatus,refreshAllowedRspPckg);
       
   843 	
       
   844 	User::WaitForRequest(refreshAllowedReqStatus);
       
   845 	// it is completed with KErrNone anyway
       
   846 	ASSERT_EQUALS(KErrNone, refreshAllowedReqStatus.Int());	
       
   847 	
       
   848 	CleanupStack::PopAndDestroy(1); 
       
   849 	}
       
   850 
       
   851 
       
   852