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