|
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 // GetMessageAtIndex |
|
17 // [Action Parameters] |
|
18 // RSendAsMessage paramRSendAsMessage <input> : Reference of the RSendAsMessage object |
|
19 // TSendAsState paramSendAsState <input> : One of the enumerations of type TSendAsState |
|
20 // [Action Description] |
|
21 // Test Action is intended to get the progress information of message and the compare the |
|
22 // state of the message with the expected state. The expected state of the message is |
|
23 // provided as an input the Test Action. |
|
24 // [APIs Used] |
|
25 // RSendAsMessage::Progress () |
|
26 // __ACTION_INFO_END__ |
|
27 // |
|
28 // |
|
29 |
|
30 /** |
|
31 @file |
|
32 @internalTechnology |
|
33 */ |
|
34 |
|
35 // User include |
|
36 #include "CMtfTestActionVerifySendAsMessageState.h" |
|
37 #include "CMtfTestCase.h" |
|
38 #include "CMtfTestActionParameters.h" |
|
39 #include "sendas2.h" |
|
40 |
|
41 |
|
42 /** |
|
43 NewL() |
|
44 Constructs a CMtfTestActionVerifySendAsMessageState object. |
|
45 Uses two phase construction and leaves nothing on the CleanupStack. |
|
46 @internalTechnology |
|
47 @param aTestCase Test Case to which this Test Action belongs |
|
48 @param aActionParameters Action parameters, must not be NULL |
|
49 @return Created object of type CMtfTestActionVerifySendAsMessageState |
|
50 @pre None |
|
51 @post CMtfTestActionVerifySendAsMessageState object is created |
|
52 */ |
|
53 CMtfTestAction* CMtfTestActionVerifySendAsMessageState:: |
|
54 NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
55 { |
|
56 CMtfTestActionVerifySendAsMessageState* self = |
|
57 new (ELeave) CMtfTestActionVerifySendAsMessageState(aTestCase); |
|
58 |
|
59 CleanupStack::PushL(self); |
|
60 self->ConstructL(aActionParameters); |
|
61 CleanupStack::Pop(self); |
|
62 return self; |
|
63 } |
|
64 |
|
65 |
|
66 /** |
|
67 CMtfTestActionVerifySendAsMessageState constructor |
|
68 Calls the base class' constructor |
|
69 @internalTechnology |
|
70 @param aTestCase Test Case to which this Test Action belongs |
|
71 @pre None |
|
72 @post None |
|
73 */ |
|
74 CMtfTestActionVerifySendAsMessageState::CMtfTestActionVerifySendAsMessageState(CMtfTestCase& aTestCase) |
|
75 : CMtfSynchronousTestAction(aTestCase) |
|
76 { |
|
77 } |
|
78 |
|
79 /** |
|
80 Function : ~CMtfTestActionVerifySendAsMessageState |
|
81 Description : Destructor |
|
82 @internalTechnology |
|
83 @param : |
|
84 @return : |
|
85 @pre |
|
86 @post |
|
87 */ |
|
88 CMtfTestActionVerifySendAsMessageState::~CMtfTestActionVerifySendAsMessageState() |
|
89 { |
|
90 } |
|
91 |
|
92 /** |
|
93 ExecuteActionL |
|
94 Obtains the parameters for the test action. Create a TSendAsState type object |
|
95 @internalTechnology |
|
96 @pre None |
|
97 @post None |
|
98 @leave System wide errors |
|
99 */ |
|
100 void CMtfTestActionVerifySendAsMessageState::ExecuteActionL() |
|
101 { |
|
102 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionVerifySendAsMessageState); |
|
103 RSendAsMessage paramRSendAsMessage = ObtainValueParameterL<RSendAsMessage>(TestCase(), |
|
104 ActionParameters().Parameter(0)); |
|
105 |
|
106 CMsvSendOperation::TSendOperationState paramSendAsState = ObtainValueParameterL<CMsvSendOperation::TSendOperationState>(TestCase(), |
|
107 ActionParameters().Parameter(1)); |
|
108 |
|
109 TSendAsProgress sendAsProgress; |
|
110 paramRSendAsMessage.ProgressL(sendAsProgress); |
|
111 if (sendAsProgress.iState != paramSendAsState) |
|
112 { |
|
113 User::Leave(KErrGeneral); |
|
114 } |
|
115 |
|
116 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionVerifySendAsMessageState); |
|
117 TestCase().ActionCompletedL(*this); |
|
118 } |
|
119 |