messagingfw/msgtestfw/TestActions/SendAs/src/CMtfTestActionSendAsCloseMessage.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 // SendAsCloseMessage
       
    17 // [Action Parameters]
       
    18 // RSendAsMessage	sendAsMessage	<input> : Reference to the RSendAsMessage object
       
    19 // [Action Description]
       
    20 // Close the RSendAsMessage object.  If a message is created with the RSendAsMessage
       
    21 // object and is not sent, closing the RSendAsMesssage object leaves the message in
       
    22 // the local Drafts folder.
       
    23 // [APIs Used]
       
    24 // RSendAsMessage::Close()
       
    25 // __ACTION_INFO_END__
       
    26 // 
       
    27 //
       
    28 
       
    29 /**
       
    30  @file 
       
    31  @internalTechnology 
       
    32 */
       
    33 
       
    34 
       
    35 // User include
       
    36 #include "CMtfTestActionSendAsCloseMessage.h"
       
    37 #include "CMtfTestCase.h"
       
    38 #include "CMtfTestActionParameters.h"
       
    39 
       
    40 
       
    41 /**
       
    42   NewL()
       
    43   Constructs a CMtfTestActionSendAsCloseMessage object.
       
    44   Uses two phase construction.
       
    45   @internalTechnology
       
    46   @param  aTestCase				Test Case to which this Test Action belongs
       
    47   @param  aActionParameters		Test Action parameters, must not be NULL
       
    48   @return Created object of type CMtfTestActionSendAsCloseMessage
       
    49   @pre    None
       
    50   @post   None
       
    51 */
       
    52 CMtfTestAction* CMtfTestActionSendAsCloseMessage::
       
    53 		NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    54 	{
       
    55 	CMtfTestActionSendAsCloseMessage* self = 
       
    56 							new (ELeave) CMtfTestActionSendAsCloseMessage(aTestCase);
       
    57 
       
    58 	CleanupStack::PushL(self);
       
    59 	self->ConstructL(aActionParameters);
       
    60 	CleanupStack::Pop(self);
       
    61 	return self;
       
    62 	}
       
    63 	
       
    64 
       
    65 /**
       
    66   CMtfTestActionSendAsCloseMessage constructor
       
    67   Calls the base class' constructor
       
    68   @internalTechnology  
       
    69   @param  aTestCase  Test Case to which this Test Action belongs
       
    70   @pre    None
       
    71   @post   None
       
    72 */ 
       
    73 CMtfTestActionSendAsCloseMessage::CMtfTestActionSendAsCloseMessage(CMtfTestCase& aTestCase)
       
    74 	: CMtfSynchronousTestAction(aTestCase)
       
    75 	{
       
    76 	}
       
    77 
       
    78 /**
       
    79   Function : ~CMtfTestActionSendAsCloseMessage
       
    80   Description : Destructor
       
    81   @internalTechnology
       
    82   @pre None
       
    83   @post None
       
    84 */
       
    85 CMtfTestActionSendAsCloseMessage::~CMtfTestActionSendAsCloseMessage()
       
    86 	{
       
    87 	}
       
    88 	
       
    89 /**
       
    90   ExecuteActionL
       
    91   Close the RSendAsMessage
       
    92   @internalTechnology 
       
    93   @pre    None
       
    94   @post   None
       
    95   @leave  None
       
    96 */
       
    97 void CMtfTestActionSendAsCloseMessage::ExecuteActionL()
       
    98 	{
       
    99 	if((TestCase().TestStepResult()) == EPass)
       
   100 		{
       
   101 		TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendAsCloseMessage);
       
   102 			
       
   103 		RSendAsMessage paramSendAsMessage = ObtainValueParameterL<RSendAsMessage>
       
   104 											(TestCase(), ActionParameters().Parameter(0));
       
   105 		paramSendAsMessage.Close();
       
   106 
       
   107 		TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSendAsCloseMessage);
       
   108 		}
       
   109 
       
   110 	TestCase().ActionCompletedL(*this);
       
   111 	}