|
1 /** |
|
2 * Copyright (c) 2003-2009 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 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 |
|
25 #ifndef __CMTF_TEST_SERVER_H__ |
|
26 #define __CMTF_TEST_SERVER_H__ |
|
27 |
|
28 #include <test/testexecuteserverbase.h> |
|
29 #include "CMtfTestCase.h" |
|
30 |
|
31 class CMtfTestAction; |
|
32 class CMtfTestActionNamePair; |
|
33 class CMtfTestCaseNamePair; |
|
34 class CMtfTestActionParameters; |
|
35 class CMtfEnumeratorConverter; |
|
36 |
|
37 /** Messaging test server class. Handles Messaging test scripts. */ |
|
38 class CMtfTestServer : public CTestServer |
|
39 { |
|
40 public: |
|
41 virtual ~CMtfTestServer(); |
|
42 |
|
43 static CMtfTestServer* NewL(); |
|
44 virtual CTestStep* CreateTestStep(const TDesC& aStepName); |
|
45 void SetCurrentTestCase(CMtfTestCase* aTestCase); |
|
46 CMtfTestCase& CurrentTestCase() const; |
|
47 void AddTestActionL(CMtfTestActionNamePair* aPair); |
|
48 void AddTestCaseL(CMtfTestCaseNamePair* aPair); |
|
49 const CMtfTestAction& CreateTestActionL(const TDesC& aActionName, |
|
50 CMtfTestActionParameters* aActionParameters) const; |
|
51 const CMtfTestAction& CreateTestActionL(const TDesC& aActionName, |
|
52 CMtfTestActionParameters* aActionParameters, const TDesC& aActionId) const; |
|
53 const TDesC& GetDefaultConfigurationFileL(const CMtfConfigurationType::TMtfConfigurationType& aType) const; |
|
54 const TDesC& GetMainScriptConfigurationFileL(const CMtfConfigurationType::TMtfConfigurationType& aType, TInt aIndex) const; |
|
55 TInt ConvertEnumeratorL(const TDesC& aParameter) const; |
|
56 void SetMainScriptConfigurationTypeL(CMtfConfigurationType* aConfiguration); |
|
57 |
|
58 private: |
|
59 CMtfTestServer(); |
|
60 void ConstructL(); |
|
61 CMtfTestAction* CreateTestActionPtrL(const TDesC& aActionName, |
|
62 CMtfTestActionParameters* aActionParameters) const; |
|
63 CTestStep* CreateTestStepL(const TDesC& aStepName); |
|
64 CMtfTestCase* CreateTestCaseL(const TDesC& aCaseName) const; |
|
65 void SetDefaultConfigurationTypeL(CMtfConfigurationType* aConfigurationType); |
|
66 void AddEnumeratorConverterL(CMtfEnumeratorConverter* aEnumeratorConverter); |
|
67 TBool EnumeratorConverterExists(const CMtfEnumeratorConverter& aConverter) const; |
|
68 const CMtfEnumeratorConverter& FindEnumeratorConverterL(const TDesC& aParameter) const; |
|
69 |
|
70 private: |
|
71 CMtfTestCase* iCurrentTestCase; |
|
72 TBool iInsideScriptedTestCase; |
|
73 CMtfTestCase::TMtfTestCaseState iScriptState; |
|
74 RPointerArray<CMtfTestActionNamePair> iAvailableTestActions; |
|
75 RPointerArray<CMtfTestCaseNamePair> iAvailableTestCases; |
|
76 RPointerArray<CMtfConfigurationType> iDefaultConfigurations; |
|
77 RPointerArray<CMtfConfigurationType> iMainScriptConfigurations; |
|
78 RPointerArray<CMtfEnumeratorConverter> iEnumeratorConverters; |
|
79 }; |
|
80 |
|
81 #endif |