void
MLDispatchOrderFillerJapanese::orderError(const MString& event, const MString& orderControl)
{
  MString additionalInfo("Order Control: ");
  additionalInfo += orderControl;
  
  processError("ORM", event, additionalInfo);
}
/**
@SYMTestCaseID BA-CSAT-RF-SNRFPC-0001b
@SYMPREQ 1780
@SYMComponent  telephony_csat
@SYMTestCaseDesc additional test support in CSAT for RSat::NotifyRefreshPCmd 
@SYMTestPriority High
@SYMTestActions Invokes RSat::NotifyRefreshPCmd 
@SYMTestExpectedResults Pass
@SYMTestType CT
*/
void CCSatRefreshFU::TestNotifyRefreshPCmd0001bL()
	{
	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));
	OpenPhoneL();
	OpenSatL();

	RBuf8 data;
	CleanupClosePushL(data);
	
	//(REFRESH, SIM Initialization)

	TUint8 KPCmdNumber = 1;

	TTlv tlv;
	
	PrepareTlv( tlv, KPCmdNumber, KSimInit);
	
	TRequestStatus refreshStatus;
	TRequestStatus refreshRequiredStatus;
	RSat::TRefreshV2 refresh;
	RSat::TRefreshV2Pckg refreshPck(refresh);
	RSat::TRefreshV2 refreshRequired;
	RSat::TRefreshV2Pckg refreshRequiredPck(refreshRequired);
	
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::ESimInit, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::ESimInit, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
	AssertMockLtsyStatusL();	
	
	RSat::TRefreshRspV1 refreshTerminalRsp;
	RSat::TRefreshRspV1Pckg refreshTerminalRspPckg(refreshTerminalRsp);
	refreshTerminalRsp.SetPCmdNumber(KPCmdNumber);
	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
	refreshTerminalRsp.iAdditionalInfo = KNullDesC;

	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KSimInit,
			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
			refreshTerminalRsp.iGeneralResult);
	
	AssertMockLtsyStatusL();	

	// completion of ESatTsyImsiChanged after terminal responce for full test coverage 	
	TRequestStatus requestStatus;
	iMockLTSY.NotifyTerminated(requestStatus);	    
	iMockLTSY.CompleteL(KMockLtsyDispatchSatImsiChangedIndId, KErrNone, KDelay);
	User::WaitForRequest(requestStatus);
	AssertMockLtsyStatusL();
	ASSERT_EQUALS(KErrNone, requestStatus.Int());
	//(REFRESH, File Change Notification)

	PrepareTlv( tlv, KPCmdNumber, KFileChangeNotification);
		
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::EFileChangeNotification, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::EFileChangeNotification, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
	AssertMockLtsyStatusL();

	refreshTerminalRsp.iGeneralResult = RSat::KMeUnableToProcessCmd;
	refreshTerminalRsp.iInfoType = RSat::KMeProblem;	
	refreshTerminalRsp.iAdditionalInfo.Zero();
	refreshTerminalRsp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);;
	
	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KFileChangeNotification,
			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
			refreshTerminalRsp.iGeneralResult);
	
	AssertMockLtsyStatusL();	
	
	//(REFRESH, USIM Initialization and File Change Notification)

	PrepareTlv( tlv, KPCmdNumber, KSimInitFileChangeNotification);
		
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::ESimInitFileChangeNotification, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KICCID16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, 0x00, KICCID_file);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::ESimInitFileChangeNotification, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KICCID16));
	AssertMockLtsyStatusL();

	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
	refreshTerminalRsp.iAdditionalInfo.Zero();
	
	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KSimInitFileChangeNotification,
			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
			refreshTerminalRsp.iGeneralResult);
	
	AssertMockLtsyStatusL();	
	
	//(REFRESH, USIM Initialization and Full File Change Notification)

	PrepareTlv( tlv, KPCmdNumber, KSimInitFullFileChangeNotification);
		
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::ESimInitFullFileChangeNotification, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);

	// calling terminal responce through CSatNotifyRefresh::CompleteTerminalRespDataL
	RSat::TAdditionalInfo additionalInfo(KNullDesC);
	TDesC* addInfoPtr = &additionalInfo;
    RSat::TPCmdResult generalResult = RSat::KSuccess;
    TMockLtsyData2<RSat::TPCmdResult,TDesC*> refreshDataPck(generalResult,addInfoPtr);
    refreshDataPck.SerialiseL(data);	
	iMockLTSY.CompleteL(KMockLtsyDispatchSatCreateRefreshTerminalRspIndId,KErrNone,data, KDelay);
	data.Close();		
		
	PrepareTerminalResponseMockDataL( KPCmdNumber, KRefresh, KSimInitFullFileChangeNotification,
			refreshTerminalRsp.iAdditionalInfo, refreshTerminalRsp.iGeneralResult, KNullDesC8);

	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::ESimInitFullFileChangeNotification, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
	
	AssertMockLtsyStatusL();	
	
	//(REFRESH, UICC Reset)

	PrepareTlv( tlv, KPCmdNumber, KSimReset);
		
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::ESimReset, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::ESimReset, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
	AssertMockLtsyStatusL();

	// for refresh terminal response processed without calling ltsy 
	TerminalResponseL( RSat::ERefresh, refreshTerminalRspPckg);
	
	AssertMockLtsyStatusL();	
	
	// IMSI refresh through SIM init
	
	PrepareTlv( tlv, KPCmdNumber, KSimInit);
	
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::ESimInit, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::ESimInit, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
	AssertMockLtsyStatusL();

	// completion of ESatTsyImsiChanged		
	iMockLTSY.NotifyTerminated(requestStatus);	    
	iMockLTSY.CompleteL(KMockLtsyDispatchSatImsiChangedIndId, KErrNone, KDelay);
	User::WaitForRequest(requestStatus);
	AssertMockLtsyStatusL();
	ASSERT_EQUALS(KErrNone, requestStatus.Int());
		
	refreshTerminalRsp.iGeneralResult = RSat::KSuccess;
	refreshTerminalRsp.iInfoType = RSat::KNoAdditionalInfo;
	refreshTerminalRsp.iAdditionalInfo = KNullDesC;

	//SIM Init shall not be used if EFIMSI is changed, and TerminalResponse will not reach ltsy
	TerminalResponseL( RSat::ERefresh, refreshTerminalRspPckg, KErrNone);	
	
	AssertMockLtsyStatusL();	
	
	//(REFRESH, USIM Application Reset)

	PrepareTlv( tlv, KPCmdNumber, KUSIMApplicationReset);
		
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::EUsimApplicationReset, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KAID));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));

	PrepareAndCallRefreshAllowedL(RSat::KSuccess, ECacheEFSST | ECacheEFCBMID, KNullDesC8, KAID);
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::EUsimApplicationReset, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KAID));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
	AssertMockLtsyStatusL();

	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	KUSIMApplicationReset,
			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
			refreshTerminalRsp.iGeneralResult);
	
	AssertMockLtsyStatusL();	
	
	// 3G session reset

	PrepareTlv( tlv, KPCmdNumber, K3GSessionReset);
		
	PrepareRefreshDispatchL();

	iSat.NotifyRefreshRequired(refreshRequiredStatus, refreshRequiredPck);
	iSat.NotifyRefreshPCmd(refreshStatus, refreshPck);

	CompleteRefreshDispatchL( tlv.End() );
	
	User::WaitForRequest(refreshRequiredStatus);
	ASSERT_EQUALS(KErrNone, refreshRequiredStatus.Int());
	ASSERT_EQUALS(RSat::E3GSessionReset, refreshRequired.iType);
	ASSERT_EQUALS(0, refreshRequired.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refreshRequired.iFileList.Compare(KNullDesC16));

	PrepareAndCallRefreshAllowedL();
	
	iMockLTSY.CompleteL(MLtsyDispatchSatRefreshAllowed::KLtsyDispatchSatRefreshAllowedApiId,KErrNone, KDelay);
	
	User::WaitForRequest(refreshStatus);
	ASSERT_EQUALS(KErrNone, refreshStatus.Int());
	ASSERT_EQUALS(RSat::E3GSessionReset, refresh.iType);
	ASSERT_EQUALS(0, refresh.iAid.Compare(KNullDesC8));
	ASSERT_EQUALS(0, refresh.iFileList.Compare(KNullDesC16));
	AssertMockLtsyStatusL();

	GenerateTerminalResponseL(KPCmdNumber,	KRefresh,	K3GSessionReset,
			RSat::ERefresh, refreshTerminalRspPckg,	refreshTerminalRsp.iAdditionalInfo, 
			refreshTerminalRsp.iGeneralResult);
	
	AssertMockLtsyStatusL();	
	
	CleanupStack::PopAndDestroy(2, this);
	}