8 #include <gtest/gtest.h>
14 using namespace HCE::sphinx;
15 using namespace HCE::sphinx::reduce_task;
16 using namespace HCE::reduce::core;
25 sphinxResultDataAccumulatorFactory.assign(
new
29 *reduceJobBuilder.get(),
30 *sphinxResultDataAccumulatorFactory.get()));
42 matchInfo1.addAttrInfo(attrInfo1);
43 matchInfo2.addAttrInfo(attrInfo1);
44 matchInfo3.addAttrInfo(attrInfo1);
45 matchInfo4.addAttrInfo(attrInfo1);
47 sphinxRequestInfo1.setNodeName(
"nodeName1");
48 sphinxRequestInfo1.setQuery(query1);
49 sphinxRequestInfo1.setTotal(totalRes1);
50 sphinxRequestInfo1.setTotalFound(totalFound1);
51 sphinxRequestInfo1.setTimeMsec(time1);
52 sphinxRequestInfo1.addWordInfo(word1);
53 sphinxRequestInfo1.addWordInfo(word2);
55 sphinxRequestInfo2.setNodeName(
"nodeName2");
56 sphinxRequestInfo2.addWordInfo(word1);
57 sphinxRequestInfo2.addWordInfo(word2);
59 sphinxResultData1.addMatchInfo(matchInfo1);
60 sphinxResultData1.addMatchInfo(matchInfo2);
61 sphinxResultData1.addRequestInfo(sphinxRequestInfo1);
63 sphinxResultData2.addMatchInfo(matchInfo3);
64 sphinxResultData2.addMatchInfo(matchInfo4);
65 sphinxResultData2.addRequestInfo(sphinxRequestInfo2);
100 SharedPtr<SphinxResultData> reducedSphinxResult = sphinxReducer->getResult();
112 sphinxReducer->addData(emptyInputSphinxResult);
113 sphinxReducer->reduce(scheduleStrategy);
114 SharedPtr<SphinxResultData> reducedSphinxResult = sphinxReducer->getResult();
122 sphinxReducer->addData(sphinxResultData1);
123 sphinxReducer->reduce(scheduleStrategy);
124 SharedPtr<SphinxResultData> reducedSphinxResult = sphinxReducer->getResult();
134 buildExpectedSphinxResultData(expectedSphinxResult);
136 sphinxReducer->addData(sphinxResultData1);
137 sphinxReducer->addData(sphinxResultData2);
138 sphinxReducer->reduce(scheduleStrategy);
139 SharedPtr<SphinxResultData> reducedSphinxResult = sphinxReducer->getResult();