/**
 * @SYMTestCaseID BA-CTSY-INT-MB-0013
 * @SYMFssID BA/CTSY/PKTS-0013
 * @SYMTestCaseDesc Support being notified when MBMS network service availability changes to unavailable.
 * @SYMTestPriority High
 * @SYMTestActions  RPacketService::NotifyMbmsNetworkServiceStatusChange
 * @SYMTestExpectedResults Pass - MBMS network availability status is returned correctly.  
 * @SYMTestType CIT
 * @SYMTestCaseDependencies live/manual
 *
 * Reason for test: Verify that NotifyMbmsNetworkServiceStatusChange completes correctly with correct MBMS network status.
 *
 * @return - none
 */
void CCTsyUCaseMbms007::CCtsyIntegrationTestMbms0001L()
    {
        
	//
	// SET UP
	//
	        
   OpenEtelServerL( EUseExtendedError );
	CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
	OpenPhoneL();	

	RBuf8 data;
	CleanupClosePushL(data);

	RBuf8 data2;
	CleanupClosePushL(data2);
				
	RPacketService packetService;
    OpenPacketServiceL( packetService );
    CleanupClosePushL( packetService );

    // Open new context                
	TInfoName contextId;
    RPacketMbmsContext packetMbmsContext;
    packetMbmsContext.OpenNewContext( packetService, contextId );
    CleanupClosePushL( packetMbmsContext );
   
   
   	TRequestStatus requestStatus;
   	TRequestStatus requestStatus2;
	TMbmsNetworkServiceStatus regStatus;
   	TRequestStatus mockLtsyStatus;
   	TMbmsNetworkServiceStatus regStatuscomplete = EMbmsSupported; 	
   		
    // Ensure packet service status is RPacketService::EStatusAttached.
	RPacketService::TStatus sendStatus = RPacketService::EStatusAttached;
	TBool isResumed = EFalse;
	TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData(sendStatus, isResumed);
	ltsyData.SerialiseL(data);
	RPacketService::TStatus contextStatus;
	packetService.NotifyStatusChange(requestStatus2, contextStatus);
	
	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
	iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
	
	User::WaitForRequest(mockLtsyStatus);
	User::WaitForRequest(requestStatus2);
	AssertMockLtsyStatusL();
	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
	ASSERT_EQUALS(sendStatus, contextStatus);	

	// post RPacketService::NotifyMbmsNetworkServiceStatusChange
    packetService.NotifyMbmsNetworkServiceStatusChange(requestStatus, regStatus);
    
	TMbmsNetworkServiceStatus sndData = EMbmsSupported;
	TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData2(sndData);
	data.Close();
	ltsyData2.SerialiseL(data);		
	iMockLTSY.NotifyTerminated(mockLtsyStatus);		
    
    // Ensure RPacketService::NotifyMbmsNetworkServiceStatusChange completes with status EMbmsSupported.
	iMockLTSY.CompleteL(EPacketNotifyMbmsNetworkServiceStatusChange, KErrNone, data);
	User::WaitForRequest(mockLtsyStatus);	
	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
    ASSERT_TRUE(regStatuscomplete == regStatus);
    
	//
	// SET UP END
	//    
            
	//
	// TEST START
	//
	
	
	regStatuscomplete = EMbmsSupportUnknown; 
			
	// post RPacketService::NotifyMbmsNetworkServiceStatusChange				
    packetService.NotifyMbmsNetworkServiceStatusChange(requestStatus, regStatus);
    
	// Ensure packet service status is RPacketService::EStatusUnattached
   	sendStatus = RPacketService::EStatusUnattached;
	isResumed = EFalse;
	TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData3(sendStatus, isResumed);
	ltsyData3.SerialiseL(data);
	packetService.NotifyStatusChange(requestStatus2, contextStatus);
	
	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
	iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
	
	User::WaitForRequest(mockLtsyStatus);
	User::WaitForRequest(requestStatus2);
	AssertMockLtsyStatusL();
	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
	ASSERT_EQUALS(sendStatus, contextStatus);
		 
	TMbmsNetworkServiceStatus sndData2 = EMbmsSupportUnknown;
	TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData4(sndData2);
	data.Close();
	ltsyData4.SerialiseL(data);		
	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
		
    // Ensure RPacketService::NotifyMbmsNetworkServiceStatusChange completes with status EMbmsSupportUnknown.
	iMockLTSY.CompleteL(EPacketNotifyMbmsNetworkServiceStatusChange, KErrNone, data);
	User::WaitForRequest(mockLtsyStatus);	
	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
    ASSERT_TRUE(regStatuscomplete == regStatus);
	
	//
	// TEST END
	//	
	
	AssertMockLtsyStatusL();
	CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, data, data2, this 
    }
