|
1 // Copyright (c) 2005-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 // The following test case is used to test whether the group name specified in the registration file |
|
15 // is "overridden" by the group name specified in the localisable resource file |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 |
|
25 #include "testableapalssession.h" |
|
26 #include <apaid.h> |
|
27 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
28 #include <apaidpartner.h> |
|
29 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
30 #include "T_groupNametest.h" |
|
31 #include "apparctestserver.h" |
|
32 #include <test/testexecutestepbase.h> |
|
33 |
|
34 // CT_GroupNameStep |
|
35 |
|
36 const TUid KUidTGroupName={0x10208185}; |
|
37 |
|
38 /** |
|
39 Constructor |
|
40 */ |
|
41 CT_GroupNameStep::CT_GroupNameStep() |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 /** |
|
47 Destructor |
|
48 */ |
|
49 CT_GroupNameStep::~CT_GroupNameStep() |
|
50 { |
|
51 } |
|
52 |
|
53 |
|
54 /** |
|
55 @SYMTestCaseID T-GroupNameStep-DoTestGroupNameL |
|
56 |
|
57 @SYMPREQ |
|
58 |
|
59 @SYMTestCaseDesc T_groupname to test the Groupname in localisable resource file |
|
60 |
|
61 @SYMTestPriority High |
|
62 |
|
63 @SYMTestStatus Implemented |
|
64 |
|
65 @SYMTestActions |
|
66 It connects to the Application Architecture server to perform the |
|
67 following: |
|
68 To test whether the group name specified in the registration file |
|
69 is "overridden" by the group name specified in the localisable resource file |
|
70 It calls the following function to get information about the groupname. |
|
71 RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n |
|
72 After the call Succeeds call the RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n |
|
73 with the KNullUid . The Retrun value is KErrNotFound. |
|
74 |
|
75 |
|
76 @SYMTestExpectedResults |
|
77 GetAppCapability should return the groupname |
|
78 defined in the application's localisable resource file. |
|
79 |
|
80 */ |
|
81 void CT_GroupNameStep::DoTestGroupNameL(RApaLsSession& aLs) |
|
82 { |
|
83 TApaAppCapabilityBuf cbuf; |
|
84 TApaAppCapability capability; |
|
85 |
|
86 // To read the groupname defined in localisable resource file |
|
87 |
|
88 TInt err = aLs.GetAppCapability(cbuf,KUidTGroupName); |
|
89 TEST(err == KErrNone); |
|
90 |
|
91 |
|
92 TEST(aLs.GetAppCapability(cbuf,KNullUid) == KErrNotFound); |
|
93 |
|
94 //since the value was kErrNotFound, the value of cbuf is unaltered |
|
95 capability = cbuf(); |
|
96 _LIT(KGroupname,"Loc_groupname"); |
|
97 |
|
98 TEST(capability.iGroupName == KGroupname); |
|
99 |
|
100 } |
|
101 |
|
102 /** |
|
103 @return - TVerdict code |
|
104 Override of base class virtual |
|
105 */ |
|
106 TVerdict CT_GroupNameStep::doTestStepL() |
|
107 { |
|
108 INFO_PRINTF1(_L(" Test Started")); |
|
109 |
|
110 //To test whether the group name specified in the registration file |
|
111 //is "overridden" by the group name specified in the localisable resource file |
|
112 |
|
113 RTestableApaLsSession ls; |
|
114 TEST(KErrNone == ls.Connect()); |
|
115 CleanupClosePushL(ls); |
|
116 |
|
117 HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestGroupNameL(ls), NO_CLEANUP); |
|
118 |
|
119 CleanupStack::PopAndDestroy(&ls); |
|
120 |
|
121 INFO_PRINTF1(_L(" TEST Finished")); |
|
122 |
|
123 return TestStepResult(); |
|
124 |
|
125 } |
|
126 |
|
127 |
|
128 |
|
129 |