contacts_plat/presence_cache_api/tsrc/mt_preseceqt/entitytests.h
changeset 46 efe85016a067
child 81 640d30f4fb64
equal deleted inserted replaced
40:b46a585f6909 46:efe85016a067
       
     1 /*
       
     2 * Copyright (c) 2007, 2008 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 "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:  Implementation for presence cache reader and writer.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __ENTITY_TESTS_H__
       
    19 #define __ENTITY_TESTS_H__
       
    20 
       
    21 #include <QObject>
       
    22 #include <QMap>
       
    23 #include <prcpresencebuddyinfo_qt.h>
       
    24 
       
    25 
       
    26 class PrcPresenceReader;
       
    27 class PrcPresenceWriter;
       
    28 class EntityTests : public QObject
       
    29 {
       
    30 Q_OBJECT
       
    31 public:
       
    32     explicit EntityTests(QObject *parent = 0);
       
    33 
       
    34     
       
    35 
       
    36 private slots:  // Init & cleanup
       
    37         void initTestCase();
       
    38         void cleanupTestCase();
       
    39         void test1();
       
    40         void test2();
       
    41         void test3();
       
    42         void test4();
       
    43         void test5();
       
    44         void test6();
       
    45         void test7();
       
    46         void test8();
       
    47 
       
    48 private:
       
    49         void saveBuddy(QMap<QString,QString>& map);
       
    50         void fetchAndVerifyBuddy( QMap<QString,QString>& map );
       
    51         void  subscribeBuddy( QString &buddyId);
       
    52         void  unSubscribeBuddy( QString &buddyId);
       
    53         PrcPresenceBuddyInfoQt* createBuddyForWriting(QMap<QString,QString>& map);
       
    54         void CheckServices(int nbrServices,int nbrBuddies);
       
    55         void CheckOneService(QString service,int buddiesInService);
       
    56 
       
    57         PrcPresenceBuddyInfoQt::AvailabilityValues getAvailbility(QString aval);
       
    58         void fetchAllBuddiesInService(QString service, int numberofbuddies  );
       
    59 
       
    60 public slots:
       
    61 void handlePresenceNotificationInClient(bool succcess, PrcPresenceBuddyInfoQt* aPresenceBuddyInfo);
       
    62 void handlePresenceReadInClient(bool success, QList<PrcPresenceBuddyInfoQt*> buddyInfoList);
       
    63 void handlePresencewriteInclient(bool success);
       
    64 
       
    65 private: //data
       
    66         PrcPresenceWriter* iWriter;
       
    67         PrcPresenceReader* iReader;
       
    68 private:
       
    69 
       
    70    static QString K_Buddy ;
       
    71    static QString K_Atext ;
       
    72    static QString K_Avalue ;
       
    73    static QString K_Newkey ;
       
    74    static QString K_Newvalue ;
       
    75    static QString K_Avatar ;
       
    76    static  QString K_Statustext ;
       
    77    QMap<QString,QString> iMapDataForAsyncTest;
       
    78    bool iNotificationReceived ;
       
    79    int iNumberOfBuddiesInService;
       
    80    QList <QString> iBuddiesInService;
       
    81 };
       
    82 
       
    83 #endif // __ENTITY_TESTS_H__