|
1 // Copyright (c) 2003-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 // CreateSmsService |
|
17 // [Action Parameters] |
|
18 // TDesC Service centre name <input> |
|
19 // TDesC Service centre number <input> |
|
20 // TInt default service centre index <output> |
|
21 // [Action Description] |
|
22 // Creates a SMS service and returns its TMsvId |
|
23 // [APIs Used] |
|
24 // __ACTION_INFO_END__ |
|
25 // |
|
26 // |
|
27 |
|
28 /** |
|
29 @file |
|
30 */ |
|
31 |
|
32 |
|
33 |
|
34 #include <csmsaccount.h> |
|
35 |
|
36 |
|
37 #include "CMtfTestCase.h" |
|
38 #include "CMtfTestActionParameters.h" |
|
39 |
|
40 #include "CMtfTestActionCreateSmsServiceCentre.h" |
|
41 |
|
42 |
|
43 |
|
44 CMtfTestAction* CMtfTestActionCreateSmsServiceCR::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
45 { |
|
46 CMtfTestActionCreateSmsServiceCR* self = new (ELeave) CMtfTestActionCreateSmsServiceCR(aTestCase); |
|
47 CleanupStack::PushL(self); |
|
48 self->ConstructL(aActionParameters); |
|
49 CleanupStack::Pop(); |
|
50 return self; |
|
51 } |
|
52 |
|
53 CMtfTestActionCreateSmsServiceCR::CMtfTestActionCreateSmsServiceCR(CMtfTestCase& aTestCase) |
|
54 : CMtfSynchronousTestAction(aTestCase) |
|
55 { |
|
56 } |
|
57 |
|
58 |
|
59 CMtfTestActionCreateSmsServiceCR::~CMtfTestActionCreateSmsServiceCR() |
|
60 { |
|
61 } |
|
62 |
|
63 void CMtfTestActionCreateSmsServiceCR::ExecuteActionL() |
|
64 { |
|
65 |
|
66 // TODO - this test action can be removed |
|
67 |
|
68 /* |
|
69 TDesC serviceCentreName = ActionParameters().Parameter(0); |
|
70 TDesC serviceCentreNumber = ActionParameters().Parameter(1); |
|
71 |
|
72 CSmsSettings *settings = CSmsSettings::NewLC(); |
|
73 CSmsAccount *account = CSmsAccount::NewLC(); |
|
74 |
|
75 |
|
76 |
|
77 TInt numSc = settings->S |
|
78 account->InitialiseDefaultSettingsL( *settings ); |
|
79 settings->AddServiceCenterL( serviceCentreName, serviceCentreNumber ); |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 account->SaveSettingsL( *settings ); |
|
85 |
|
86 TInt defaultServiceCentre = settings->DefaultServiceCenter(); |
|
87 |
|
88 CleanupStack::PopAndDestroy( 2, settings ); |
|
89 |
|
90 |
|
91 StoreParameter |
|
92 |
|
93 |
|
94 StoreParameterL<TInt>(TestCase(), defaultServiceCentre, ActionParameters().Parameter(2)); |
|
95 */ |
|
96 TestCase().INFO_PRINTF1( _L("CMtfTestActionCreateSmsServiceCR completed" ) ); |
|
97 TestCase().ActionCompletedL(*this); |
|
98 |
|
99 } |
|
100 |
|
101 |