| 14 | using namespace jsonrpc; |
| 15 | |
| 16 | TestServer::TestServer(AbstractServerConnector &connector, serverVersion_t type) : AbstractServer<TestServer>(connector, type), cnt(-1) { |
| 17 | this->bindAndAddMethod(Procedure("sayHello", PARAMS_BY_NAME, JSON_STRING, "name", JSON_STRING, NULL), &TestServer::sayHello); |
| 18 | this->bindAndAddMethod(Procedure("getCounterValue", PARAMS_BY_NAME, JSON_INTEGER, NULL), &TestServer::getCounterValue); |
| 19 | this->bindAndAddMethod(Procedure("add", PARAMS_BY_NAME, JSON_INTEGER, "value1", JSON_INTEGER, "value2", JSON_INTEGER, NULL), &TestServer::add); |
| 20 | this->bindAndAddMethod(Procedure("sub", PARAMS_BY_POSITION, JSON_INTEGER, "value1", JSON_INTEGER, "value2", JSON_INTEGER, NULL), &TestServer::sub); |
| 21 | this->bindAndAddMethod(Procedure("exceptionMethod", PARAMS_BY_POSITION, JSON_INTEGER, NULL), &TestServer::exceptionMethod); |
| 22 | |
| 23 | this->bindAndAddNotification(Procedure("initCounter", PARAMS_BY_NAME, "value", JSON_INTEGER, NULL), &TestServer::initCounter); |
| 24 | this->bindAndAddNotification(Procedure("incrementCounter", PARAMS_BY_NAME, "value", JSON_INTEGER, NULL), &TestServer::incrementCounter); |
| 25 | this->bindAndAddNotification(Procedure("initZero", PARAMS_BY_POSITION, NULL), &TestServer::initZero); |
| 26 | } |
| 27 | |
| 28 | void TestServer::sayHello(const Json::Value &request, Json::Value &response) { response = "Hello: " + request["name"].asString() + "!"; } |
| 29 |
nothing calls this directly
no test coverage detected