ximpfw/tsrc/tsrcutils/testcaseutils/prfwtestmessaging.h
changeset 0 e6b17d312c8b
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 prfwtestmessaging.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef T_PRFWTESTMESSAGING_H_
       
    20 #define T_PRFWTESTMESSAGING_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32property.h>
       
    24 
       
    25 // FIXME change this?
       
    26 // base UID for pubsub keys
       
    27 const TUid KXIMPTestPropertyCatBase = { 0x10012345 };
       
    28 
       
    29 enum TXIMPTestPropertyValues
       
    30     {
       
    31     // values for EXIMPPlgTestDeath
       
    32     EXIMPPrtValPluginDeathEmpty = 0,
       
    33     EXIMPPrtValPluginDeathDied = 1,
       
    34 
       
    35     // values for EXIMPTestPlgSessionLostStrategy
       
    36     EXIMPPrtValSessionLostEmpty = 0,
       
    37     EXIMPPrtValSessionLostReconnect,
       
    38     EXIMPPrtValSessionLostTeardown,
       
    39     EXIMPPrtValSessionLostReconnectExhaustAttempts,
       
    40 
       
    41     // values for EXIMPTestPlgBehaveGeneric
       
    42     EXIMPPrtValBehaveNothing = 0,           // do nothing
       
    43     };
       
    44 
       
    45 // pubsub keys
       
    46 enum TXIMPTestPropertyKeys
       
    47     {
       
    48     // meta things (message queue internal)
       
    49     EXIMPTestMetaPubSubDefined,             // pubsub stuff has been defined (1)
       
    50     EXIMPTestMetaPluginIndex,               // protocol plugin reads its index from this (-1=undefined)
       
    51 
       
    52     // p = plugin, h = host, t = test code.
       
    53     // direction also encoded into the property name
       
    54 
       
    55     // Instructions for plugin behaviour (t->p).
       
    56     // next call to plugin API method will cause the requested behavior (e.g. leave)
       
    57     EXIMPTestPlgBehaveLeave,            // leave with given code
       
    58     EXIMPTestPlgBehaveError,            // cause error with given code
       
    59 
       
    60     // boolean valued
       
    61     EXIMPTestPlgBehaveCloseHandle,      // abrupt close handle (1)
       
    62     EXIMPTestPlgBehaveInvalidReqId,     // complete next call with invalid req. id (1)
       
    63 
       
    64     // API method called -messages (p->t)
       
    65     // value is boolean (set or unset, 1 or 0)
       
    66     EXIMPPlgTestOpenSessionCalled,           // OpenSessionL
       
    67     EXIMPPlgTestShareSessionCalled,          // ShareSessionL
       
    68     EXIMPPlgTestUnshareSessionCalled,        // ShareSessionL
       
    69     EXIMPPlgTestCloseSessionCalled,          // CloseSessionL
       
    70     EXIMPPlgTestPublishPresenceCalled,       // PublishPresenceL
       
    71     EXIMPPlgTestUpdateInterestCalled,        // UpdatePresenceInterestL
       
    72     EXIMPPlgTestSubscribeOwnPresenceCalled,  // DoSubscribeOwnPresenceL
       
    73     EXIMPPlgTestUnsubscribeOwnPresenceCalled, // DoUnsubscribeOwnPresenceL
       
    74     EXIMPPlgTestUpdateOwnSubscriptionCalled, // DoUpdateOwnPresenceSubscriptionL
       
    75     EXIMPPlgTestSubscribeGroupListCalled,    // DoSubscribePresentityGroupListL
       
    76     EXIMPPlgTestUnsubscribeGroupListCalled,    // DoUnsubscribePresentityGroupListL
       
    77     EXIMPPlgTestCreatePresentityGroupCalled, // DoCreatePresentityGroupL
       
    78     EXIMPPlgTestDeletePresentityGroupCalled, // DoDeletePresentityGroupL
       
    79     EXIMPPlgTestUpdatePresentityGroupDisplayNameCalled, // DoUpdatePresentityGroupDisplayNameL
       
    80     EXIMPPlgTestSubscribePresentityPresesenceCalled,    // DoSubscribePresentityPresenceL
       
    81     EXIMPPlgTestUpdatePresentityPresesenceCalled,       // DoUpdatePresentityPresenceSubscriptionL
       
    82     EXIMPPlgTestUnsubscribePresentityPresesenceCalled,  // DoUnsubscribePresentityPresenceL
       
    83     EXIMPPlgTestSubscribePresentityGroupMembersPresesenceCalled,    // DoSubscribePresentityGroupMembersPresenceL
       
    84     EXIMPPlgTestUpdatePresentityGroupMembersPresesenceCalled,       // DoUpdatePresentityGroupMembersPresenceSubscriptionL
       
    85     EXIMPPlgTestUnsubscribePresentityGroupMembersPresesenceCalled,  // DoUnsubscribePresentityGroupMembersPresenceL
       
    86 
       
    87     EXIMPPlgTestSubscribePresentityGroupContentCalled,  // DoSubscribePresentityGroupContentL
       
    88     EXIMPPlgTestUnsubscribePresentityGroupContentCalled,  // DoUnsubscribePresentityGroupContentL
       
    89     EXIMPPlgTestAddPresentityGroupMemberCalled,  // DoAddPresentityGroupMemberL
       
    90     EXIMPPlgTestRemovePresentityGroupMemberCalled,  // DoRemovePresentityGroupMemberL
       
    91     EXIMPPlgTestUpdatePresentityGroupMemberDisplayNameCalled,  // DoUpdatePresentityGroupMemberDisplayNameL
       
    92     EXIMPPlgTestSubscribePresenceWatcherListCalled,     // DoSubscribePresenceWatcherListL
       
    93     EXIMPPlgTestUnsubscribePresenceWatcherListCalled,   // DoUnsubscribePresenceWatcherListL
       
    94 
       
    95     EXIMPPlgTestSubscribePresenceGrantRequestListCalled,    // DoSubscribePresenceGrantRequestListL
       
    96     EXIMPPlgTestUnsubscribePresenceGrantRequestListCalled,    // DoUnsubscribePresenceGrantRequestListL
       
    97 
       
    98     EXIMPPlgTestGrantPresenceForPresentityCalled,                   // EXIMPPlgTestGrantPresenceForPresentityCalled
       
    99     EXIMPPlgTestGrantPresenceForPresentityGroupMembersCalled,       // EXIMPPlgTestGrantPresenceForPresentityGroupMembersCalled
       
   100     EXIMPPlgTestGrantPresenceForEveryoneCalled,                   // EXIMPPlgTestGrantPresenceForEveryoneCalled
       
   101     EXIMPPlgTestUpdateGrantPresenceForPresentityCalled,             // EXIMPPlgTestUpdateGrantPresenceForPresentityCalled
       
   102     EXIMPPlgTestUpdateGrantPresenceForEveryoneCalled,             // EXIMPPlgTestUpdateGrantPresenceForEveryoneCalled
       
   103     EXIMPPlgTestUpdateGrantPresenceForPresentityGroupMembersCalled, // EXIMPPlgTestUpdateGrantPresenceForPresentityGroupMembersCalled
       
   104     EXIMPPlgTestWithdrawPresenceFromPresentityCalled,               // EXIMPPlgTestWithdrawPresenceFromPresentityCalled
       
   105     EXIMPPlgTestWithdrawPresenceFromPresentityGroupMembersCalled,   // EXIMPPlgTestWithdrawPresenceFromPresentityGroupMembersCalled
       
   106     EXIMPPlgTestWithdrawPresenceFromEveryoneCalled,               // EXIMPPlgTestWithdrawPresenceFromEveryoneCalled
       
   107     EXIMPPlgTestSubscribePresenceBlockListCalled,                   // EXIMPPlgTestSubscribePresenceBlockListCalled
       
   108     EXIMPPlgTestUnsubscribePresenceBlockListCalled,                  // EXIMPPlgTestUnubscribePresenceBlockListCalled
       
   109     EXIMPPlgTestBlockPresenceForPresentityCalled,                   // EXIMPPlgTestBlockPresenceForPresentityCalled
       
   110     EXIMPPlgTestCancelPresenceBlockFromPresentityCalled,            // EXIMPPlgTestCancelPresenceBlockFromPresentityCalled
       
   111     
       
   112     EXIMPPlgTestSubscribePresentityGroupListCalled,  // DoSubscribePresentityGroupListL
       
   113     EXIMPPlgTestUnsubscribePresentityGroupListCalled,  // DoUnsubscribePresentityGroupListL
       
   114     EXIMPPlgTestHandlePresentityGroupListCalled, //EXIMPPlgTestHandlePresentityGroupListCalled
       
   115     EXIMPPlgTestHandlePresentityPresenceCalled,   
       
   116     
       
   117 
       
   118 
       
   119     // For signaling some situations checked by adaptation
       
   120     EXIMPPlgTestExistsGroupContentInCache,              // Check if group content exists in cache.
       
   121 
       
   122     // signal Plg destruction (p->t)
       
   123     EXIMPPlgTestDeath,
       
   124 
       
   125     // simulate session lost with given strategy (t->p)
       
   126     EXIMPTestPlgSessionLostStrategy,
       
   127     };
       
   128 
       
   129 // T-class for internal use
       
   130 class TXIMPTestMsg
       
   131     {
       
   132 public:
       
   133     TXIMPTestPropertyKeys iKey;     // pubsub key
       
   134     TInt iVal;                      // pubsub value
       
   135     };
       
   136 
       
   137     /**
       
   138      * @param aIndex The index for the testing context
       
   139      * @param aDescription Description for failed test.
       
   140      * @param aModifier If EFalse, negate the test, thus checking for
       
   141      * publish presence NOT being called.
       
   142      * @param aDescription2 Description for negate failed test.
       
   143      */
       
   144 #define COMMONASSERT( aMsg, aKey, aDescription, aModifier, aDescription2 ) \
       
   145         { \
       
   146         TBool value = aMsg->GetBoolean( aKey ); \
       
   147         if( aModifier ) \
       
   148             { \
       
   149             EUNIT_ASSERT_DESC( value, aDescription ); \
       
   150             } \
       
   151         else if( !aDescription2 ) \
       
   152             { \
       
   153             EUNIT_ASSERT_DESC( value, "Description 2 not set." ); \
       
   154             } \
       
   155         else \
       
   156             { \
       
   157             EUNIT_ASSERT_DESC( !value, aDescription2 ); \
       
   158             } \
       
   159         }
       
   160 
       
   161 #endif // T_PRFWTESTMESSAGING_H_
       
   162 
       
   163