53
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef APPREGEXEC_TEST_H
|
|
20 |
#define APPREGEXEC_TEST_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <StifLogger.h>
|
|
24 |
#include <TestScripterInternal.h>
|
|
25 |
#include <StifTestModule.h>
|
|
26 |
#include <TestclassAssert.h>
|
|
27 |
#include <e32std.h>
|
|
28 |
#include <f32file.h>
|
|
29 |
#include <bautils.h>
|
|
30 |
|
|
31 |
|
|
32 |
// MACROS
|
|
33 |
//#define ?macro ?macro_def
|
|
34 |
#define TEST_CLASS_VERSION_MAJOR 0
|
|
35 |
#define TEST_CLASS_VERSION_MINOR 0
|
|
36 |
#define TEST_CLASS_VERSION_BUILD 0
|
|
37 |
|
|
38 |
// Logging path
|
|
39 |
_LIT( KAppRegister_testLogPath, "\\logs\\testframework\\AppRegExec_test\\" );
|
|
40 |
// Log file
|
|
41 |
_LIT( KAppRegister_testLogFile, "AppRegExec_test.txt" );
|
|
42 |
_LIT( KAppRegister_testLogFileWithTitle, "AppRegExec_test_[%S].txt" );
|
|
43 |
|
|
44 |
_LIT(KMatchName,"AppRegExec.exe");
|
|
45 |
_LIT( KAppRegisterEXE,"C:\\Sys\\Bin\\AppRegExec.exe");
|
|
46 |
|
|
47 |
_LIT( KAppUnRegisterEXE,"C:\\Sys\\Bin\\AppUnRegister.exe");
|
|
48 |
_LIT( KTestDataEXE,"C:\\Sys\\Bin\\Hello3.exe");
|
|
49 |
_LIT( KTestDataRSC_SRC,"C:\\data\\Hello3_reg.RSC");
|
|
50 |
_LIT( KTestDataRSC_DST,"c:\\private\\10003a3f\\import\\apps\\Hello3_reg.RSC");
|
|
51 |
|
|
52 |
_LIT(KTestDataSessionPath,"C:\\logs\\");
|
|
53 |
_LIT(KTestDataFile,"stopmodetestdata.txt");
|
|
54 |
_LIT(KResourceSessionPath,"c:\\private\\10003a3f\\import\\apps\\");
|
|
55 |
_LIT(KResRegFile,"Hello3_reg.RSC");
|
|
56 |
|
|
57 |
|
|
58 |
// FORWARD DECLARATIONS
|
|
59 |
//class ?FORWARD_CLASSNAME;
|
|
60 |
class CAppRegExec_test;
|
|
61 |
|
|
62 |
|
|
63 |
/**
|
|
64 |
* CAppRegExec_test test class for STIF Test Framework TestScripter.
|
|
65 |
* ?other_description_lines
|
|
66 |
*
|
|
67 |
* @lib ?library
|
|
68 |
* @since ?Series60_version
|
|
69 |
*/
|
|
70 |
NONSHARABLE_CLASS(CAppRegExec_test) : public CScriptBase
|
|
71 |
{
|
|
72 |
public: // Constructors and destructor
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Two-phased constructor.
|
|
76 |
*/
|
|
77 |
static CAppRegExec_test* NewL( CTestModuleIf& aTestModuleIf );
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Destructor.
|
|
81 |
*/
|
|
82 |
virtual ~CAppRegExec_test();
|
|
83 |
|
|
84 |
public: // Functions from base classes
|
|
85 |
|
|
86 |
/**
|
|
87 |
* From CScriptBase Runs a script line.
|
|
88 |
* @since ?Series60_version
|
|
89 |
* @param aItem Script line containing method name and parameters
|
|
90 |
* @return Symbian OS error code
|
|
91 |
*/
|
|
92 |
virtual TInt RunMethodL( CStifItemParser& aItem );
|
|
93 |
|
|
94 |
private:
|
|
95 |
|
|
96 |
/**
|
|
97 |
* C++ default constructor.
|
|
98 |
*/
|
|
99 |
CAppRegExec_test( CTestModuleIf& aTestModuleIf );
|
|
100 |
|
|
101 |
/**
|
|
102 |
* By default Symbian 2nd phase constructor is private.
|
|
103 |
*/
|
|
104 |
void ConstructL();
|
|
105 |
|
|
106 |
// Prohibit copy constructor if not deriving from CBase.
|
|
107 |
// ?classname( const ?classname& );
|
|
108 |
// Prohibit assigment operator if not deriving from CBase.
|
|
109 |
// ?classname& operator=( const ?classname& );
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Frees all resources allocated from test methods.
|
|
113 |
* @since ?Series60_version
|
|
114 |
*/
|
|
115 |
void Delete();
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Test methods are listed below.
|
|
119 |
*/
|
|
120 |
|
|
121 |
/*
|
|
122 |
* Positive Test Method: This Test Case we assume that
|
|
123 |
* the console App is running in backround and will try to
|
|
124 |
* copy GUI app resource registration file .
|
|
125 |
* So the GUI app corresponding to this resource should launch successfully.
|
|
126 |
*/
|
|
127 |
virtual TInt Positive(CStifItemParser& aItem);
|
|
128 |
/*
|
|
129 |
* Negative Test Method: This Test Case checks whether the console App is not running in backround if yes, will shutdown it.
|
|
130 |
* Then it Will try to copy resource registration file .
|
|
131 |
* So the GUI app corresponding to this resource should not launch.
|
|
132 |
*/
|
|
133 |
virtual TInt Negative(CStifItemParser& aItem);
|
|
134 |
/*
|
|
135 |
* StartBackRoundApp Test mothod: This Test cases should be used to launch the Backround process
|
|
136 |
* which actually registers the GUI app.& which was shut down by Negative Test Case.
|
|
137 |
*/
|
|
138 |
virtual TInt StartBackRoundApp(CStifItemParser& aItem);
|
|
139 |
/*
|
|
140 |
* StartProcess - wil be used to launch any application.
|
|
141 |
*/
|
|
142 |
TInt StartProcess(const TDesC16& aFileName,TBool wait);
|
|
143 |
/*
|
|
144 |
* FindProcess - This function searches the given process .
|
|
145 |
* it will shutdown the process if running in backround & return true else False.
|
|
146 |
*/
|
|
147 |
TBool FindProcess(const TDesC16& aPath);
|
|
148 |
/*
|
|
149 |
* CheckAndDeleteL- will takes dirPath & Filename.
|
|
150 |
* will check whether the provided file is Valid or not. If valid then delete it.
|
|
151 |
*/
|
|
152 |
void CheckAndDeleteL(const TDesC16& aPath,const TDesC16& aFile);
|
|
153 |
/*
|
|
154 |
* IsExist - will takes dirPath & Filename.
|
|
155 |
* return True if valid file else False.
|
|
156 |
*/
|
|
157 |
TBool IsExist(const TDesC16& aPath,const TDesC16& aFile);
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Method used to log version of test class
|
|
161 |
*/
|
|
162 |
void SendTestClassVersion();
|
|
163 |
|
|
164 |
//ADD NEW METHOD DEC HERE
|
|
165 |
//[TestMethods] - Do not remove
|
|
166 |
private:
|
|
167 |
RFs iFsSession;
|
|
168 |
};
|
|
169 |
|
|
170 |
#endif // APPREGEXEC_TEST_H
|
|
171 |
|
|
172 |
// End of File
|