hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCECleanupTest.hpp
Go to the documentation of this file.
1 
14 #ifndef DRCE_CLEANUP_TEST_HPP
15 #define DRCE_CLEANUP_TEST_HPP
16 
17 #include <iostream>
18 
19 #include "DRCESessionOptions.hpp"
20 #include "DRCEInputJsonMessage.hpp"
21 
22 #define CLEANUP_TEST 1
23 
24 namespace HCE
25 {
26 namespace drce
27 {
28 namespace tests
29 {
30 //-----------------------------------------------------------------------------
32 {
33 public:
34  static void testAsyncTaskAsyncSubtasks(void);
35  static void testAsyncTaskSyncSubtasks(void);
36  static void testSyncTaskAsyncSubtasks(void);
37  static void testSyncTaskSyncSubtasks(void);
38 
39  static void testAsyncTaskMixSubtasks(void);
40  static void testSyncTaskMixSubtasks(void);
41 
42  static void testAsyncTaskMixSubtasksCleanup(void);
43  static void testSyncTaskMixSubtasksCleanup(void);
44 
45  static void testRequestGetDataCleanup(void);
46  static void testRequestDeleteDataCleanup(void);
47  static void testRequestTerminateCleanup(void);
48 
49  static void testRequestDeleteData(void);
50 
51 private:
52 
53  static std::string getInputJson(unsigned int startTaskId,
54  SessionOptions::ThreadMode taskThreadMode,
55  SessionOptions::ThreadMode subtasksThreadMode);
56 
57  static std::string getInputJson(unsigned int startTaskId,
58  SessionOptions::ThreadMode taskThreadMode);
59 
60  static std::string getInputJsonCleanup(unsigned int startTaskId,
61  SessionOptions::ThreadMode taskThreadMode,
62  const std::string& commandLine,
63  unsigned int timeMax=200000);
64 
65  static std::string getInputJsonCleanup(unsigned int startTaskId,
66  SessionOptions::ThreadMode taskThreadMode,
67  SessionOptions::CleanupFlag cleanupFlag,
68  const std::string& commandLine);
69 
70  static DRCEInputJsonMessage getInputJsonMessage(unsigned int taskId,
71  SessionOptions::ThreadMode threadMode,
72  SessionOptions::CleanupFlag cleanupFlag,
73  const std::string& commandLine="",
74  unsigned int timeMax=200000);
75 
76  static bool isExistTaskData(unsigned int taskId, DRCENodeOptions& nodeOptions);
77  static bool isNotExistTaskData(unsigned int taskId, DRCENodeOptions& nodeOptions);
78 
79  static void cleanupDir(const std::string& dirName);
80 public:
81  static void cleanupTestData(DRCENodeOptions& nodeOptions);
82  static std::string getInputJson(unsigned int startTaskId,
83  SessionOptions::ThreadMode threadMode,
84  SessionOptions::CleanupFlag cleanupFlag,
85  const std::string& commandLine,
86  unsigned int timeMax);
87  static DRCEResultDataItem extractResultData(unsigned int taskId,
88  DRCENodeOptions& nodeOptions);
89 };
90 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 } // end namespace tests
93 } // end namespace drce
94 } // end namespace HCE
95 
96 #endif // DRCE_CLEANUP_TEST_HPP