appfw/apparchitecture/tef/T_groupNametest_ver1.cpp
changeset 0 2e3d3ce01487
child 19 924385140d98
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     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 groupname specified in the 
       
    15 // registration file is read if its not defined 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_ver1.h"
       
    31 #include "apparctestserver.h"
       
    32 #include <test/testexecutestepbase.h>
       
    33 
       
    34 // CT_GroupNameStep_ver1
       
    35 
       
    36 const TUid KUidTGroupName={0x10208183};
       
    37 
       
    38 /**
       
    39    Constructor
       
    40 */
       
    41 CT_GroupNameStep_ver1::CT_GroupNameStep_ver1()
       
    42 	{
       
    43 	}
       
    44 
       
    45 
       
    46 /**
       
    47   Destructor
       
    48 */
       
    49 CT_GroupNameStep_ver1::~CT_GroupNameStep_ver1()
       
    50 	{
       
    51 	}
       
    52 
       
    53 
       
    54 /**
       
    55    @SYMTestCaseID T-GroupNameStep-ver1-DoTestGroupNameL
       
    56   
       
    57    @SYMPREQ
       
    58 
       
    59    @SYMTestCaseDesc 
       
    60    T_groupname to test the Groupname in localisable resource file
       
    61    
       
    62    @SYMTestPriority High
       
    63    
       
    64    @SYMTestStatus Implemented
       
    65    
       
    66    @SYMTestActions
       
    67    It connects to the Application Architecture server to perform the following:
       
    68    To test whether the groupname defined in registration file is read if its
       
    69    not defined in the localisable resource file
       
    70    It calls the following function to get the information about the groupname.
       
    71    RApaLsSession::GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const\n
       
    72 
       
    73    @SYMTestExpectedResults
       
    74    GetAppCapability should return the groupname
       
    75    defined in the application's registration file.
       
    76  
       
    77  */
       
    78 void CT_GroupNameStep_ver1::DoTestGroupNameL(RApaLsSession& aLs)
       
    79 	{
       
    80 	TApaAppCapabilityBuf cbuf;
       
    81 	TApaAppCapability capability;
       
    82 	 
       
    83 	// To read the groupname defined in registration resource file
       
    84 
       
    85 	TInt err = aLs.GetAppCapability(cbuf,KUidTGroupName);
       
    86 	TEST(err == KErrNone);
       
    87 	capability = cbuf();
       
    88 	_LIT(KGroupname,"Reg_groupname");
       
    89 	
       
    90 	TEST(capability.iGroupName == KGroupname);
       
    91 	}
       
    92 
       
    93 /**
       
    94    @return - TVerdict code
       
    95    Override of base class virtual
       
    96  */
       
    97 TVerdict CT_GroupNameStep_ver1::doTestStepL()
       
    98 	{
       
    99 	INFO_PRINTF1(_L(" Test Started"));
       
   100 
       
   101 	RTestableApaLsSession ls;
       
   102 	TEST(KErrNone == ls.Connect());
       
   103 	CleanupClosePushL(ls);
       
   104 
       
   105     //To test whether the groupname defined in the 
       
   106 	//registration file is read if its not defined in localisable resource file
       
   107 
       
   108 	HEAP_TEST_LS_SESSION(ls, 0, 0, DoTestGroupNameL(ls), NO_CLEANUP);
       
   109 	
       
   110 	CleanupStack::PopAndDestroy(&ls);
       
   111 
       
   112 	INFO_PRINTF1(_L(" Test Finished"));
       
   113 		
       
   114 	return TestStepResult();
       
   115 
       
   116 	}
       
   117 
       
   118 
       
   119 
       
   120