|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #ifndef __APPFWK_TEST_UTILS_SERVER_H__ |
|
23 #define __APPFWK_TEST_UTILS_SERVER_H__ |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <f32file.h> |
|
27 |
|
28 enum TTestPanic |
|
29 { |
|
30 ETestPanicBadDescriptor, |
|
31 ETestPanicIllegalFunction, |
|
32 ETestPanicAlreadyReceiving |
|
33 }; |
|
34 |
|
35 void PanicClient(RMessage2& aMessage,TTestPanic TMyPanic); |
|
36 |
|
37 |
|
38 class CShutdown : public CTimer |
|
39 { |
|
40 enum {KMyShutdownDelay=0x200000}; // approx 2s |
|
41 public: |
|
42 inline CShutdown(); |
|
43 inline void ConstructL(); |
|
44 inline void Start(); |
|
45 private: |
|
46 void RunL(); |
|
47 }; |
|
48 |
|
49 |
|
50 class CSmlTestUtilsServer : public CServer2 |
|
51 { |
|
52 public: |
|
53 static CServer2* NewLC(); |
|
54 void AddSession(); |
|
55 void DropSession(); |
|
56 private: |
|
57 CSmlTestUtilsServer(); |
|
58 void ConstructL(); |
|
59 CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; |
|
60 private: |
|
61 TInt iSessionCount; |
|
62 CShutdown iShutdown; |
|
63 }; |
|
64 |
|
65 |
|
66 class CSmlTestUtilsSession : public CSession2 |
|
67 { |
|
68 public: |
|
69 CSmlTestUtilsSession(); |
|
70 void CreateL(); |
|
71 private: |
|
72 ~CSmlTestUtilsSession(); |
|
73 inline CSmlTestUtilsServer& Server(); |
|
74 void ServiceL(const RMessage2& aMessage); |
|
75 void ServiceError(const RMessage2& aMessage,TInt aError); |
|
76 inline TBool ReceivePending() const; |
|
77 private: |
|
78 TInt DoCreateDirectoryL(const RMessage2& aMessage); |
|
79 TInt DoRenameDirectoryL(const RMessage2& aMessage); |
|
80 TInt DoDeleteDirectoryL(const RMessage2& aMessage); |
|
81 TInt DoCreateFileL(const RMessage2& aMessage); |
|
82 TInt DoDeleteFileL(const RMessage2& aMessage); |
|
83 TInt DoDeleteFileUsingWildcardL(const RMessage2& aMessage); |
|
84 TInt DoCopyFileL(const RMessage2& aMessage); |
|
85 TInt DoReplaceFileL(const RMessage2& aMessage); |
|
86 TInt DoIsFilePresentL(const RMessage2& aMessage); |
|
87 TInt DoSetReadOnlyL(const RMessage2& aMessage); |
|
88 TInt DoGetAttL( const RMessage2& aMessage ); |
|
89 TInt DoSetAttL( const RMessage2& aMessage ); |
|
90 TInt DoCopyDirectoryL(const RMessage2& aMessage); |
|
91 TInt DoChangeFilePermissionL(const RMessage2& aMessage); |
|
92 private: |
|
93 RFs iFs; |
|
94 CFileMan* iFileMan; |
|
95 }; |
|
96 |
|
97 #endif //__APPFWK_TEST_UTILS_SERVER_H__ |