Improve traces in testing system
[anna.git] / example / diameter / launcher / testing / TestManager.cpp
index 01487fe..75955ce 100644 (file)
@@ -23,7 +23,7 @@
 #include <TestManager.hpp>
 #include <TestClock.hpp>
 #include <Launcher.hpp>
-#include <RealmNode.hpp>
+#include <OriginHost.hpp>
 
 
 class TestTimer;
@@ -95,6 +95,7 @@ TestManager::TestManager() :
   a_inProgressLimit = UINT_MAX; // no limit
   a_clock = NULL;
   //a_testPool.clear();
+  //a_statSummary.clear();
   a_currentTestIt = a_testPool.end();
 }
 
@@ -109,6 +110,7 @@ void TestManager::registerSessionId(const std::string &sessionId, const TestCase
   }
   else {
     a_sessionIdTestCaseMap[sessionId] = const_cast<TestCase*>(testCase);
+    LOGDEBUG(anna::Logger::debug(anna::functions::asString("TestManager::registerSessionId for test case (id = %llu): %s)", testCase->getId(), sessionId.c_str()), ANNA_FILE_LOCATION));
   }
 }
 
@@ -371,7 +373,7 @@ TestCase *TestManager::getTestCaseFromSessionId(const anna::DataBlock &message,
   return NULL;
 }
 
-void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *realm, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException) {
+void TestManager::receiveMessage(const anna::DataBlock &message, OriginHost *host, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException) {
 
   // Testing disabled:
   if (!tests()) return;
@@ -391,10 +393,10 @@ void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *real
       codecMsg.decode(message);
       hint += "\n"; hint += codecMsg.asXMLString();
 
-      //      // Realm checking:
-      //      std::string messageOR = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->getValue();
-      //      if (messageOR != realm->getName()) {
-      //        LOGWARNING(anna::Logger::warning(anna::functions::asString("Received message from realm '%s', with different Origin-Realm: %s", realm->getName().c_str(), messageOR.c_str()), ANNA_FILE_LOCATION));
+      //      // Host checking:
+      //      std::string messageOH = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->getValue();
+      //      if (messageOH != host->getName()) {
+      //        LOGWARNING(anna::Logger::warning(anna::functions::asString("Received message from host '%s', with different Origin-Host: %s", host->getName().c_str(), messageOH.c_str()), ANNA_FILE_LOCATION));
       //      }
     }
     catch (anna::RuntimeException &ex) {
@@ -411,7 +413,7 @@ void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *real
   }
 }
 
-void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *realm, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException) {
+void TestManager::receiveMessage(const anna::DataBlock &message, OriginHost *host, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException) {
 
   // Testing disabled:
   if (!tests()) return;
@@ -431,10 +433,10 @@ void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *real
       codecMsg.decode(message);
       hint += "\n"; hint += codecMsg.asXMLString();
 
-      //      // Realm checking:
-      //      std::string messageOR = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->getValue();
-      //      if (messageOR != realm->getName()) {
-      //        LOGWARNING(anna::Logger::warning(anna::functions::asString("Received message from realm '%s', with different Origin-Realm: %s", realm->getName().c_str(), messageOR.c_str()), ANNA_FILE_LOCATION));
+      //      // Host checking:
+      //      std::string messageOH = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->getValue();
+      //      if (messageOH != host->getName()) {
+      //        LOGWARNING(anna::Logger::warning(anna::functions::asString("Received message from host '%s', with different Origin-Host: %s", host->getName().c_str(), messageOH.c_str()), ANNA_FILE_LOCATION));
       //      }
     }
     catch (anna::RuntimeException &ex) {