messagingfw/msgtestfw/TestActions/Base/src/CMtfTestActionCheckIfMessagePresent.cpp
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     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:
       
    14 // __ACTION_INFO_BEGIN__ 
       
    15 // [Action Name]
       
    16 // CheckIfMessagePresent
       
    17 // [Action Parameters]
       
    18 // CMsvEntrySelection MessageSelection     <input>: Reference to the 
       
    19 // CMsvEntrySelection object.
       
    20 // TMsvId MessageId						   <input>: Value of the the message id.
       
    21 // [Action Description]
       
    22 // Checks a specified folder for a specified message id.
       
    23 // [APIs Used]
       
    24 // CMsvEntrySelection::Find
       
    25 // __ACTION_INFO_END__
       
    26 // 
       
    27 //
       
    28 
       
    29 #include <msvstd.h>
       
    30 
       
    31 #include "CMtfTestActionCheckIfMessagePresent.h"
       
    32 #include "CMtfTestCase.h"
       
    33 #include "CMtfTestActionParameters.h"
       
    34 
       
    35 
       
    36 /**
       
    37   Function : NewL
       
    38   Description : 
       
    39   @internalTechnology
       
    40   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    41   @param : aActionParams - CMtfTestActionParameters 
       
    42   @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionCompareImapAccountId object
       
    43   @pre none
       
    44   @post none
       
    45 */
       
    46 CMtfTestAction* CMtfTestActionCheckIfMessagePresent::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    47 	{
       
    48 	CMtfTestActionCheckIfMessagePresent* self = new (ELeave) CMtfTestActionCheckIfMessagePresent(aTestCase);
       
    49 	CleanupStack::PushL(self);
       
    50 	self->ConstructL(aActionParameters);
       
    51 	CleanupStack::Pop();
       
    52 	return self;
       
    53 	}
       
    54 
       
    55 
       
    56 /**
       
    57   Function : CMtfTestActionCompareImapAccountId
       
    58   Description : Constructor
       
    59   @internalTechnology
       
    60   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    61   @return : N/A
       
    62   @pre none
       
    63   @post none
       
    64 */
       
    65 CMtfTestActionCheckIfMessagePresent::CMtfTestActionCheckIfMessagePresent(CMtfTestCase& aTestCase)
       
    66 	: CMtfSynchronousTestAction(aTestCase)
       
    67 	{
       
    68 	}
       
    69 
       
    70 
       
    71 /**
       
    72   Function : ~CMtfTestActionCompareImapAccountId
       
    73   Description : Destructor
       
    74   @internalTechnology
       
    75   @param :
       
    76   @return : 
       
    77   @pre 
       
    78   @post 
       
    79 */
       
    80 CMtfTestActionCheckIfMessagePresent::~CMtfTestActionCheckIfMessagePresent()
       
    81 	{
       
    82 	}
       
    83 
       
    84 
       
    85 /**
       
    86   Function : ExecuteActionL
       
    87   Description : Entry point for the this test action in the test framework
       
    88   @internalTechnology
       
    89   @param : none
       
    90   @return : void
       
    91   @pre none
       
    92   @post none
       
    93 */
       
    94 void CMtfTestActionCheckIfMessagePresent::ExecuteActionL()
       
    95 	{
       
    96 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCheckIfMessagePresent);
       
    97 	CMsvEntrySelection* paramMsgSelection = ObtainParameterReferenceL<CMsvEntrySelection>(TestCase(),ActionParameters().Parameter(0));
       
    98 	TMsvId paramMessageId = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
       
    99 
       
   100 	if(!paramMsgSelection)
       
   101 		{
       
   102 		User::Leave(KErrArgument);
       
   103 		}
       
   104 
       
   105 	TInt messageIndex = paramMsgSelection->Find(paramMessageId);
       
   106 	User::LeaveIfError(messageIndex);
       
   107 
       
   108 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCheckIfMessagePresent);
       
   109 	TestCase().ActionCompletedL(*this);
       
   110 	}
       
   111