// do Test step 1.1
enum TVerdict CEtelPacketTest1_3::doTestStepL( void )
{
	RPhone phone;
	TInt ret=phone.Open(iTelServer,DPCKTTSY_PHONE_NAME);
	CHECKPOINT(ret,KErrNone,CHP_OPEN_PHONE);

	RPacketService gprs;
	ret=gprs.Open(phone);
    CHECKPOINT(ret,KErrNone,CHP_SRVS_CASE("A.1"));

	RPacketContext gprsContext;
	TName contextName;
	ret=gprsContext.OpenNewContext(gprs, contextName);
	CHECKPOINT(ret,KErrNone,CHP_CNTXT_CASE("B.1"));

	RPacketQoS	gprsQoS;
	TName qosName;
	ret = gprsQoS.OpenNewQoS(gprsContext, qosName);
	CHECKPOINT(ret,KErrNone,CHP_QOS_CASE("C.1"));
	CHECKPOINT(qosName.Compare(DPCKTTSY_QOS_NAME),KErrNone,CHP_QOS_CASE("C.1"));
	// local variables used throughout the gprs tests
	TRequestStatus reqStatus;
	TRequestStatus notifyStatus;
	// post a notification
	RPacketQoS::TQoSGPRSNegotiated aNotifyQoS;
	TPckg<RPacketQoS::TQoSGPRSNegotiated> aNotifyQoSPckg(aNotifyQoS);

