authenticationservices/authenticationserver/test/securitytests/source/authreaduseranddevicedata.cpp
changeset 102 deec7e509f66
parent 94 0e6c5a9328b5
child 108 ca9a0fc2f082
equal deleted inserted replaced
94:0e6c5a9328b5 102:deec7e509f66
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "authreaduseranddevicedata.h"
       
    21 
       
    22 #include <authserver/authclient.h>
       
    23 #include <authserver/authmgrclient.h>
       
    24 #include <e32def.h>
       
    25 
       
    26 _LIT(KAuthReadUserAndDeviceDataSecName, "Auth ReadUserAndDeviceDeviceData APIs test");
       
    27 
       
    28 using namespace AuthServer;
       
    29 
       
    30 CAuthReadUserAndDeviceDataSecTest* CAuthReadUserAndDeviceDataSecTest::NewL()
       
    31 	{
       
    32 	CAuthReadUserAndDeviceDataSecTest* self=new(ELeave) CAuthReadUserAndDeviceDataSecTest();
       
    33 	CleanupStack::PushL(self);
       
    34 	self->ConstructL();
       
    35 	CleanupStack::Pop(self);
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 CAuthReadUserAndDeviceDataSecTest::CAuthReadUserAndDeviceDataSecTest()
       
    40 	{
       
    41 	SetCapabilityRequired(ECapabilityReadUserData);
       
    42 	SetCapabilityRequired(ECapabilityReadDeviceData);	
       
    43 	}
       
    44 	
       
    45 void CAuthReadUserAndDeviceDataSecTest::ConstructL()
       
    46 	{
       
    47 	SetNameL(KAuthReadUserAndDeviceDataSecName);
       
    48 	}
       
    49 
       
    50 void CAuthReadUserAndDeviceDataSecTest::RunTestL()
       
    51 	{
       
    52 	AuthServer::RAuthMgrClient authMgrClient;	
       
    53 	User::LeaveIfError(authMgrClient.Connect());
       
    54 	CleanupClosePushL(authMgrClient);
       
    55 
       
    56 	TInt err(0);
       
    57 	
       
    58 	RIdAndStringArray idWithString;
       
    59 	TRAP(err, authMgrClient.IdentitiesWithStringL(idWithString));
       
    60 	idWithString.Close();
       
    61 	CheckFailL(err, _L("AuthServer::IdentitiesWithStringL()."));
       
    62 	
       
    63 	CleanupStack::PopAndDestroy(&authMgrClient);
       
    64 	}