Fix local server for multiple applications
[anna.git] / example / diameter / launcher / MyHandler.cpp
index 9086582..1a7fdc5 100644 (file)
@@ -49,7 +49,7 @@ void MyHandler::sendResponse(anna::comm::ClientSocket& clientSocket, anna::http:
 }
 
 void MyHandler::evRequest(anna::comm::ClientSocket& clientSocket, const anna::http::Request& request)
-throw(anna::RuntimeException) {
+noexcept(false) {
 
   const anna::DataBlock& body = request.getBody();
   anna::http::Method::Type::_v method = request.getMethod();
@@ -490,7 +490,9 @@ bool MyHandler::doPOST(const std::string &uri, const nlohmann::json &j, std::str
     result = eop.test__finished(response);
   }
   else if (opType == "/test-clear") {
-    result = eop.test__clear(response);
+    auto it = j.find("id");
+    int id = (it != j.end() && it->is_number_integer()) ? it->get<int>() : -1; // default is: all
+    result = eop.test__clear(response, id);
   }
   else if (opType == "/test-junit") {
     auto it = j.find("targetFile");