8 #include <gtest/gtest.h>
14 using namespace HCE::reduce::core;
15 using namespace HCE::sphinx;
16 using namespace HCE::sphinx::reduce_task;
26 sphinxReduceJob.assign(
27 new SphinxReduceJob(sphinxDataStorage, sphinxReduceTask, sphinxReduceResult));
48 scheduleStrategySingle.
executeJob(sphinxReduceJob);
50 sphinxReduceResult->reset();
51 ASSERT_TRUE(sphinxReduceResult->hasNext() ==
false);
58 vector<SphinxMatchInfo> resources;
65 for (
size_t resIndex = 0; resIndex < resources.size(); ++resIndex){
66 sphinxDataStorage->addData(resources[resIndex]);
71 scheduleStrategySingle.
executeJob(sphinxReduceJob);
74 sphinxReduceResult->reset();
75 while (sphinxReduceResult->hasNext()){
76 sphinxReduceResult->getNext(
id, weight);
79 (
id == to_string(resources[1].getDocId()) && weight == resources[1].getWeight()) ||
80 (
id == to_string(resources[2].getDocId()) && weight == resources[2].getWeight()) ||
81 (
id == to_string(resources[3].getDocId()) && weight == resources[3].getWeight()));
85 EXPECT_EQ(resNumber, 3);
86 ASSERT_TRUE(sphinxReduceResult->hasNext() ==
false);