hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HandlerMocks.hpp
Go to the documentation of this file.
1 #ifndef HANDLERMOCKS_H_
2 #define HANDLERMOCKS_H_
3 
4 #include <gmock/gmock.h>
9 #include "SupportNotifierIf.hpp"
10 #include "ReducingInputMessage.hpp"
13 
14 using namespace HCE;
15 using namespace HCE::reduce;
16 using namespace HCE::reduce::additions;
17 using namespace HCE::reduce_types;
18 using namespace Poco;
19 using namespace std;
20 
21 
23 public:
24  MOCK_METHOD1(findBy, bool(unsigned long long keyId));
25  MOCK_METHOD1(deleteBy, void(unsigned long long keyId));
26  MOCK_METHOD1(addReducingPartsCounterWithKey, void(unsigned long long keyId));
27  MOCK_METHOD1(incrementBy, void(unsigned long long keyId));
28  MOCK_METHOD1(getAccumulateReducingParts, int(unsigned long long keyId));
29  MOCK_METHOD0(getTotalTasksNumber, unsigned int());
30 };
31 
32 
34 public:
35  MOCK_METHOD1(findBy, Poco::SharedPtr<additions::TaskReducersManagerIf>(HCE::types::MessageType key));
36  MOCK_METHOD1(findBy, Poco::SharedPtr<additions::TaskReducersManagerIf>(unsigned long long secondKey));
37  MOCK_METHOD1(deleteBy, void (unsigned long long secondKey));
38  MOCK_METHOD2(addWith, void(HCE::types::MessageType key,
39  Poco::SharedPtr<additions::TaskReducersManagerIf> taskReducersManager));
40  MOCK_METHOD2(addWith, void(unsigned long long secondKey,
41  Poco::SharedPtr<additions::TaskReducersManagerIf> taskReducersManager));
42 };
43 
44 
46 public:
47  MOCK_METHOD1(build, Poco::SharedPtr<additions::TaskReducersManagerIf>(types::MessageType managerType));
48 };
49 
51 public:
52  MOCK_METHOD1(translateToErrorCode, int(const NotFoundByKeyException& e));
53  MOCK_METHOD1(translateToErrorMsg, string(const NotFoundByKeyException& e));
54 };
55 
56 
58 public:
59  MOCK_METHOD2(notifyWrongJSONStructure, void(unsigned long long itemId,
60  const SharedPtr<ReducingInputMessage>& reducingInputMessage));
61  MOCK_METHOD1(notifyNotFoundItemException, void(const NotFoundByKeyException& e));
62 };
63 
64 
66 {
67 public:
68  MOCK_METHOD3(build, SharedPtr<ReducingOutputMessage>(const types::MessageType& msgType,
69  const int ttl, const string& json));
70  MOCK_METHOD1(build, SharedPtr<ReducingOutputMessage>
71  (const NotFoundByKeyException& e));
72 };
73 
74 
76 public:
77  MOCK_METHOD0(getType, types::MessageType());
78  MOCK_METHOD1(isReducerExist, bool(unsigned long long reduceTaskId));
79  MOCK_METHOD1(createReducer, void(unsigned long long reduceTaskId));
80  MOCK_METHOD2(addDataInReducer, void(unsigned long long reduceTaskId, const std::string& json));
81  MOCK_METHOD1(runReduceTaskForTaskId, std::string(unsigned long long reduceTaskId));
82  MOCK_METHOD1(deleteReducerBy, void(unsigned long long reduceTaskId));
83 };
84 
85 #endif