diff -r b46a585f6909 -r efe85016a067 contacts_plat/presence_cache_api/tsrc/mt_preseceqt/entitytests.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/presence_cache_api/tsrc/mt_preseceqt/entitytests.h Wed Jun 23 18:02:44 2010 +0300 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007, 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for presence cache reader and writer. +* +*/ + +#ifndef __ENTITY_TESTS_H__ +#define __ENTITY_TESTS_H__ + +#include +#include +#include + + +class PrcPresenceReader; +class PrcPresenceWriter; +class EntityTests : public QObject +{ +Q_OBJECT +public: + explicit EntityTests(QObject *parent = 0); + + + +private slots: // Init & cleanup + void initTestCase(); + void cleanupTestCase(); + void test1(); + void test2(); + void test3(); + void test4(); + void test5(); + void test6(); + void test7(); + void test8(); + +private: + void saveBuddy(QMap& map); + void fetchAndVerifyBuddy( QMap& map ); + void subscribeBuddy( QString &buddyId); + void unSubscribeBuddy( QString &buddyId); + PrcPresenceBuddyInfoQt* createBuddyForWriting(QMap& map); + void CheckServices(int nbrServices,int nbrBuddies); + void CheckOneService(QString service,int buddiesInService); + + PrcPresenceBuddyInfoQt::AvailabilityValues getAvailbility(QString aval); + void fetchAllBuddiesInService(QString service, int numberofbuddies ); + +public slots: +void handlePresenceNotificationInClient(bool succcess, PrcPresenceBuddyInfoQt* aPresenceBuddyInfo); +void handlePresenceReadInClient(bool success, QList buddyInfoList); +void handlePresencewriteInclient(bool success); + +private: //data + PrcPresenceWriter* iWriter; + PrcPresenceReader* iReader; +private: + + static QString K_Buddy ; + static QString K_Atext ; + static QString K_Avalue ; + static QString K_Newkey ; + static QString K_Newvalue ; + static QString K_Avatar ; + static QString K_Statustext ; + QMap iMapDataForAsyncTest; + bool iNotificationReceived ; + int iNumberOfBuddiesInService; + QList iBuddiesInService; +}; + +#endif // __ENTITY_TESTS_H__