Fixes and improvs. Basic DRA feature.
[anna.git] / example / diameter / launcher / Launcher.cpp
index a6c5bee..041e7a9 100644 (file)
@@ -1227,6 +1227,8 @@ std::string Launcher::help() const throw() {
   result += "\n                                 and test case reports will be written depending on this report option. Anyway, you could";
   result += "\n                                  use the 'look' operation to see the report.";
   result += "\n";
+  result += "\n   test|report-hex[|[yes]|no]    Reports could include the diameter messages in hexadecimal format. Disabled by default.";
+  result += "\n";
   result += "\n   test|reset|<soft/hard>[|id]   Reset the test case for id provided, all the tests when missing. It could be hard/soft:";
   result += "\n                                 - hard: you probably may need to stop the load rate before. This operation initializes";
   result += "\n                                         all test cases regardless their states.";
@@ -1610,6 +1612,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
     // test|ip-limit[|amount]             In-progress limit of test cases. No new test cases will be launched over this value ...
     // test|repeat[|[yes]|no]             Restarts the programmed test cases when finished. Disabled by default: the testing ...
     // test|report[|[yes]|no]             Every time a test case is finished a report file in xml format will be created under ...
+    // test|report-hex[|[yes]|no]         Reports could include the diameter messages in hexadecimal format. Disabled by default.
     // test|goto|<id>                     Updates current test pointer position.
     // test|look[|id]                     Show programmed test case for id provided, current when missing ...
     // test|reset|<soft/hard>[|id]        Reset the test case for id provided, all the tests when missing ...
@@ -1665,6 +1668,14 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
       testManager.setDumpReports((param2 == "yes"));
       opt_response_content += (testManager.getDumpReports() ? "report enabled" : "report disabled");
     }
+    else if(param1 == "report-hex") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if(param2 == "") param2 = "yes";
+      testManager.setDumpHex((param2 == "yes"));
+      opt_response_content += (testManager.getDumpHex() ? "report includes hexadecimal messages" : "report excludes hexadecimal messages");
+    }
     else if(param1 == "goto") {
       if (numParams > 2)
         throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);