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