	gprsQoS.NotifyProfileChanged(notifyStatus, aNotifyQoSPckg);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrNone,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iDelay , DPCKTTSY_DELAY_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iMeanThroughput , DPCKTTSY_MEAN_THROUGHPUT_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iPeakThroughput , DPCKTTSY_PEAK_THROUGHPUT_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iPrecedence , DPCKTTSY_PRECEDENCE_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iReliability , DPCKTTSY_RELIABILITY_MIN1,CHP_QOS_CASE("C.7"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.NotifyProfileChanged(notifyStatus, aNotifyQoSPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
	// Get QoS GPRS Capabilities
	RPacketQoS::TQoSCapsGPRS aQoSCaps;
	TPckg<RPacketQoS::TQoSCapsGPRS> aQoSCapsPckg(aQoSCaps);
	
	gprsQoS.GetProfileCapabilities(reqStatus, aQoSCapsPckg);
	User::WaitForRequest(reqStatus);
	CHECKPOINT(reqStatus.Int(),KErrNone,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.ExtensionId(),TPacketDataConfigBase::KConfigGPRS,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iDelay,DPCKTTSY_DELAY,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iMean,DPCKTTSY_MEAN_THROUGHPUT,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iPeak,DPCKTTSY_PEAK_THROUGHPUT,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iPrecedence,DPCKTTSY_PRECEDENCE,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iReliability,DPCKTTSY_RELIABILITY,CHP_QOS_CASE("C.6"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.GetProfileCapabilities(reqStatus, aQoSCapsPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSGetProfileCaps);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
	// Set QoS Profile Params
	RPacketQoS::TQoSGPRSRequested aQoSReqConfig;
	TPckg<RPacketQoS::TQoSGPRSRequested> aQoSReqPckg(aQoSReqConfig);

	aQoSReqConfig.iMinDelay = DPCKTTSY_DELAY_MIN1;
	aQoSReqConfig.iMinMeanThroughput = DPCKTTSY_MEAN_THROUGHPUT_MIN1;
	aQoSReqConfig.iMinPeakThroughput = DPCKTTSY_PEAK_THROUGHPUT_MIN1;
	aQoSReqConfig.iMinPrecedence = DPCKTTSY_PRECEDENCE_MIN1;
	aQoSReqConfig.iMinReliability = DPCKTTSY_RELIABILITY_MIN1;
	aQoSReqConfig.iReqDelay = DPCKTTSY_DELAY_REQ1;
	aQoSReqConfig.iReqMeanThroughput = DPCKTTSY_MEAN_THROUGHPUT_REQ1;
	aQoSReqConfig.iReqPeakThroughput = DPCKTTSY_PEAK_THROUGHPUT_REQ1;
	aQoSReqConfig.iReqPrecedence = DPCKTTSY_PRECEDENCE_REQ1;
	aQoSReqConfig.iReqReliability = DPCKTTSY_RELIABILITY_REQ1;

	gprsQoS.SetProfileParameters(reqStatus, aQoSReqPckg);
	User::WaitForRequest(reqStatus);
	CHECKPOINT(reqStatus.Int(),KErrNone,CHP_QOS_CASE("C.4"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.SetProfileParameters(reqStatus, aQoSReqPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSSetProfileParams);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
	// Get QoS Profile Params
	RPacketQoS::TQoSGPRSNegotiated aQoSNegConfig;
	TPckg<RPacketQoS::TQoSGPRSNegotiated> aQoSNegPckg(aQoSNegConfig);

	gprsQoS.GetProfileParameters(reqStatus, aQoSNegPckg);
	User::WaitForRequest(reqStatus);
	CHECKPOINT(reqStatus.Int(),KErrNone,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.ExtensionId(),TPacketDataConfigBase::KConfigGPRS,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iDelay,DPCKTTSY_DELAY_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iMeanThroughput,DPCKTTSY_MEAN_THROUGHPUT_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iPeakThroughput,DPCKTTSY_PEAK_THROUGHPUT_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iPrecedence,DPCKTTSY_PRECEDENCE_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iReliability,DPCKTTSY_RELIABILITY_NEG2,CHP_QOS_CASE("C.5"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.GetProfileParameters(reqStatus, aQoSNegPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSGetProfileParams);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));

	//Fix for defect MPO-576M6R: Added call to RPacket::OpenExistingQos()
	RPacketQoS	gprsQoS2;
	ret = gprsQoS2.OpenExistingQoS(gprsContext, qosName);
	CHECKPOINT(ret,KErrNone,CHP_QOS_CASE("C.2"));
	
	gprsQoS.Close();
	gprsQoS2.Close();
	gprsContext.Close();
	gprs.Close();
	phone.Close();

	return TestStepResult();
}
/**
 * @SYMTestCaseID BA-CTSY-INT-MB-0036
 * @SYMFssID BA/CTSY/MB-0036
 * @SYMTestCaseDesc MBMS is currently used
 * @SYMTestPriority High
 * @SYMTestActions RPacketContext::InitialiseContext, RPacketContext::SetConfig, RPacketService::NotifyDynamicCapsChange, RPacketService::GetDynamicCaps, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketContext::Deactivate
 * @SYMTestExpectedResults Pass - Client gets correct capability  
 * @SYMTestType CIT
 * @SYMTestCaseDependencies live/manual
 *
 * Reason for test: Verify that client get correct capability.
 *
 * @return - none
 */
void CCTsyUCaseMbms020::CCtsyIntegrationTestMbms0001L()
    {

        
	//
	// SET UP
	//
	        
    OpenEtelServerL( EUseExtendedError );
	CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
	OpenPhoneL();	
	
	RPacketService packetService;
    OpenPacketServiceL( packetService );
    CleanupClosePushL( packetService );
              
	TInfoName contextId;
    RPacketMbmsContext mbmsContext;
    mbmsContext.OpenNewContext( packetService, contextId );
    CleanupClosePushL( mbmsContext );
    
    RBuf8 data;
    CleanupClosePushL(data);
    
    RBuf8 expectData;
    CleanupClosePushL(expectData);	        
	
	// initialisation of the context 
	TInt status = InitMbmsContextL(mbmsContext, contextId); 
    ASSERT_EQUALS(KErrNone, status);	
    
    // data for SetConfig
    TRequestStatus requestStatus;
    RPacketMbmsContext::TContextConfigMbmsV1 setConfig;
    setConfig.iTmgi.SetServiceId(1); 
    setConfig.iTmgi.SetMCC(111);
    setConfig.iTmgi.SetMNC(111);
    setConfig.iMbmsAccessBearer = E3GBearer;
    setConfig.iMbmsServicePriority = EMbmsHighServicePriority;
    setConfig.iMbmsServiceMode = KBroadcast;
    setConfig.iMbmsSessionFlag = ETrue;
	
	// configure context
    status = SetMbmsConfigL(mbmsContext, contextId, setConfig);
	ASSERT_EQUALS(KErrNone, status);	

	
	// add sessions
	TInt maxSessions( 1 );	
	
	TMockLtsyData1 <TInfoName > expData( contextId );
	expData.SerialiseL( expectData );
	
 	TMockLtsyData1 <TInfoName> outData( contextId );
	outData.SerialiseL( data );	
    
    for( TInt i = 0; i < maxSessions; i++ )
	    {
	    TMbmsSessionId session(i);  
	    
	    iMockLTSY.ExpectL(EPacketContextUpdateMbmsSessionList, expectData);
	    iMockLTSY.CompleteL(EPacketContextUpdateMbmsSessionList, KErrNone, data);            
	    mbmsContext.UpdateMbmsSessionList(requestStatus, EAddEntries, session);    
	    
	    User::WaitForRequest( requestStatus );
	    ASSERT_EQUALS( KErrNone, requestStatus.Int() ) ;	
	    }
    
	// Activate MBMS context
	status = SetMbmsActiveL(mbmsContext, setConfig, contextId);
	ASSERT_EQUALS(KErrNone, status);
	
	RPacketService::TStatus sendStatus = RPacketService::EStatusActive;
	TBool isResumed = EFalse;	
	TInt err = SetPacketServiceStatusL(sendStatus, isResumed);	
	ASSERT_EQUALS(KErrNone, err);
	
	
	RPacketService::TStatus attachStatus;
    TInt ret = packetService.GetStatus(attachStatus);
    ASSERT_EQUALS(KErrNone, ret);
    ASSERT_EQUALS(RPacketService::EStatusActive, attachStatus);
	
	// Ensure MBMS Context status is Active
	RPacketContext::TContextStatus expectedStatus = RPacketContext::EStatusActive;
	RPacketContext::TContextStatus contextStatus;
	ret = mbmsContext.GetStatus(contextStatus);
	ASSERT_EQUALS(KErrNone, ret);
    ASSERT_EQUALS((TInt)expectedStatus, (TInt)contextStatus);
	
	// Add a session
	CFilteringActiveScheduler scheduler;
	CActiveScheduler::Install(&scheduler);    
	
    RPacketMbmsContext::CMbmsSession* session = RPacketMbmsContext::CMbmsSession::NewL();  
    CleanupStack::PushL(session);	
    	
	CRetrievePcktMbmsSessionList* sessionList = CRetrievePcktMbmsSessionList::NewL(mbmsContext, *session);        
    CleanupStack::PushL(sessionList);

    CActiveRetriever::ResetRequestsNumber();
    CActiveRetriever retriever(*sessionList);
    
    scheduler.AddRetrieverL(retriever);
        
    sessionList->Start( retriever.Status() );	 	
	retriever.Activate();
	scheduler.StartScheduler();
	ASSERT_EQUALS(KErrNone, retriever.iStatus.Int());
    
    // ensure there is session added to a MBMS context 
	for( TUint i = 0; i < session->iSessionIdList.Count(); i++)
	    {
	    TMbmsSessionId sessionId = session->iSessionIdList[i];
	    ASSERT_EQUALS( sessionId, i);	    
	    }
	
	ASSERT_EQUALS(0, CActiveRetriever::ResetRequestsNumber());	 	
 	AssertMockLtsyStatusL();
    
    
    
	//
	// SET UP END
	//    
            
	//
	// TEST START
	//

	// Network sends MBMS Notification to handset indicating MBMS service delivery about to start.
	// post notify RPacketContext::NotifyStatusChange
 	mbmsContext.NotifyStatusChange(requestStatus, contextStatus);	

    // post RPacketService::NotifyDynamicCapsChange
    RPacketService::TDynamicCapsFlags caps;
	TRequestStatus dynamicCapsStatus;
	packetService.NotifyDynamicCapsChange(dynamicCapsStatus, caps);

    TContextMisc  completeMisc;
    completeMisc.iStatus = RPacketContext::EStatusReceiving;
 	TMockLtsyData2 <TInfoName, TContextMisc>ltsyData1(contextId, completeMisc);
	ltsyData1.SerialiseL(data);
    TRequestStatus mockLtsyStatus;
	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
		
	iMockLTSY.CompleteL(EPacketContextNotifyStatusChange , KErrNone, data);
	User::WaitForRequest(mockLtsyStatus);
    User::WaitForRequest(requestStatus);
	
	// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusReceiving	
	ASSERT_EQUALS(KErrNone, requestStatus.Int());
	ASSERT_EQUALS(completeMisc.iStatus, contextStatus);	
	AssertMockLtsyStatusL();
    
    // Check RPacketContext::GetStatus returns RPacketContext::EStatusReceiving
	expectedStatus = RPacketContext::EStatusReceiving;
	ret = mbmsContext.GetStatus(contextStatus);
	ASSERT_EQUALS(KErrNone, ret);
    ASSERT_EQUALS((TInt)expectedStatus, (TInt)contextStatus);

	// Ensure RPacketService::NotifyDynamicCapsChange doens't return RPacketService::KCapsMBMS
   	User::WaitForRequest(dynamicCapsStatus);
   	ASSERT_EQUALS(KErrNone, dynamicCapsStatus.Int());
   	ASSERT_TRUE(RPacketService::KCapsMBMS & caps);
   	
   	// Ensure GetDynamicCaps capabilities return RPacketService::KCapsMBMS caps
	packetService.GetDynamicCaps(caps);
	ASSERT_TRUE(RPacketService::KCapsMBMS & caps);	

    AssertMockLtsyStatusL();

	// deactivate context 
	status = SetMbmsDeactiveL(mbmsContext, contextId);
	ASSERT_EQUALS(KErrNone, status);
	
	// delete context
	status = SetMbmsDeleteL(mbmsContext, contextId);
	ASSERT_EQUALS(KErrNone, status);
	
	// close context
	mbmsContext.Close( );     
	        
    	
	//
	// TEST END
	//	
	
	AssertMockLtsyStatusL();
	CActiveScheduler::Install(NULL);    
	CleanupStack::PopAndDestroy( 7, this ); // sessionList, session, expectData, data, mbmsContext, packetService, this
      }
Beispiel #4
0
int main(int, char**)
{
  TUint aDynCaps = 0;
  RPacketService packetService;
  packetService.GetDynamicCaps(aDynCaps);
}
/**
 * @SYMTestCaseID BA-CTSY-INT-MB-0014
 * @SYMFssID BA/CTSY/PKTS-0014
 * @SYMTestCaseDesc Support updating monitor list by adding an entry.
 * @SYMTestPriority High
 * @SYMTestActions RPacketService::NotifyMbmsNetworkServiceStatusChange, RPacketService::UpdateMbmsMonitorServiceListL
 * @SYMTestExpectedResults Pass - Service is added to the monitored service list.  
 * @SYMTestType CIT
 * @SYMTestCaseDependencies live/manual
 *
 * Reason for test: Verify that services is added correctly to the monitored service list.
 *
 * @return - none
 */
void CCTsyUCaseMbms008::CCtsyIntegrationTestMbms0001L()
    {
        
	//
	// SET UP
	//
	        
   	OpenEtelServerL( EUseExtendedError );
	CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
	OpenPhoneL();	

	RBuf8 data;
	CleanupClosePushL(data);
				
	RPacketService packetService;
    OpenPacketServiceL( packetService );
    CleanupClosePushL( packetService );

   	TRequestStatus requestStatus;
   	TRequestStatus requestStatus2;
   	TRequestStatus mockLtsyStatus;
   	    
    // Ensure packet service status is RPacketService::EStatusAttached.
	RPacketService::TStatus sendStatus = RPacketService::EStatusAttached;
	TBool isResumed = EFalse;
	TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData(sendStatus, isResumed);
	ltsyData.SerialiseL(data);
	RPacketService::TStatus contextStatus;
	packetService.NotifyStatusChange(requestStatus2, contextStatus);
	
	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
	iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
	
	User::WaitForRequest(mockLtsyStatus);
	User::WaitForRequest(requestStatus2);
	AssertMockLtsyStatusL();
	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
	ASSERT_EQUALS(sendStatus, contextStatus);
     	    
	//
	// SET UP END
	//    
            
	//
	// TEST START
	//
	
	
   	TInt maxAllowed = 3; 
	TInt maxvalue = 3;
 	
 	// check maximum monitored service value .
 	TMockLtsyData1<TInt> ltsyData2(maxvalue);
 	data.Close();
	ltsyData2.SerialiseL(data);
 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
	iMockLTSY.CompleteL(EPacketEnumerateMbmsMonitorServiceList, KErrNone, data);
	User::WaitForRequest(mockLtsyStatus);	
	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());		
	ASSERT_EQUALS( maxvalue, maxAllowed );

 	CFilteringActiveScheduler scheduler;
	CActiveScheduler::Install(&scheduler);
	
	// post RPacketService::NotifyMbmsNetworkServiceAvailabilityChange
	packetService.NotifyMbmsServiceAvailabilityChange( requestStatus );
		
	//List retriever
	CRetrievePcktMbmsMonitoredServices* monitorList = CRetrievePcktMbmsMonitoredServices::NewL(packetService);	 
	CleanupStack::PushL(monitorList);

	CActiveRetriever::ResetRequestsNumber();
	CActiveRetriever* activeRetriever = CActiveRetriever::NewL(*monitorList);
	CleanupStack::PushL(activeRetriever);
	scheduler.AddRetrieverL(*activeRetriever);
							
	RBuf8 expectData1;
	CleanupClosePushL(expectData1);
	TInt i;
    TMockLtsyData1<TInt> expExpect1(i);
    expExpect1.SerialiseL(expectData1);
    
	RBuf8 CompleteData;
	CleanupClosePushL(CompleteData);
	
	TRequestStatus aReqStatus;
    RPacketService::TMbmsServiceAvailabilityV1 existingParams;
    
    
    CPcktMbmsMonitoredServiceList* multipleEntries = CPcktMbmsMonitoredServiceList ::NewL();
	CleanupStack::PushL(multipleEntries);
	
	for(TInt i=0;i < MBMS_MONITORSERVICECOUNTMULTIPLE ;i++)
		{
		existingParams.iTmgi.SetServiceId(i); 
	    existingParams.iTmgi.SetMCC(i);
	    existingParams.iTmgi.SetMNC(i);
	    existingParams.iMbmsServiceMode = KBroadcast;
	    existingParams.iMbmsAccessBearer = E2GBearer;
	   	existingParams.iMbmsAvailabilityStatus = EMbmsUnavailable;
		multipleEntries->AddEntryL( existingParams );
		}
	
	iMockLTSY.ExpectL(EPacketUpdateMbmsMonitorServiceList, expectData1);
	iMockLTSY.CompleteL(EPacketUpdateMbmsMonitorServiceList, KErrNone, CompleteData);
	
	// PacketService::UpdateMbmsMonitorServiceListL
	packetService.UpdateMbmsMonitorServiceListL(aReqStatus, EAddEntries, multipleEntries);	
	
	// wait for completion of UpdateMbmsMonitorServiceListL(	
	User::WaitForRequest(aReqStatus);
	// wait for completion of NotifyMbmsServiceAvailabilityChange
	User::WaitForRequest( requestStatus );
	AssertMockLtsyStatusL();		
	ASSERT_EQUALS( KErrNone, aReqStatus.Int() );

	monitorList->Start(activeRetriever->Status());
	activeRetriever->Activate();
	scheduler.StartScheduler();

	ASSERT_EQUALS(0, CActiveRetriever::ResetRequestsNumber());
	ASSERT_EQUALS(KErrNone, activeRetriever->iStatus.Int());

	CPcktMbmsMonitoredServiceList* list = monitorList->RetrieveListL();
	CleanupStack::PushL( list );
	
	ASSERT_EQUALS(MBMS_MONITORSERVICECOUNTMULTIPLE, list->Enumerate() );
	
	monitorList->Start( activeRetriever->Status() );
	activeRetriever->Activate();
	scheduler.StartScheduler();

	ASSERT_EQUALS( 0, CActiveRetriever::ResetRequestsNumber() );
	ASSERT_EQUALS( KErrNone, activeRetriever->iStatus.Int() );
	
	list = monitorList->RetrieveListL();
	CleanupStack::PushL( list );
	
	// ensure that Services is added correctly into the monitored service list	
	ASSERT_TRUE( TComparator<CPcktMbmsMonitoredServiceList>::IsEqual( *multipleEntries, *list ) );

	//
	// TEST END
	//	
	
	AssertMockLtsyStatusL();
	CleanupStack::PopAndDestroy( 10, this ); // packetMbmsContext, packetService, this 
    }