|
1 /* |
|
2 * Copyright (c) 2002 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 the License "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: ?Description* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef IPTVTESTECGFILEOBSERVER_H |
|
21 #define IPTVTESTECGFILEOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <StifLogger.h> |
|
25 #include <TestScripterInternal.h> |
|
26 #include <StifTestModule.h> |
|
27 |
|
28 #include <f32file.h> |
|
29 #include <BAUTILS.H> |
|
30 #include "MTestUtilDownloadObserver.h" |
|
31 |
|
32 // CONSTANTS |
|
33 // Logging path |
|
34 _LIT( KIptvTestEcgFileObserverLogPath, "\\logs\\testframework\\IptvTestEcgFileObserver\\" ); |
|
35 // Log file |
|
36 _LIT( KIptvTestEcgFileObserverLogFile, "IptvTestEcgFileObserver.txt" ); |
|
37 _LIT( KIptvTestEcgFileObserverLogFileWithTitle, "IptvTestEcgFileObserver_[%S].txt" ); |
|
38 |
|
39 // DATA TYPES |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CIptvTestUtilModule; |
|
43 class CIptvTestUtilities; |
|
44 class CTestUtilConnection; |
|
45 class CTestUtilConnectionWaiter; |
|
46 class CIptvTestDownloadManager; |
|
47 class CIptvTestMobilecrashWatcher; |
|
48 class CIptvTestEcgFileObserver; |
|
49 |
|
50 // CLASS DECLARATION |
|
51 |
|
52 /** |
|
53 * CIptvTestEcgFileObserver test class for STIF Test Framework TestScripter. |
|
54 * ?other_description_lines |
|
55 * |
|
56 * @lib ?library |
|
57 * @since ?Series60_version |
|
58 */ |
|
59 NONSHARABLE_CLASS(CIptvTestEcgFileObserver) : public CScriptBase, public MTestUtilDownloadObserver |
|
60 { |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 */ |
|
66 static CIptvTestEcgFileObserver* NewL( CTestModuleIf& aTestModuleIf ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CIptvTestEcgFileObserver(); |
|
72 |
|
73 public: // New functions |
|
74 |
|
75 public: // Functions from base classes |
|
76 |
|
77 /** |
|
78 * From CScriptBase Runs a script line. |
|
79 * @since ?Series60_version |
|
80 * @param aItem Script line containing method name and parameters |
|
81 * @return Symbian OS error code |
|
82 */ |
|
83 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
84 |
|
85 void ConnectionCreated(); |
|
86 void ConnectionClosed(); |
|
87 void ConnectionFailed(); |
|
88 void ConnectionAlreadyExists(); |
|
89 void ConnectionTimeout(); |
|
90 |
|
91 void DownloadFinished(TInt aError); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * C++ default constructor. |
|
97 */ |
|
98 CIptvTestEcgFileObserver( CTestModuleIf& aTestModuleIf ); |
|
99 |
|
100 /** |
|
101 * By default Symbian 2nd phase constructor is private. |
|
102 */ |
|
103 void ConstructL(); |
|
104 |
|
105 // Prohibit copy constructor if not deriving from CBase. |
|
106 // ?classname( const ?classname& ); |
|
107 // Prohibit assigment operator if not deriving from CBase. |
|
108 // ?classname& operator=( const ?classname& ); |
|
109 |
|
110 /** |
|
111 * Frees all resources allocated from test methods. |
|
112 * @since ?Series60_version |
|
113 */ |
|
114 void Delete(); |
|
115 |
|
116 /** |
|
117 * Test methods are listed below. |
|
118 */ |
|
119 |
|
120 /** |
|
121 * Start a download. |
|
122 */ |
|
123 virtual TInt DownloadL( CStifItemParser& aItem ); |
|
124 |
|
125 /** |
|
126 * Attemps to parse given address to a long test url. |
|
127 */ |
|
128 virtual TBool ParseAddress( TPtrC& aAddress ); |
|
129 |
|
130 /** |
|
131 * Sets the observed path for a service. |
|
132 * |
|
133 * @param service name. |
|
134 */ |
|
135 virtual TInt SetObservedServicePathL( CStifItemParser& aItem ); |
|
136 |
|
137 /** |
|
138 * Adds file to observed filelist. |
|
139 * |
|
140 * @param file name of thumbnail. |
|
141 */ |
|
142 virtual TInt AddObservedFilenameL( CStifItemParser& aItem ); |
|
143 |
|
144 /** |
|
145 * Gets and saves the last modified date for all the observed files. |
|
146 */ |
|
147 virtual TInt GetFileDateL( CStifItemParser& aItem ); |
|
148 |
|
149 /** |
|
150 * Gets the last modified date of the observed files and compares it to saved value. |
|
151 * |
|
152 * @param list of expected values for each file ( optional, default is false ) |
|
153 */ |
|
154 virtual TInt CheckFileDateL( CStifItemParser& aItem ); |
|
155 |
|
156 /** |
|
157 * Compares the existance of the observed files to the given value. |
|
158 * |
|
159 * @param list of expected values for each file ( optional, default is true ) |
|
160 */ |
|
161 virtual TInt CheckFileState( CStifItemParser& aItem ); |
|
162 |
|
163 /** |
|
164 * Synchronize system time with server time. |
|
165 */ |
|
166 virtual TInt SyncTimeWithServerL( CStifItemParser& aItem ); |
|
167 |
|
168 private: // Data |
|
169 HBufC* iObservedServicePath; |
|
170 RPointerArray<HBufC> iObservedFiles; |
|
171 RArray<TTime> iFileModifiedDates; |
|
172 RFs iFs; |
|
173 CIptvTestDownloadManager* iDownloadManager; |
|
174 }; |
|
175 |
|
176 #endif // IPTVTESTECGFILEOBSERVER_H |
|
177 |
|
178 // End of File |