messagingfw/msgtestfw/TestActions/Capabilities/src/CMtfTestActionSendEMsvNotifySessionEvent.cpp
changeset 0 8e480a14352b
child 3 28ae839b4c09
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2004-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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "CMtfTestActionSendEMsvNotifySessionEvent.h"
       
    17 
       
    18 #include <e32std.h>
       
    19 #include <e32base.h>
       
    20 
       
    21 #include <msvipc.h>
       
    22 #include "MCLIENT.H"
       
    23 #include "MSERVER.H"
       
    24 
       
    25 
       
    26 #include "CMtfTestCase.h"
       
    27 #include "CMtfTestActionParameters.h"
       
    28 
       
    29 #include "IPCCommandForCapsPermissions.h"
       
    30 #include "SendProxyClient.h"
       
    31 #include "SendProxyserver.h"
       
    32 
       
    33 
       
    34 /**
       
    35   Function : NewL
       
    36   Description : 
       
    37   @internalTechnology
       
    38   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    39   @param : aActionParams - CMtfTestActionParameters 
       
    40   @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionSendEMsvNotifySessionEvent object
       
    41   @pre none
       
    42   @post none
       
    43 */
       
    44 CMtfTestAction* CMtfTestActionSendEMsvNotifySessionEvent::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    45 	{
       
    46 	CMtfTestActionSendEMsvNotifySessionEvent* self = new (ELeave) CMtfTestActionSendEMsvNotifySessionEvent(aTestCase);
       
    47 	CleanupStack::PushL(self);
       
    48 	self->ConstructL(aActionParameters);
       
    49 	CleanupStack::Pop(self);
       
    50 	return self;
       
    51 	}
       
    52 
       
    53 /**
       
    54   Function : CMtfTestActionSendEMsvNotifySessionEvent
       
    55   Description : Constructor
       
    56   @internalTechnology
       
    57   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    58   @return : N/A
       
    59   @pre none
       
    60   @post none
       
    61 */
       
    62 CMtfTestActionSendEMsvNotifySessionEvent::CMtfTestActionSendEMsvNotifySessionEvent(CMtfTestCase& aTestCase) : CMtfSynchronousTestAction(aTestCase)
       
    63 	{
       
    64 	}
       
    65 	
       
    66 /**
       
    67   Function : ~CMtfTestActionSendEMsvNotifySessionEvent
       
    68   Description : Destructor
       
    69   @internalTechnology
       
    70   @param :
       
    71   @return : 
       
    72   @pre 
       
    73   @post 
       
    74 */
       
    75 CMtfTestActionSendEMsvNotifySessionEvent::~CMtfTestActionSendEMsvNotifySessionEvent()
       
    76 	{
       
    77 	}
       
    78 
       
    79 /**
       
    80   Function : ExecuteActionL
       
    81   Description : Entry point for the this test action in the test framework
       
    82   @internalTechnology
       
    83   @param : none
       
    84   @return : void
       
    85   @pre none 
       
    86   @post none
       
    87 */
       
    88 
       
    89 
       
    90 
       
    91 
       
    92 void CMtfTestActionSendEMsvNotifySessionEvent::ExecuteActionL()
       
    93 	{
       
    94 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendEMsvNotifySessionEvent);
       
    95 	// input params
       
    96 	TInt pass = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(0) );
       
    97 
       
    98 
       
    99 	RProxyServerSession RPSS;
       
   100 	TInt error = RPSS.Connect();
       
   101 	// Will auto start the server if not started.
       
   102 	
       
   103 	if (error!=KErrNone)
       
   104 		{
       
   105 		TestCase().ERR_PRINTF2(_L("%S :: Unable to start proxy server. !"), &KTestActionSendEMsvNotifySessionEvent);
       
   106 		TestCase().SetTestStepResult(EFail);
       
   107 		}
       
   108 	else
       
   109 		{
       
   110 		TInt32 serverCaps;
       
   111 		RPSS.GetServerCapabilities(serverCaps);
       
   112 		TestCase().INFO_PRINTF2(_L("Proxy Server has capabilities: %x"), serverCaps);
       
   113 				
       
   114 		TInt error = 0;
       
   115 		TMsvNotifBuffer change;	
       
   116 		TPckgBuf<TUint32> sequence;
       
   117 				
       
   118 		error = RPSS.SendReceiveProxyAsync(EMsvNotifySessionEvent , TIpcArgs(&change, &sequence) );	
       
   119 		IPCCommandReportPassOrFailForCapsPermissions( TestCase(), KTestActionSendEMsvNotifySessionEvent, error , pass );
       
   120 
       
   121 		}
       
   122 		
       
   123 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSendEMsvNotifySessionEvent);
       
   124 	TestCase().ActionCompletedL(*this);
       
   125 	}