hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Mocks.hpp
Go to the documentation of this file.
1 /*
2  * Mocks.h
3  *
4  * Created on: May 6, 2013
5  * Author: igor
6  */
7 
8 #ifndef MOCKS_H_
9 #define MOCKS_H_
10 
11 #include <gmock/gmock.h>
19 #include "SphinxTaskReducerIf.hpp"
20 #include "SphinxResultSorterIf.hpp"
22 
23 using namespace HCE::reduce::core;
24 using namespace HCE::sphinx::reduce_task;
25 using namespace HCE::sphinx;
26 using namespace Poco;
27 using namespace std;
28 
30  public:
31  MOCK_METHOD2(extractWeightKeys, void(const Poco::SharedPtr<SphinxResultData> &sphinxResultData,
32  std::vector<std::pair<std::string, unsigned long long> > &extractedWeightKeys));
33 };
34 
35 
37 public:
38  MOCK_METHOD3(build, Poco::SharedPtr<SphinxResultData>(
39  Poco::SharedPtr<SphinxReduceDataStorage> &sphinxDataStorage,
40  const Poco::SharedPtr<HCE::reduce::core::ReduceResultIf> &sphinxReduceResult,
41  const std::vector<SphinxRequestInfo>& requestInfo));
42 
43  MOCK_METHOD2(buildFromUsingKeys, Poco::SharedPtr<SphinxResultData>(
44  const Poco::SharedPtr<SphinxResultData> &sphinxResultData,
45  std::vector<std::pair<std::string, unsigned long long> > &selectWeightKeys));
46 };
47 
48 
50  public:
51  MOCK_METHOD0(build, Poco::SharedPtr<HCE::reduce::core::ReduceJobIf>());
52 };
53 
54 
56 public:
57  MOCK_METHOD1(build, SharedPtr<SphinxResultDataAccumulatorIf>
58  (SharedPtr<SphinxReduceDataStorage>& dataStorage));
59 };
60 
61 
63 public:
64  MOCK_METHOD1_T(accumulate, void(SphinxResultData& sphinxResultData));
65  MOCK_METHOD0_T(getAllSphinxRequestInfo, std::vector<SphinxRequestInfo>&());
66  MOCK_METHOD0_T(getSphinxDataStorage, Poco::SharedPtr<SphinxReduceDataStorage>());
67 };
68 
69 
71 public:
72  MOCK_METHOD1(findByKey,
73  SharedPtr<SphinxTaskReducerIf>(unsigned long long taskId));
74  MOCK_METHOD1(deleteByKey, void(unsigned long long taskId));
75  MOCK_METHOD2(addWithKey, void(unsigned long long taskId,
76  SharedPtr<SphinxTaskReducerIf>&sphinxTaskReducer));
77 };
78 
79 
81 public:
82  MOCK_METHOD0(create, SharedPtr<SphinxTaskReducerIf>());
83  MOCK_METHOD0(getScheduleStrategy, ScheduleStrategyIf&());
84  MOCK_METHOD0(getSphinxResultTrancater, SphinxResultTruncaterIf&());
85 };
86 
87 
89 public:
90  MOCK_METHOD1(convertToSphinxResultDataFrom, SharedPtr<SphinxResultData>(const string& json));
91  MOCK_METHOD1(convertToJSONFrom, string(const SharedPtr<SphinxResultData>& sphinxResultData));
92 };
93 
94 
96 public:
97 
98  MOCK_METHOD1(addData, void(SphinxResultData& sphinxResultData));
99  MOCK_METHOD1(reduce, void(ScheduleStrategyIf &scheduleStrategy));
100  MOCK_METHOD0(getResult, SharedPtr<SphinxResultData>());
101 };
102 
103 
105 public:
106  MOCK_METHOD1(sortByWeight, void(
107  std::vector<std::pair<std::string, unsigned long long> > &weightDocIds));
108 };
109 
110 
112 public:
113  MOCK_METHOD1(trancate, SharedPtr<SphinxResultData>(SharedPtr<SphinxResultData>& sphinxResultData));
114 };
115 
116 #endif /* MOCKS_H_ */