sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
@test
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#if !(defined UPS_TEST_CLIENT_H)
|
sl@0
|
25 |
#define UPS_TEST_CLIENT_H
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <e32base.h>
|
sl@0
|
28 |
#include <test/tefexportconst.h>
|
sl@0
|
29 |
#include <ups/upsclient.h>
|
sl@0
|
30 |
|
sl@0
|
31 |
enum {
|
sl@0
|
32 |
EUpsTest_ConnectServer,
|
sl@0
|
33 |
EUpsTest_UseTestService, // Simulates the use of a service provided by the test system server.
|
sl@0
|
34 |
EUpsTest_OpenSession, // Opens subsession to test system server.
|
sl@0
|
35 |
EUpsTest_CloseSession, // Closes subsession to test system server.
|
sl@0
|
36 |
EUpsTest_GetServerSid, // returns sid of server.
|
sl@0
|
37 |
};
|
sl@0
|
38 |
|
sl@0
|
39 |
class TUpsTestServiceRequestData
|
sl@0
|
40 |
{
|
sl@0
|
41 |
public:
|
sl@0
|
42 |
inline TUpsTestServiceRequestData();
|
sl@0
|
43 |
TBool iOpaquePresent;
|
sl@0
|
44 |
TBuf8<50> iOpaqueData;
|
sl@0
|
45 |
TBool iMeasureResponceTime;
|
sl@0
|
46 |
TUid iServiceUid;
|
sl@0
|
47 |
TBuf<60> iDestination;
|
sl@0
|
48 |
TBool iCancelRequest;
|
sl@0
|
49 |
TBool iPlatSecPass;
|
sl@0
|
50 |
};
|
sl@0
|
51 |
|
sl@0
|
52 |
inline TUpsTestServiceRequestData::TUpsTestServiceRequestData():
|
sl@0
|
53 |
iOpaquePresent(0),iOpaqueData(0),iMeasureResponceTime(0),iServiceUid(TUid::Uid(0)),iDestination(0),iCancelRequest(0),iPlatSecPass(0)
|
sl@0
|
54 |
{
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
|
sl@0
|
58 |
|
sl@0
|
59 |
class TUpsTestServiceReturn
|
sl@0
|
60 |
{
|
sl@0
|
61 |
public:
|
sl@0
|
62 |
inline TUpsTestServiceReturn();
|
sl@0
|
63 |
TUpsDecision iDecision;
|
sl@0
|
64 |
TInt iError;
|
sl@0
|
65 |
TBuf<50> iErrorMessage;
|
sl@0
|
66 |
TUint32 iRequestDuration;
|
sl@0
|
67 |
};
|
sl@0
|
68 |
|
sl@0
|
69 |
inline TUpsTestServiceReturn::TUpsTestServiceReturn():
|
sl@0
|
70 |
iDecision(TUpsDecision(EUpsDecNo)),iError(0),iErrorMessage(0)
|
sl@0
|
71 |
{
|
sl@0
|
72 |
}
|
sl@0
|
73 |
|
sl@0
|
74 |
class RUpsTestServ : public RSessionBase
|
sl@0
|
75 |
|
sl@0
|
76 |
{
|
sl@0
|
77 |
public:
|
sl@0
|
78 |
IMPORT_C TInt Connect(const TDesC& aServerName, TBool aDebugMode = EFalse);
|
sl@0
|
79 |
IMPORT_C const TDesC& ServerName() const;
|
sl@0
|
80 |
protected:
|
sl@0
|
81 |
private:
|
sl@0
|
82 |
RLibrary iLibrary;
|
sl@0
|
83 |
TBuf<KMaxTestExecuteNameLength> iServerName;
|
sl@0
|
84 |
TVersion Version() const;
|
sl@0
|
85 |
};
|
sl@0
|
86 |
|
sl@0
|
87 |
class RUpsTestSession : public RSubSessionBase
|
sl@0
|
88 |
|
sl@0
|
89 |
{
|
sl@0
|
90 |
public:
|
sl@0
|
91 |
IMPORT_C TInt Open(RUpsTestServ& aServ);
|
sl@0
|
92 |
IMPORT_C TInt UseTestService(TUpsTestServiceRequestData& aTestServiceRequestData,TUpsTestServiceReturn& aServiceCompoundReturn);
|
sl@0
|
93 |
IMPORT_C void Close(void);
|
sl@0
|
94 |
IMPORT_C TInt GetServerSid();
|
sl@0
|
95 |
IMPORT_C void ShutdownUPS(void);
|
sl@0
|
96 |
protected:
|
sl@0
|
97 |
|
sl@0
|
98 |
|
sl@0
|
99 |
private:
|
sl@0
|
100 |
|
sl@0
|
101 |
|
sl@0
|
102 |
};
|
sl@0
|
103 |
|
sl@0
|
104 |
#endif
|