X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestManager.hpp;h=d1cc1c184d3fe369840458400d81d2ce17b3eb9e;hb=61f1340da3cae5159d2e3bc14fc47c6d4bf9453e;hp=43c53408be9e44cd853f0fcf424db83b80fd4bd5;hpb=8de835b706e08eac4bb8fca78c1f373bfb29191f;p=anna.git diff --git a/example/diameter/launcher/testing/TestManager.hpp b/example/diameter/launcher/testing/TestManager.hpp index 43c5340..d1cc1c1 100644 --- a/example/diameter/launcher/testing/TestManager.hpp +++ b/example/diameter/launcher/testing/TestManager.hpp @@ -40,7 +40,7 @@ namespace anna { class TestClock; class TestCase; class TestCaseStep; -class RealmNode; +class OriginHost; typedef std::map test_pool_t; @@ -62,6 +62,7 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto unsigned int a_sucessTcs; public: + StatSummary() { clear(); } void newTCState(const TestCase::State::_v beginState, const TestCase::State::_v endState) throw(); void clear() throw(); unsigned int getInProgressCount() const throw() { return a_inprogressTcs; } @@ -76,7 +77,7 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto // reports std::string a_reportsDirectory; - bool a_dumpSuccessfulReports, a_dumpFailedReports; + bool a_dumpInitializedReports, a_dumpInProgressReports, a_dumpFailedReports, a_dumpSuccessReports; bool a_dumpHexMessages; // Pool of test cases @@ -96,9 +97,14 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto // Test timers timer_container a_timers; + // Test case identifiers: // Session-Id's std::map a_sessionIdTestCaseMap; // stores used Session-Id values within a test case. // No other can use them, but a test case could use more than one. + // Subscriber's + std::map a_subscriberIdTestCaseMap; // stores used Subscriber-Id values within a test case. + + StatSummary a_statSummary; // general statistics @@ -114,6 +120,7 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto public: void registerSessionId(const std::string &sessionId, const TestCase *testCase) throw(anna::RuntimeException); + void registerSubscriberId(const std::string &subscriberId, const TestCase *testCase) throw(anna::RuntimeException); int tests() const throw() { return a_testPool.size(); } void setTimerController(anna::timex::Engine *engine) throw() { a_timeController = engine; } @@ -123,11 +130,23 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto void setDumpHex(bool dh) throw() { a_dumpHexMessages = dh; } bool getDumpHex() const throw() { return a_dumpHexMessages; } - void setDumpSuccessfulReports(bool dsr) throw() { a_dumpSuccessfulReports = dsr; } - void setDumpFailedReports(bool dfr) throw() { a_dumpFailedReports = dfr; } - bool getDumpSuccessfulReports() const throw() { return a_dumpSuccessfulReports; } + + void setDumpInitializedReports(bool enable) throw() { a_dumpInitializedReports = enable; } + void setDumpInProgressReports(bool enable) throw() { a_dumpInProgressReports = enable; } + void setDumpFailedReports(bool enable) throw() { a_dumpFailedReports = enable; } + void setDumpSuccessReports(bool enable) throw() { a_dumpSuccessReports = enable; } + void setDumpAllReports(bool enable) throw() { + setDumpInitializedReports(enable); + setDumpInProgressReports(enable); + setDumpFailedReports(enable); + setDumpSuccessReports(enable); + } + + bool getDumpInitializedReports() const throw() { return a_dumpInitializedReports; } + bool getDumpInProgressReports() const throw() { return a_dumpInProgressReports; } bool getDumpFailedReports() const throw() { return a_dumpFailedReports; } + bool getDumpSuccessReports() const throw() { return a_dumpSuccessReports; } // Helper to calculate time interval and synchronous amount of execution tests to guarantee the input rate (tests per second) // through the time manager which has a minimum resolution of ADML minimum resolution. The first call to this method will @@ -150,8 +169,9 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto // Main logic 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); + TestCase *getTestCaseFromSubscriberId(const anna::DataBlock &message, std::string &subscriberId) throw(); + void receiveMessage(const anna::DataBlock &message, OriginHost *host, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException); + void receiveMessage(const anna::DataBlock &message, OriginHost *host, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException); anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); std::string asXMLString() const throw();