|
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 // LoadScheduleSendSettings |
|
17 // [Action Parameters] |
|
18 // scheduleSettings output CMsvScheduleSettings |
|
19 // offPeakTimes output CMsvOffPeakTimes |
|
20 // errorActions output CMsvSendErrorActions |
|
21 // sysAgentActions output CMsvSysAgentActions |
|
22 // [Action Description] |
|
23 // LoadScheduleSendSettings Test Action is intended to retrieve Schedule Send |
|
24 // settings from the central repository. |
|
25 // [APIs Used] |
|
26 // CSMSAccount::LoadSettingsL |
|
27 // __ACTION_INFO_END__ |
|
28 // |
|
29 // |
|
30 |
|
31 #include <msvsenderroraction.h> |
|
32 #include <msvsysagentaction.h> |
|
33 #include <msvoffpeaktime.h> |
|
34 #include <msvschedulesettings.h> |
|
35 #include <csmsaccount.h> |
|
36 |
|
37 #include "CMtfTestActionLoadScheduleSendSettings.h" |
|
38 #include "CMtfTestCase.h" |
|
39 #include "CMtfTestActionParameters.h" |
|
40 |
|
41 |
|
42 |
|
43 /** |
|
44 Function : NewL |
|
45 Description : |
|
46 @internalTechnology |
|
47 @param : aTestCase - CMtfTestCase for the CMtfTestAction base class |
|
48 @param : aActionParams - CMtfTestActionParameters |
|
49 @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionLoadScheduleSendSettings object |
|
50 @pre none |
|
51 @post none |
|
52 */ |
|
53 CMtfTestAction* CMtfTestActionLoadScheduleSendSettings::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
54 { |
|
55 CMtfTestActionLoadScheduleSendSettings* self = new (ELeave) CMtfTestActionLoadScheduleSendSettings(aTestCase); |
|
56 CleanupStack::PushL(self); |
|
57 self->ConstructL(aActionParameters); |
|
58 CleanupStack::Pop(self); |
|
59 return self; |
|
60 } |
|
61 |
|
62 /** |
|
63 Function : CMtfTestActionLoadScheduleSendSettings |
|
64 Description : Constructor |
|
65 @internalTechnology |
|
66 @param : aTestCase - CMtfTestCase for the CMtfTestAction base class |
|
67 @return : N/A |
|
68 @pre none |
|
69 @post none |
|
70 */ |
|
71 CMtfTestActionLoadScheduleSendSettings::CMtfTestActionLoadScheduleSendSettings(CMtfTestCase& aTestCase) : CMtfSynchronousTestAction(aTestCase) |
|
72 { |
|
73 } |
|
74 |
|
75 /** |
|
76 Function : ~CMtfTestActionLoadSmsSettings |
|
77 Description : Destructor |
|
78 @internalTechnology |
|
79 @param : |
|
80 @return : |
|
81 @pre |
|
82 @post |
|
83 */ |
|
84 CMtfTestActionLoadScheduleSendSettings::~CMtfTestActionLoadScheduleSendSettings() |
|
85 { |
|
86 } |
|
87 |
|
88 |
|
89 /** |
|
90 Function : ExecuteActionL |
|
91 Description : Entry point for the this test action in the test framework |
|
92 @internalTechnology |
|
93 @param : none |
|
94 @return : void |
|
95 @pre none |
|
96 @post none |
|
97 */ |
|
98 void CMtfTestActionLoadScheduleSendSettings::ExecuteActionL() |
|
99 { |
|
100 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionLoadScheduleSendSettings); |
|
101 CSmsAccount *smsAccount = CSmsAccount::NewL(); |
|
102 CleanupStack::PushL( smsAccount ); |
|
103 |
|
104 CMsvSysAgentActions *sysAgtActions = new (ELeave) CMsvSysAgentActions; |
|
105 CleanupStack::PushL( sysAgtActions ); |
|
106 |
|
107 CMsvSendErrorActions *sendErrorActions = CMsvSendErrorActions::NewL(); |
|
108 CleanupStack::PushL(sendErrorActions); |
|
109 |
|
110 CMsvOffPeakTimes *offPeakTimes = new (ELeave) CMsvOffPeakTimes; |
|
111 CleanupStack::PushL( offPeakTimes ); |
|
112 |
|
113 CMsvScheduleSettings *scheduleSettings = CMsvScheduleSettings::NewL(); |
|
114 CleanupStack::PushL( scheduleSettings ); |
|
115 |
|
116 smsAccount->LoadSettingsL( *scheduleSettings, *offPeakTimes, *sendErrorActions, *sysAgtActions ); |
|
117 |
|
118 StoreParameterL<CMsvScheduleSettings>(TestCase(), *scheduleSettings, ActionParameters().Parameter(0)); |
|
119 CleanupStack::Pop(scheduleSettings); |
|
120 |
|
121 StoreParameterL<CMsvOffPeakTimes>(TestCase(), *offPeakTimes, ActionParameters().Parameter(1)); |
|
122 CleanupStack::Pop(offPeakTimes); |
|
123 |
|
124 StoreParameterL<CMsvSendErrorActions>(TestCase(), *sendErrorActions, ActionParameters().Parameter(2)); |
|
125 CleanupStack::Pop(sendErrorActions); |
|
126 |
|
127 StoreParameterL<CMsvSysAgentActions>(TestCase(), *sysAgtActions, ActionParameters().Parameter(3)); |
|
128 CleanupStack::Pop(sysAgtActions); |
|
129 |
|
130 CleanupStack::PopAndDestroy(smsAccount); |
|
131 |
|
132 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionLoadScheduleSendSettings ); |
|
133 TestCase().ActionCompletedL(*this); |
|
134 |
|
135 } |
|
136 |
|
137 |