messagingfw/msgtestfw/TestActions/Capabilities/src/cmtftestactionsendemsvcheckstore.cpp
changeset 0 8e480a14352b
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 "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: Implementation of CMtfTestActionSendEMsvCheckStore
       
    14 //
       
    15 
       
    16 #include "cmtftestactionsendemsvcheckstore.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 #include "CMtfTestCase.h"
       
    26 #include "CMtfTestActionParameters.h"
       
    27 
       
    28 #include "IPCCommandForCapsPermissions.h"
       
    29 #include "SendProxyClient.h"
       
    30 #include "SendProxyserver.h"
       
    31 
       
    32 /**
       
    33   Function : NewL
       
    34   Description :
       
    35   @internalTechnology
       
    36   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    37   @param : aActionParams - CMtfTestActionParameters
       
    38   @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionSendEMsvCheckStore object
       
    39   @pre none
       
    40   @post none
       
    41 */
       
    42 CMtfTestAction* CMtfTestActionSendEMsvCheckStore::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    43 	{
       
    44 	CMtfTestActionSendEMsvCheckStore* self = new (ELeave) CMtfTestActionSendEMsvCheckStore(aTestCase);
       
    45 	CleanupStack::PushL(self);
       
    46 	self->ConstructL(aActionParameters);
       
    47 	CleanupStack::Pop(self);
       
    48 	return self;
       
    49 	}
       
    50 
       
    51 /**
       
    52   Function : CMtfTestActionSendEMsvCheckStore
       
    53   Description : Constructor
       
    54   @internalTechnology
       
    55   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    56   @return : N/A
       
    57   @pre none
       
    58   @post none
       
    59 */
       
    60 CMtfTestActionSendEMsvCheckStore::CMtfTestActionSendEMsvCheckStore(CMtfTestCase& aTestCase) : CMtfSynchronousTestAction(aTestCase)
       
    61 	{
       
    62 	}
       
    63 
       
    64 /**
       
    65   Function : ~CMtfTestActionSendEMsvCheckStore
       
    66   Description : Destructor
       
    67   @internalTechnology
       
    68   @param :
       
    69   @return :
       
    70   @pre
       
    71   @post
       
    72 */
       
    73 CMtfTestActionSendEMsvCheckStore::~CMtfTestActionSendEMsvCheckStore()
       
    74 	{
       
    75 	}
       
    76 
       
    77 /**
       
    78   Function : ExecuteActionL
       
    79   Description : Entry point for the this test action in the test framework
       
    80   @internalTechnology
       
    81   @param : none
       
    82   @return : void
       
    83   @pre none
       
    84   @post none
       
    85 */
       
    86 void CMtfTestActionSendEMsvCheckStore::ExecuteActionL()
       
    87 	{
       
    88 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendEMsvCheckStore);
       
    89 	// input params
       
    90 	TUid mtmUid = KUidMsgTypeIMAP4;
       
    91 	TInt pass = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(1) );
       
    92 
       
    93 	RProxyServerSession RPSS;
       
    94 	TInt error = RPSS.Connect();
       
    95 	CleanupClosePushL(RPSS);
       
    96 
       
    97 	// Will auto start the server if not started.
       
    98 	if (error!=KErrNone)
       
    99 		{
       
   100 		TestCase().ERR_PRINTF1(_L("CMtfTestActionSendEMsvCheckStore :: Unable to start proxy server. !"));
       
   101 		TestCase().SetTestStepResult(EFail);
       
   102 		}
       
   103 	else
       
   104 		{
       
   105 		TInt32 serverCaps;
       
   106 		RPSS.GetServerCapabilities(serverCaps);
       
   107 		TestCase().INFO_PRINTF2(_L("Proxy Server has capabilities: %x"), serverCaps);
       
   108 
       
   109 		TPckg<TBool> isStoreExists = EFalse;		
       
   110 		TInt err = RPSS.SendReceive(EMsvCheckStoreExists, TIpcArgs(mtmUid.iUid,&isStoreExists));
       
   111 
       
   112 		IPCCommandReportPassOrFailForCapsPermissions( TestCase(), KMsvServerName, err , pass );
       
   113 		}
       
   114 
       
   115 	CleanupStack::Check(&RPSS);
       
   116 	CleanupStack::PopAndDestroy(); // RPSS
       
   117 
       
   118 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSendEMsvCheckStore);
       
   119 	TestCase().ActionCompletedL(*this);
       
   120 	}