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