messagingfw/msgtestfw/TestActions/Sms/src/CMtfTestActionInitialiseSmsDefaultSettings.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 // InitialiseSmsDefaultSettings
       
    17 // [Action Parameters]
       
    18 // smsSettings     		output	 CSmsSettings
       
    19 // [Action Description]
       
    20 // Creates an SMS service entry in central repository, sets all settings to 
       
    21 // default values and returns a CSmsSettings object populated with the settings.
       
    22 // [APIs Used]
       
    23 // CSMSAccount::InitialiseDefaultSettingsL
       
    24 // __ACTION_INFO_END__
       
    25 // 
       
    26 //
       
    27 
       
    28 /**
       
    29  @file
       
    30 */
       
    31 
       
    32 #include <csmsaccount.h>
       
    33 
       
    34 #include "CMtfTestCase.h"
       
    35 #include "CMtfTestActionParameters.h"
       
    36 #include "CMtfTestActionInitialiseSmsDefaultSettings.h"
       
    37 
       
    38 
       
    39 /**
       
    40   Function : NewL
       
    41   Description : 
       
    42   @internalTechnology
       
    43   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    44   @param : aActionParams - CMtfTestActionParameters 
       
    45   @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionInitialiseSmsDefaultSettings object
       
    46   @pre none
       
    47   @post none
       
    48 */
       
    49 CMtfTestAction* CMtfTestActionInitialiseSmsDefaultSettings::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    50 {
       
    51 	CMtfTestActionInitialiseSmsDefaultSettings* self = new (ELeave) CMtfTestActionInitialiseSmsDefaultSettings(aTestCase);
       
    52 	CleanupStack::PushL(self);
       
    53 	self->ConstructL(aActionParameters);
       
    54 	CleanupStack::Pop();
       
    55 	return self;
       
    56 }
       
    57 
       
    58 /**
       
    59   Function : CMtfTestActionInitialiseSmsDefaultSettings
       
    60   Description : Constructor
       
    61   @internalTechnology
       
    62   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    63   @return : N/A
       
    64   @pre none
       
    65   @post none
       
    66 */
       
    67 CMtfTestActionInitialiseSmsDefaultSettings::CMtfTestActionInitialiseSmsDefaultSettings(CMtfTestCase& aTestCase)
       
    68 	: CMtfSynchronousTestAction(aTestCase)
       
    69 {
       
    70 	
       
    71 }
       
    72 
       
    73 /**
       
    74   Function : ~CMtfTestActionInitialiseSmsDefaultSettings
       
    75   Description : Destructor
       
    76   @internalTechnology
       
    77   @param :
       
    78   @return : 
       
    79   @pre 
       
    80   @post 
       
    81 */
       
    82 CMtfTestActionInitialiseSmsDefaultSettings::~CMtfTestActionInitialiseSmsDefaultSettings()
       
    83 {
       
    84 	
       
    85 }
       
    86 
       
    87 /**
       
    88   Function : ExecuteActionL
       
    89   Description : Entry point for the this test action in the test framework
       
    90   @internalTechnology
       
    91   @param : none
       
    92   @return : void
       
    93   @pre none 
       
    94   @post none
       
    95 */
       
    96 void CMtfTestActionInitialiseSmsDefaultSettings::ExecuteActionL()
       
    97 {
       
    98 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionInitialiseSmsDefaultSettings);
       
    99 	CSmsSettings* smsSettings = CSmsSettings::NewL();
       
   100 	CleanupStack::PushL(smsSettings);
       
   101 	
       
   102 	CSmsAccount* smsAccount = CSmsAccount::NewL();
       
   103 	CleanupStack::PushL(smsAccount);
       
   104 	
       
   105 	smsAccount->InitialiseDefaultSettingsL(*smsSettings);
       
   106 	StoreParameterL<CSmsSettings>(TestCase(), *smsSettings, ActionParameters().Parameter(0));
       
   107 	
       
   108 	CleanupStack::PopAndDestroy(smsAccount);
       
   109 	CleanupStack::Pop(smsSettings); 
       
   110 
       
   111 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionInitialiseSmsDefaultSettings);
       
   112 	TestCase().ActionCompletedL(*this);
       
   113 }
       
   114