|
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 // CompareImapAccountId |
|
17 // [Action Parameters] |
|
18 // accountId1 input TIMAP4Account |
|
19 // accountId2 input TIMAP4Account |
|
20 // [Action Description] |
|
21 // CompareImapAccountId Test Action is intended to compare the IMAP account Ids. |
|
22 // [APIs Used] |
|
23 // none |
|
24 // __ACTION_INFO_END__ |
|
25 // |
|
26 // |
|
27 |
|
28 |
|
29 |
|
30 //#include <centralrepository.h> |
|
31 #include <cemailaccounts.h> |
|
32 |
|
33 #include "CMtfTestCase.h" |
|
34 #include "CMtfTestActionParameters.h" |
|
35 #include "CMtfTestActionCompareImapAccountId.h" |
|
36 |
|
37 |
|
38 /** |
|
39 Function : NewL |
|
40 Description : |
|
41 @internalTechnology |
|
42 @param : aTestCase - CMtfTestCase for the CMtfTestAction base class |
|
43 @param : aActionParams - CMtfTestActionParameters |
|
44 @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionCompareImapAccountId object |
|
45 @pre none |
|
46 @post none |
|
47 */ |
|
48 CMtfTestAction* CMtfTestActionCompareImapAccountId::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
49 { |
|
50 CMtfTestActionCompareImapAccountId* self = new (ELeave) CMtfTestActionCompareImapAccountId(aTestCase); |
|
51 CleanupStack::PushL(self); |
|
52 self->ConstructL(aActionParameters); |
|
53 CleanupStack::Pop(self); |
|
54 return self; |
|
55 } |
|
56 |
|
57 /** |
|
58 Function : ~CMtfTestActionCompareImapAccountId |
|
59 Description : Destructor |
|
60 @internalTechnology |
|
61 @param : |
|
62 @return : |
|
63 @pre |
|
64 @post |
|
65 */ |
|
66 CMtfTestActionCompareImapAccountId::~CMtfTestActionCompareImapAccountId() |
|
67 { |
|
68 } |
|
69 |
|
70 /** |
|
71 Function : CMtfTestActionCompareImapAccountId |
|
72 Description : Constructor |
|
73 @internalTechnology |
|
74 @param : aTestCase - CMtfTestCase for the CMtfTestAction base class |
|
75 @return : N/A |
|
76 @pre none |
|
77 @post none |
|
78 */ |
|
79 CMtfTestActionCompareImapAccountId::CMtfTestActionCompareImapAccountId(CMtfTestCase& aTestCase) : CMtfSynchronousTestAction(aTestCase) |
|
80 { |
|
81 } |
|
82 |
|
83 /** |
|
84 Function : ExecuteActionL |
|
85 Description : Entry point for the this test action in the test framework |
|
86 @internalTechnology |
|
87 @param : none |
|
88 @return : void |
|
89 @pre none |
|
90 @post none |
|
91 */ |
|
92 void CMtfTestActionCompareImapAccountId::ExecuteActionL() |
|
93 { |
|
94 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCompareImapAccountId); |
|
95 TImapAccount accountId1 = ObtainValueParameterL<TImapAccount>( TestCase(),ActionParameters().Parameter(0) ); |
|
96 TImapAccount accountId2 = ObtainValueParameterL<TImapAccount>( TestCase(),ActionParameters().Parameter(1) ); |
|
97 |
|
98 if (accountId1.iImapAccountId != accountId2.iImapAccountId) |
|
99 { |
|
100 // failed |
|
101 TestCase().ERR_PRINTF1(_L("IMAP accounts do not match !")); |
|
102 TestCase().SetTestStepResult(EFail); |
|
103 } |
|
104 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCompareImapAccountId); |
|
105 TestCase().ActionCompletedL(*this); |
|
106 |
|
107 } |
|
108 |