messagingfw/msgtestfw/TestActions/Email/Pop3/src/CMtfTestActionComparePopAccountId.cpp
changeset 22 bde600d88860
parent 0 8e480a14352b
equal deleted inserted replaced
21:08008ce8a6df 22:bde600d88860
       
     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 // ComparePopAccountId
       
    17 // [Action Parameters]
       
    18 // accountId1			input		TPOP3AccountId
       
    19 // accountId2			input		TPOP3AccountId
       
    20 // [Action Description]
       
    21 // ComparePopAccountId Test Action is intended to compare the account Ids.
       
    22 // [APIs Used]	
       
    23 // None
       
    24 // __ACTION_INFO_END__
       
    25 // 
       
    26 //
       
    27 
       
    28 #include <cemailaccounts.h>
       
    29 
       
    30 #include "CMtfTestActionComparePopAccountId.h"
       
    31 #include "CMtfTestCase.h"
       
    32 #include "CMtfTestActionParameters.h"
       
    33 
       
    34 
       
    35 /**
       
    36   Function : NewL
       
    37   Description : 
       
    38   @internalTechnology
       
    39   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    40   @param : aActionParams - CMtfTestActionParameters 
       
    41   @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionComparePopAccountId object
       
    42   @pre none
       
    43   @post none
       
    44 */
       
    45 CMtfTestAction* CMtfTestActionComparePopAccountId::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    46 	{
       
    47 	CMtfTestActionComparePopAccountId* self = new (ELeave) CMtfTestActionComparePopAccountId(aTestCase);
       
    48 	CleanupStack::PushL(self);
       
    49 	self->ConstructL(aActionParameters);
       
    50 	CleanupStack::Pop(self);
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 /**
       
    55   Function : CMtfTestActionComparePopAccountId
       
    56   Description : Constructor
       
    57   @internalTechnology
       
    58   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    59   @return : N/A
       
    60   @pre none
       
    61   @post none
       
    62 */
       
    63 CMtfTestActionComparePopAccountId::CMtfTestActionComparePopAccountId(CMtfTestCase& aTestCase) : CMtfSynchronousTestAction(aTestCase)
       
    64 	{
       
    65 	}
       
    66 
       
    67 /**
       
    68   Function : ~CMtfTestActionComparePopAccountId
       
    69   Description : Destructor
       
    70   @internalTechnology
       
    71   @param :
       
    72   @return : 
       
    73   @pre 
       
    74   @post 
       
    75 */
       
    76 CMtfTestActionComparePopAccountId::~CMtfTestActionComparePopAccountId()
       
    77 	{
       
    78 	}
       
    79 
       
    80 /**
       
    81   Function : ExecuteActionL
       
    82   Description : Entry point for the this test action in the test framework
       
    83   @internalTechnology
       
    84   @param : none
       
    85   @return : void
       
    86   @pre none 
       
    87   @post none
       
    88 */
       
    89 void CMtfTestActionComparePopAccountId::ExecuteActionL()
       
    90 	{
       
    91 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionComparePopAccountId);
       
    92 	TPopAccount accountId1 = ObtainValueParameterL<TPopAccount>(TestCase(), ActionParameters().Parameter(0));
       
    93 	TPopAccount accountId2 = ObtainValueParameterL<TPopAccount>(TestCase(), ActionParameters().Parameter(1));
       
    94 	
       
    95 	if (accountId1.iPopAccountId != accountId2.iPopAccountId)
       
    96 		{
       
    97 		// failed
       
    98 		TestCase().ERR_PRINTF1(_L("POP accounts do not match !"));
       
    99 		TestCase().SetTestStepResult(EFail);
       
   100 		}
       
   101 	
       
   102 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionComparePopAccountId);
       
   103 	TestCase().ActionCompletedL(*this);
       
   104 	}
       
   105 
       
   106