Fix bug while getting step number.
[anna.git] / example / diameter / launcher / testing / TestManager.hpp
index 313e15f..6a292e4 100644 (file)
@@ -39,6 +39,8 @@ namespace anna {
 class TestClock;
 class TestCase;
 class TestCaseStep;
+class RealmNode;
+
 
 typedef std::map<unsigned int /* test case id */, TestCase*> test_pool_t;
 typedef std::map<unsigned int /* test case id */, TestCase*>::const_iterator test_pool_it;
@@ -56,11 +58,13 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto
   // reports
   std::string a_reportsDirectory;
   bool a_dumpReports;
+  bool a_dumpHexMessages;
 
   // Pool of test cases
   test_pool_t a_testPool;
   test_pool_it a_currentTestIt;
-  bool a_poolRepeat; // repeat pool when finish
+  int a_poolRepeats; // repeat pool N times
+  int a_poolCycle; // current cycle, from 1 to N
   unsigned int a_inProgressCount;
   unsigned int a_inProgressLimit; // limit load to have this value
 
@@ -95,6 +99,8 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto
     void setReportsDirectory(const std::string &rd) throw() { a_reportsDirectory = rd; }
     const std::string &getReportsDirectory() const throw() { return a_reportsDirectory; }
 
+    void setDumpHex(bool dh) throw() { a_dumpHexMessages = dh; }
+    bool getDumpHex() const throw() { return a_dumpHexMessages; }
     void setDumpReports(bool dr) throw() { a_dumpReports = dr; }
     bool getDumpReports() const throw() { return a_dumpReports; }
 
@@ -105,8 +111,10 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto
 
     bool clearPool() throw();
     bool resetPool(bool hard /* hard reset includes in-progress test cases */) throw();
-    void setPoolRepeat(bool repeat) throw() { a_poolRepeat = repeat; }
-    bool getPoolRepeat() const throw() { return a_poolRepeat; }
+    void setPoolRepeats(int repeats) throw() { a_poolRepeats = repeats; }
+    int getPoolRepeats() const throw() { return a_poolRepeats; }
+    int getPoolCycle() const throw() { return a_poolCycle; }
+
     unsigned int getInProgressCount() const throw() { return a_inProgressCount; }
     void setInProgressCountDelta(unsigned int delta) throw() { a_inProgressCount += delta; }
     unsigned int getInProgressLimit() const throw() { return a_inProgressLimit; }
@@ -117,9 +125,9 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto
     TestCase *getTestCase(unsigned int id) throw(); // creates/reuses a test case
 
     // Main logic
-    TestCase *getTestCaseFromSessionId(const anna::DataBlock &message, std::string &sessionId) throw(anna::RuntimeException);
-    void receiveMessage(const anna::DataBlock &message, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException);
-    void receiveMessage(const anna::DataBlock &message, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException);
+    TestCase *getTestCaseFromSessionId(const anna::DataBlock &message, std::string &sessionId) throw();
+    void receiveMessage(const anna::DataBlock &message, RealmNode *realm, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException);
+    void receiveMessage(const anna::DataBlock &message, RealmNode *realm, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException);
 
     anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
     std::string asXMLString() const throw();