ximpfw/tsrc/src/t_presencegroupmembermngt/t_presencegroupmembermngt.h
changeset 0 e6b17d312c8b
child 20 eedf17a17c27
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006 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: XIMP Framework Test Code 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef T_PRESENCEGROUPMEMBERMANAGEMENT_H
       
    19 #define T_PRESENCEGROUPMEMBERMANAGEMENT_H
       
    20 
       
    21 #include <ceunittestsuiteclass.h>
       
    22 #include <ximpbase.h>
       
    23 #include <presenceinfo.h>
       
    24 #include "prfwteststatuseventlistener.h"
       
    25 #include "prfwtestmessaging.h"
       
    26 
       
    27 class CXIMPTestContextWrapper;
       
    28 class CXIMPTestContextWrapperMgr;
       
    29 class CXIMPTestMessenger;
       
    30 class CPresentityGroupListEventImp;
       
    31 class CPresentityGroupContentEventImp;
       
    32 
       
    33 class T_PresenceGroupMemberManagement;
       
    34 
       
    35 class CXIMPTestListener;
       
    36 
       
    37 // function pointer to a method
       
    38 typedef void (T_PresenceGroupMemberManagement::* TXIMPCallBack )();
       
    39 
       
    40 /**
       
    41  * XIMP Framework Eunit tests.
       
    42  *
       
    43  * Tests for XIMP group member management services.
       
    44  *
       
    45  * @since S60 v4.0
       
    46  */
       
    47 class T_PresenceGroupMemberManagement : public CEUnitTestSuiteClass
       
    48     {
       
    49 
       
    50 public:
       
    51     static T_PresenceGroupMemberManagement* NewL();
       
    52     virtual ~T_PresenceGroupMemberManagement();
       
    53 
       
    54 
       
    55 private:
       
    56     T_PresenceGroupMemberManagement();
       
    57     void ConstructL();
       
    58 
       
    59 private:    // Test case functions
       
    60 
       
    61     void Setup_L();
       
    62     void SetupMultiple_L();
       
    63     void BindAllL();
       
    64     void Teardown();
       
    65     
       
    66     // destroy test case support things, which cannot
       
    67     // be known in Setup method.
       
    68     void TeardownTestSupport();
       
    69     
       
    70     void UnbindAllL();
       
    71 
       
    72     void T_SubUnsubGroupContent_Single_L();
       
    73     void T_SubUnsubGroupContent_Multi_L();
       
    74     void T_SubUnsubGroupContent_One_Multi_L();
       
    75     void T_SubUnsubGroupContent_All_Multi_L();
       
    76     void T_SubUnsubGroupContent_Altered_Single_L();
       
    77     void T_SubUnsubGroupContent_AlteredSame_Single_L();
       
    78     void T_UnsubscribeNonSubscribed_L();
       
    79     void T_AddGroupMembers_Single_L();
       
    80     void T_RemoveGroupMembers_Single_L();
       
    81     void T_RemoveGroupMembers_NonSub_Single_L();
       
    82     void T_RemoveGroupMembers_NonExist_Single_L();
       
    83     void T_UpdateGroupMembers_Single_L();
       
    84     void T_UpdateGroupMembers_NonSub_Single_L();
       
    85     void T_UpdateGroupMembers_NonExist_Single_L();
       
    86     void T_ExpireNonSubscribedData_L();
       
    87     void T_ExpireNonSubscribedDataUpdateMultiple_L();
       
    88 
       
    89     // variable test method support
       
    90     void T_GenericSubAndUnsubL( TXIMPCallBack& aCbFuncL );
       
    91 
       
    92     void T_EmptyFunc();
       
    93     void T_TestAddMembersL();
       
    94     void T_TestAddMembers_NonSub_L();
       
    95     void T_TestRemoveMembersL();
       
    96     void T_TestRemoveMembers_NonSub_L();
       
    97     void T_TestRemoveMembers_NonExisting_L();
       
    98     void T_TestUpdateMembers_L();
       
    99     void T_TestUpdateMembers_NonSub_L();
       
   100     void T_TestUpdateMembers_NonExisting_L();
       
   101 
       
   102 private:    // Test helpers
       
   103 
       
   104     void SetupListenerReqCompleteL( CXIMPTestContextWrapper* aWrapper, TXIMPTestStatusEventTemplate aEventType );
       
   105     void SetupListenerReqCompleteAllowEventsL( CXIMPTestContextWrapper* aWrapper, TXIMPTestStatusEventTemplate aEventTypes );
       
   106 
       
   107     // sometimes EUnit might eat e.g. an Access violation.
       
   108     // Call this method in the test case to break when it happens,
       
   109     // hopefully you will find the cause.
       
   110     void UseMyOwnExceptionHandler();
       
   111 
       
   112 private: // Test data
       
   113 
       
   114     /**
       
   115      * Eunit test case table declaration.
       
   116      */
       
   117     EUNIT_DECLARE_TEST_TABLE;
       
   118 
       
   119     // owned
       
   120     CXIMPTestContextWrapperMgr* iWrapperMgr;
       
   121 
       
   122     CActiveSchedulerWait* iASWait;
       
   123 
       
   124     // current group id
       
   125     // owned.
       
   126     MXIMPIdentity* iCurrentGrId;
       
   127 
       
   128     /**
       
   129      * Last received group content event.
       
   130      * Owned.
       
   131      */
       
   132     CPresentityGroupContentEventImp* iLastEvent;
       
   133 
       
   134     CXIMPTestListener* iListener2;
       
   135 
       
   136     // ETrue, if you want to skip group content subscription in generic
       
   137     // sub and unsub
       
   138     TBool iSkipSubscribe;
       
   139 
       
   140     // EFalse, if you want to skip group content unsubscription
       
   141     TBool iSkipUnsubscribe;
       
   142     };
       
   143 
       
   144 
       
   145 #endif      //  T_PRESENCEGROUPMEMBERMANAGEMENT_H
       
   146 
       
   147 
       
   148 
       
   149 // end of file
       
   150 
       
   151 
       
   152 
       
   153