messagingfw/msgtestfw/TestActions/SendAs/src/CMtfTestActionSendAsCreateMessageWithAccount.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:
       
    14 // __ACTION_INFO_BEGIN__ 
       
    15 // [Action Name]
       
    16 // SendAsCreateMessageWithAccount
       
    17 // [Action Parameters]
       
    18 // RSendAs			sendAs				:	Reference to the RSendAs object
       
    19 // RSendAsMessage	sendAsMessage		:	Reference to the RSendAsMessage object with which message is to be created
       
    20 // TSendAsAccount	account				:	Account 
       
    21 // [Action Description]
       
    22 // SendAsCreateMessageWithAccount Test Action is intended to create a message with 
       
    23 // the specified account; the type of the message depends on the type of the account specified.
       
    24 // [APIs Used]
       
    25 // RSendAsMessage::Create (RSendAs& aSendAs, TSendAsAccount aAccount)
       
    26 // __ACTION_INFO_END__
       
    27 // 
       
    28 //
       
    29 
       
    30 /**
       
    31  @file 
       
    32  @internalTechnology 
       
    33 */
       
    34 
       
    35 
       
    36 // User include
       
    37 #include "CMtfTestActionSendAsCreateMessageWithAccount.h"
       
    38 #include "CMtfTestCase.h"
       
    39 #include "CMtfTestActionParameters.h"
       
    40 
       
    41 
       
    42 /**
       
    43   NewL()
       
    44   Constructs a CMtfTestActionSendAsCreateMessageWithAccount object.
       
    45   Uses two phase construction and leaves nothing on the CleanupStack.   
       
    46   @internalTechnology
       
    47   @param  aTestCase         Test Case to which this Test Action belongs
       
    48   @param  aActionParameters Action parameters, must not be NULL
       
    49   @return Created object of type CMtfTestActionGetMessageAtIndex
       
    50   @pre    None
       
    51   @post   CMtfTestActionSendAsCreateMessageWithAccount object is created
       
    52 */
       
    53 CMtfTestAction* CMtfTestActionSendAsCreateMessageWithAccount::
       
    54 		NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    55 	{
       
    56 	CMtfTestActionSendAsCreateMessageWithAccount* self = 
       
    57 							new (ELeave) CMtfTestActionSendAsCreateMessageWithAccount(aTestCase);
       
    58 
       
    59 	CleanupStack::PushL(self);
       
    60 	self->ConstructL(aActionParameters);
       
    61 	CleanupStack::Pop(self);
       
    62 	return self;
       
    63 	}
       
    64 	
       
    65 
       
    66 /**
       
    67   CMtfTestActionSendAsCreateMessageWithAccount constructor
       
    68   Calls the base class' constructor
       
    69   @internalTechnology  
       
    70   @param  aTestCase  Test Case to which this Test Action belongs
       
    71   @pre    None
       
    72   @post   None
       
    73 */ 
       
    74 CMtfTestActionSendAsCreateMessageWithAccount::CMtfTestActionSendAsCreateMessageWithAccount(CMtfTestCase& aTestCase)
       
    75 	: CMtfSynchronousTestAction(aTestCase)
       
    76 	{
       
    77 	}
       
    78 
       
    79 /**
       
    80   Function : ~CMtfTestActionSendAsCreateMessageWithAccount
       
    81   Description : Destructor
       
    82   @internalTechnology
       
    83   @param :
       
    84   @return : 
       
    85   @pre 
       
    86   @post 
       
    87 */
       
    88 CMtfTestActionSendAsCreateMessageWithAccount::~CMtfTestActionSendAsCreateMessageWithAccount()
       
    89 	{
       
    90 	}
       
    91 	
       
    92 /**
       
    93   ExecuteActionL
       
    94   Obtains the parameters for the test action. Get the Message Id at given index. The Message 
       
    95   Id is stored as output parameters of this Test Action
       
    96   @internalTechnology 
       
    97   @pre    None
       
    98   @post   None
       
    99   @leave  System wide errors
       
   100 */
       
   101 void CMtfTestActionSendAsCreateMessageWithAccount::ExecuteActionL()
       
   102 	{
       
   103 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendAsCreateMessageWithAccount);
       
   104 	RSendAs paramSendAs	 = ObtainValueParameterL<RSendAs>(TestCase(),
       
   105 									ActionParameters().Parameter(0));
       
   106 	TSendAsAccount paramAccount = ObtainValueParameterL<TSendAsAccount>(TestCase(),
       
   107 									ActionParameters().Parameter(1));
       
   108 	RSendAsMessage sendAsMessage;
       
   109 
       
   110 	sendAsMessage.CreateL(paramSendAs, paramAccount);
       
   111 	
       
   112 	StoreParameterL<RSendAsMessage>(TestCase(),sendAsMessage,ActionParameters().Parameter(2));
       
   113 		
       
   114 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSendAsCreateMessageWithAccount);
       
   115 	TestCase().ActionCompletedL(*this);
       
   116 	}
       
   117