securityanddataprivacytools/securitytools/certapp/test/tcertapp/goodconfigwriter.h
changeset 8 35751d3474b7
parent 0 2c201484c85f
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
    85 private:
    85 private:
    86 	int iEntryCount;
    86 	int iEntryCount;
    87 	};
    87 	};
    88 
    88 
    89 
    89 
       
    90 // to generate script and ini files to run tests on emulator
       
    91 
       
    92 class ScriptAndIniGeneration : public GoodConfigWriter
       
    93 	{
       
    94 public:
       
    95 	ScriptAndIniGeneration(const std::stringstream &aFileName);
       
    96 	~ScriptAndIniGeneration();
       
    97 	
       
    98 	void WriteTestCaseToScript(const std::stringstream &aTestCaseType, int &aTestIndex, const char *aTestActionName, const char *aTestActionType, bool aHasActionBody = true);
       
    99 
       
   100 protected:
       
   101 	std::ofstream iIniFile;
       
   102 	std::string   iIniFileName;
       
   103 	};
       
   104 
    90 
   105 
    91 // to generate script files for the file certstore to run tests on emulator
   106 // to generate script files for the file certstore to run tests on emulator
    92 
   107 
    93 class FileStoreScriptGeneration : public GoodConfigWriter
   108 class FileStoreScriptGeneration : public ScriptAndIniGeneration
    94 	{
   109 	{
    95 public:
   110 public:
    96 	FileStoreScriptGeneration(const std::stringstream &aFileName);
   111 	FileStoreScriptGeneration(const std::stringstream &aFileName);
    97 	~FileStoreScriptGeneration();
   112 	~FileStoreScriptGeneration();
    98 	
   113 	
    99 	void WriteInitialiseCert(const char *aMode);
   114 	void WriteInitialiseCert(const char *aMode, const std::stringstream &aTestCaseType, int &aTestIndex);
   100 	void WriteListcert(const char *aGoodOwnerType);
   115 	void WriteListcert(const char *aGoodOwnerType, const std::stringstream &aTestCaseType, int &aTestIndex);
   101 	void WriteGetCertificateDetails(const char *label);
   116 	void WriteGetCertificateDetails(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex);
   102 	void WriteGetTrust(const char *label, const char *trust);
   117 	void WriteGetTrust(const char *label, const char *trust, const std::stringstream &aTestCaseType, int &aTestIndex);
   103 	void WriteGetApplications(const char *label);
   118 	void WriteGetApplications(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex);
   104 	void WriteRetrieveCerts(const char *label);
   119 	void WriteRetrieveCerts(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex);
   105 	void WriteDetailsToArray(const char *array[]);
       
   106 
       
   107 private:
       
   108 	int iCount;
       
   109 	};
   120 	};
   110 
   121 
   111 
   122 
   112 // to generate script files for the cert cleint store to run tests on emulator
   123 // to generate script files for the cert cleint store to run tests on emulator
   113 
   124 
   114 class CertClientsStoreScriptGeneration : public GoodConfigWriter
   125 class CertClientsStoreScriptGeneration : public ScriptAndIniGeneration
   115 	{
   126 	{
   116 public:
   127 public:
   117 	CertClientsStoreScriptGeneration(const std::stringstream &aFileName);
   128 	CertClientsStoreScriptGeneration(const std::stringstream &aFileName);
   118 	~CertClientsStoreScriptGeneration();
   129 	~CertClientsStoreScriptGeneration();
   119 	
   130 	
   120 	void WriteInitialiseCertClient();
   131 	void WriteInitialiseCertClient(const std::stringstream &aTestCaseType, int &aTestIndex);
   121 	void WriteGetCount(const int index);
   132 	void WriteGetCount(const int index, const std::stringstream &aTestCaseType, int &aTestIndex);
   122 	void WriteGetApplicationsList();
   133 	void WriteGetApplicationsList(const std::stringstream &aTestCaseType, int &aTestIndex);
   123 	void WriteGetAppWithUid(const char *label, const char *uid);
   134 	void WriteGetAppWithUid(const char *label, const char *uid, const std::stringstream &aTestCaseType, int &aTestIndex);
   124 	void WriteDestroyManager();
   135 	void WriteDestroyManager(const std::stringstream &aTestCaseType, int &aTestIndex);
   125 	
       
   126 private:
       
   127 	int iCount;
       
   128 	};
   136 	};
   129 
   137 
   130 
   138 
   131 // to generate script files for the swicertstore to run tests on emulator
   139 // to generate script files for the swicertstore to run tests on emulator
   132 
   140 
   133 class SWIStoreScriptGeneration : public GoodConfigWriter
   141 class SWIStoreScriptGeneration : public ScriptAndIniGeneration
   134 	{
   142 	{
   135 public:
   143 public:
   136 	SWIStoreScriptGeneration(const std::stringstream &aFileName);
   144 	SWIStoreScriptGeneration(const std::stringstream &aFileName);
   137 	~SWIStoreScriptGeneration();
   145 	~SWIStoreScriptGeneration();
   138 	
   146 	
   139 	void WriteInitialiseCert();
   147 	void WriteInitialiseCert(const std::stringstream &aTestCaseType, int &aTestIndex);
   140 	void WriteListcert(const char *aGoodOwnerType);
   148 	void WriteListcert(const char *aGoodOwnerType, const std::stringstream &aTestCaseType, int &aTestIndex);
   141 	void WriteGetSystemUpgrade(const char *label , const char *aSystemUpgrade);
   149 	void WriteGetSystemUpgrade(const char *label , const char *aSystemUpgrade, const std::stringstream &aTestCaseType, int &aTestIndex);
   142 	void WriteGetCapabilities(const char *label);
   150 	void WriteGetCapabilities(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex);
   143 	void WriteGetMandatoryFlag(const char *label, const char *aMandatory);
   151 	void WriteGetMandatoryFlag(const char *label, const char *aMandatory, const std::stringstream &aTestCaseType, int &aTestIndex);
   144 	void WriteGetTrust(const char *label, const char *trust);
   152 	void WriteGetTrust(const char *label, const char *trust, const std::stringstream &aTestCaseType, int &aTestIndex);
   145 	void WriteGetApplications(const char *label);
   153 	void WriteGetApplications(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex);
   146 	void WriteRetrieveCerts(const char *label);
   154 	void WriteRetrieveCerts(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex);
   147 	void WriteDetailsToArray(const char *array[]);
       
   148 private:
       
   149 	int iCount;
       
   150 	};
   155 	};
   151 
   156 
   152 class EmptyFileConfigWriter : public GoodConfigWriter
   157 class EmptyFileConfigWriter : public GoodConfigWriter
   153 	{
   158 	{
   154 public:
   159 public: