|
51
|
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_PRESENCEGRANTREQUESTMANAGEMENT_H
|
|
|
19 |
#define T_PRESENCEGRANTREQUESTMANAGEMENT_H
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
// EXTERNAL INCLUDES
|
|
|
23 |
#include <platform/digia/eunit/ceunittestsuiteclass.h>
|
|
|
24 |
#include <platform/digia/eunit/EUnitDecorators.h>
|
|
|
25 |
|
|
|
26 |
#include <ximpbase.h>
|
|
|
27 |
#include "prfwteststatuseventlistener.h"
|
|
|
28 |
#include "prfwtestmessaging.h"
|
|
|
29 |
#include "ximpdatasubscriptionstateimp.h"
|
|
|
30 |
#include "presencetypehelpers.h"
|
|
|
31 |
|
|
|
32 |
class CXIMPTestContextWrapper;
|
|
|
33 |
class CXIMPTestContextWrapperMgr;
|
|
|
34 |
class CXIMPTestMessenger;
|
|
|
35 |
class CPresenceGrantRequestInfoImp;
|
|
|
36 |
class CPresenceGrantRequestListEventImp;
|
|
|
37 |
|
|
|
38 |
/**
|
|
|
39 |
* XIMP Framework Eunit tests.
|
|
|
40 |
*
|
|
|
41 |
* Tests for XIMP session management services.
|
|
|
42 |
*
|
|
|
43 |
* @since S60 v4.0
|
|
|
44 |
*/
|
|
|
45 |
class T_PresenceGrantRequestManagement : public CEUnitTestSuiteClass
|
|
|
46 |
{
|
|
|
47 |
|
|
|
48 |
public:
|
|
|
49 |
static T_PresenceGrantRequestManagement* NewL();
|
|
|
50 |
virtual ~T_PresenceGrantRequestManagement();
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
private:
|
|
|
54 |
T_PresenceGrantRequestManagement();
|
|
|
55 |
void ConstructL();
|
|
|
56 |
|
|
|
57 |
private: // Test case functions
|
|
|
58 |
|
|
|
59 |
void Setup_L();
|
|
|
60 |
void SetupMultiple_L();
|
|
|
61 |
void BindL();
|
|
|
62 |
void BindAllL();
|
|
|
63 |
void Teardown();
|
|
|
64 |
void UnbindL();
|
|
|
65 |
void UnbindAllL();
|
|
|
66 |
void SubscribeL();
|
|
|
67 |
void UnsubscribeL();
|
|
|
68 |
|
|
|
69 |
void T_SubscribeGrantRequestList_Single_L();
|
|
|
70 |
void T_SubscribeGrantRequestListRefresh_Single_L();
|
|
|
71 |
void T_SubscribeGrantRequestList_Multiple_L();
|
|
|
72 |
void T_HandlePresenceGrantRequestList_L();
|
|
|
73 |
void T_HandlePresenceGrantRequestReceivedObsoleted_L();
|
|
|
74 |
|
|
|
75 |
private: // Test helpers
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* Fake a server-originated (=mobile terminated) message.
|
|
|
79 |
* The message appears to adaptation and framework as if
|
|
|
80 |
* it came from the network. Uses only one group.
|
|
|
81 |
* @param aUri The URI of group
|
|
|
82 |
* @param aDispName The display name for the group
|
|
|
83 |
* @param aMsgType The message type for CXIMPTestFileSrvMsg
|
|
|
84 |
*/
|
|
|
85 |
void SendSrvMsgL(
|
|
|
86 |
const TDesC& aUri, const TDesC& aDispName,
|
|
|
87 |
TInt aMsgType );
|
|
|
88 |
|
|
|
89 |
// version for sending just the info instead of array
|
|
|
90 |
void SendSrvMsgInfoL(
|
|
|
91 |
const TDesC& aUri, const TDesC& aDispName,
|
|
|
92 |
TInt aMsgType );
|
|
|
93 |
/**
|
|
|
94 |
* Fake a server-originated message with empty content.
|
|
|
95 |
* Whether to use this depends on the event you expect.
|
|
|
96 |
* @see SendSrvMsgL
|
|
|
97 |
*/
|
|
|
98 |
void SendSrvMsgL( TInt aMsgType );
|
|
|
99 |
|
|
|
100 |
// @see below
|
|
|
101 |
/*
|
|
|
102 |
enum TTestPGRArraySpecifier //Waqas: Not used anymore, use the next one
|
|
|
103 |
{
|
|
|
104 |
ETestPGRNewList = 0, // grant request list
|
|
|
105 |
ETestPGRNewReq, // new grant request
|
|
|
106 |
ETestPGRPending, // new grant request
|
|
|
107 |
ETestPGRObsoleted, // obsoleted grant request
|
|
|
108 |
ETestPGREmpty, // make an empty array for empty event
|
|
|
109 |
};*/
|
|
|
110 |
|
|
|
111 |
enum TTestPGROperation
|
|
|
112 |
{
|
|
|
113 |
ETestPGRNewReq = 0, // new grant request i.e. new req comes
|
|
|
114 |
ETestPGRPending, // new grant request i.e. subscribe to
|
|
|
115 |
ETestPGRObsoleted // obsoleted grant request i.e. req expired
|
|
|
116 |
};
|
|
|
117 |
|
|
|
118 |
/**
|
|
|
119 |
* Creates an event for newRequest, pending, or obselete presence grant
|
|
|
120 |
* request list. The caller provides an identity and current presence grant
|
|
|
121 |
* request listand depending on the provided operation an event is created.
|
|
|
122 |
*
|
|
|
123 |
* In cleanupstack there are 4 items, FIFO:
|
|
|
124 |
* - new list
|
|
|
125 |
* - pending list
|
|
|
126 |
* - obsoleted list
|
|
|
127 |
* - event imp
|
|
|
128 |
*
|
|
|
129 |
* This is because this event won't take ownership to the arrays
|
|
|
130 |
* when created this way.
|
|
|
131 |
*
|
|
|
132 |
* @param aUri Uri
|
|
|
133 |
* @param aDispName Displayname
|
|
|
134 |
* @param aOperation operation for which caller wants to generates event
|
|
|
135 |
* @param aPendingList Current pending list provided by caller, method takes
|
|
|
136 |
* ownership of the pending list, and it is included in above 3 lists.
|
|
|
137 |
* a NULL pointer with operation ETestPGRPending causes empty event.
|
|
|
138 |
* @return The suitably filled event.
|
|
|
139 |
*/
|
|
|
140 |
CPresenceGrantRequestListEventImp* CreateGrantRequestListEventLCX(
|
|
|
141 |
const TDesC& aUri,
|
|
|
142 |
const TDesC& aDispName,
|
|
|
143 |
MXIMPDataSubscriptionState::TSubscriptionState aSubscriptionState,
|
|
|
144 |
MXIMPDataSubscriptionState::TDataState aDataState,
|
|
|
145 |
TTestPGROperation aOperation,
|
|
|
146 |
RPrGrntReqInfoImpArray* aPendingList = NULL
|
|
|
147 |
);
|
|
|
148 |
|
|
|
149 |
private: // Test data
|
|
|
150 |
|
|
|
151 |
/**
|
|
|
152 |
* Eunit test case table declaration.
|
|
|
153 |
*/
|
|
|
154 |
EUNIT_DECLARE_TEST_TABLE;
|
|
|
155 |
|
|
|
156 |
// owned
|
|
|
157 |
CXIMPTestContextWrapperMgr* iWrapperMgr;
|
|
|
158 |
|
|
|
159 |
//
|
|
|
160 |
TInt iLastError;
|
|
|
161 |
RXIMPObjOwningPtrArray< CPresenceGrantRequestInfoImp > iValidateArray;
|
|
|
162 |
};
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
#endif // T_PRESENCEGRANTREQUESTMANAGEMENT_H
|
|
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
|
169 |
// end of file
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|