22 #ifndef _PLUGINS_ROBOT_MEMORY_TEST_H_ 23 #define _PLUGINS_ROBOT_MEMORY_TEST_H_ 25 #include "plugins/robot-memory/robot_memory.h" 27 #include <blackboard/blackboard.h> 28 #include <gtest/gtest.h> 81 ::testing::AssertionResult
contains_pairs(mongo::BSONObj obj, mongo::BSONObj exp);
123 std::list<mongo::BSONObj>
124 compute(
const mongo::BSONObj &query,
const std::string &collection)
126 std::list<mongo::BSONObj> res;
127 res.push_back(mongo::fromjson(
"{computed:true, result:'this is computed'}"));
136 std::list<mongo::BSONObj>
137 compute_sum(
const mongo::BSONObj &query,
const std::string &collection)
139 std::list<mongo::BSONObj> res;
140 int x = query.getField(
"x").Int();
141 int y = query.getField(
"y").Int();
143 mongo::BSONObjBuilder b;
146 <<
"x" << x <<
"y" << y <<
"sum" << sum;
147 res.push_back(b.obj());
156 std::list<mongo::BSONObj>
159 std::list<mongo::BSONObj> res;
160 res.push_back(mongo::fromjson(
"{compute:'multiple', count:1}"));
161 res.push_back(mongo::fromjson(
"{compute:'multiple', count:2}"));
162 res.push_back(mongo::fromjson(
"{compute:'multiple', count:3}"));
virtual void SetUp()
Setup for each test.
Environment for running Tests of the RobotMemory Necessary for making object such as the robot memory...
Class to register callbacks independent of how many tests are using them at the moment.
RobotMemoryTestEnvironment(RobotMemory *robot_memory, fawkes::BlackBoard *blackboard)
Constructor with objects of the thread.
std::list< mongo::BSONObj > compute(const mongo::BSONObj &query, const std::string &collection)
Computable function for static document.
virtual void TearDown()
TearDown the environment.
Class providing a computable function.
fawkes::BlackBoard * blackboard
Access to blackboard.
static RobotMemory * robot_memory
Access to Robot Memory.
Access to the robot memory based on mongodb.
void SetUp()
Setup the environment.
RobotMemory * robot_memory
Access to Robot Memory.
The BlackBoard abstract class.
static fawkes::BlackBoard * blackboard
Access to blackboard.
std::list< mongo::BSONObj > compute_sum(const mongo::BSONObj &query, const std::string &collection)
Computable function for addition.
::testing::AssertionResult contains_pairs(mongo::BSONObj obj, mongo::BSONObj exp)
Function for testing if a document contains all key-value pairs of another document.
int callback_counter
Counter for how often the callback was called.
void callback_test(mongo::BSONObj update)
Test callback function.
std::list< mongo::BSONObj > compute_multiple(const mongo::BSONObj &query, const std::string &collection)
Computable function for multiple static document.
Class for Tests of the RobotMemory.