diff -r 9f5ae1728557 -r db3f5fa34ec7 messagingfw/msgtestfw/TestActions/Sms/src/CMtfTestActionSetSmsServiceSettings.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingfw/msgtestfw/TestActions/Sms/src/CMtfTestActionSetSmsServiceSettings.cpp Wed Nov 03 22:41:46 2010 +0530
@@ -0,0 +1,103 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// __ACTION_INFO_BEGIN__
+// [Action Name]
+// SetSmsServiceSettings
+// [Action Parameters]
+// CMsvSession& Session : Reference to the session.
+// TMsvId ServiceId : Value of the SMS service id.
+// TInt Index : (optional) Selects what defaults file to use
+// [Action Description]
+// Modifies the settings of the specified SMS service to match the ones specified on a file.
+// The Messaging Test server will decide on what file to be used to read the settings from.
+// New settings are created if the SMS service doesn't have any settings saved.
+// [APIs Used]
+// CMsvEntry::EditStoreL
+// CSmsSettings::StoreL
+// CMsvStore::CommitL
+// __ACTION_INFO_END__
+//
+//
+
+/**
+ @file
+*/
+
+
+#include
+#include
+#include
+
+
+#include "CMtfTestActionSetSmsServiceSettings.h"
+#include "CMtfTestCase.h"
+#include "CMtfTestActionParameters.h"
+
+#include "CMtfTestActionUtilsSmsScripts.h"
+
+CMtfTestAction* CMtfTestActionSetSmsServiceSettings::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
+ {
+ CMtfTestActionSetSmsServiceSettings* self = new (ELeave) CMtfTestActionSetSmsServiceSettings(aTestCase);
+ CleanupStack::PushL(self);
+ self->ConstructL(aActionParameters);
+ CleanupStack::Pop();
+ return self;
+ }
+
+
+CMtfTestActionSetSmsServiceSettings::CMtfTestActionSetSmsServiceSettings(CMtfTestCase& aTestCase)
+ : CMtfSynchronousTestAction(aTestCase)
+ {
+ }
+
+
+CMtfTestActionSetSmsServiceSettings::~CMtfTestActionSetSmsServiceSettings()
+ {
+ }
+
+void CMtfTestActionSetSmsServiceSettings::ExecuteActionL()
+ {
+ TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSetSmsServiceSettings);
+ CMsvSession* paramSession = ObtainParameterReferenceL(TestCase(),ActionParameters().Parameter(0));
+ TMsvId paramSmsServiceId = ObtainValueParameterL(TestCase(),ActionParameters().Parameter(1));
+
+
+ TInt paramDefaultIndex = 0;
+ if(ActionParameters().Count() == 3)
+ {
+ paramDefaultIndex = ObtainValueParameterL(TestCase(),ActionParameters().Parameter(2));
+ }
+
+ // Get the settings file name from the test case
+ const TPtrC settingsFile = TestCase().GetConfigurationFileL(CMtfConfigurationType::EMtfSmsSettings, paramDefaultIndex);
+
+ // Create SMS settings from the file
+ CSmsSettings* smsSettings = CSmsSettings::NewL();
+ CleanupStack::PushL(smsSettings);
+
+ CSmsAccount* account = CSmsAccount::NewLC();
+ account->InitialiseDefaultSettingsL(*smsSettings);
+
+ // now override the settings with the config file contents
+ CMtfTestActionUtilsSmsScripts::ReadSmsSettingsFromConfigurationFileL(TestCase(), settingsFile, *smsSettings);
+
+ account->SaveSettingsL(*smsSettings);
+ CleanupStack::PopAndDestroy(2, smsSettings); // account smsSettings
+
+ TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSetSmsServiceSettings);
+ TestCase().ActionCompletedL(*this);
+ }
+
+
+