X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Ftesting%2FTestManager.cpp;h=6aeae9f9d16cc8b5210ff62cd862ac1f610d9371;hb=64d7c531cdf5f4bca4fa2d8c9736de98247dfe13;hp=8f1a72812a1c8c8a5e344ea80fffebba7469d14a;hpb=d723d5bf571eb48c641b092058eaa38bb6c4fcc8;p=anna.git diff --git a/source/testing/TestManager.cpp b/source/testing/TestManager.cpp index 8f1a728..6aeae9f 100644 --- a/source/testing/TestManager.cpp +++ b/source/testing/TestManager.cpp @@ -98,6 +98,9 @@ TestManager::TestManager() : a_clock = NULL; //a_testPool.clear(); //a_statSummary.clear(); + + a_autoResetHard = false; + a_currentTestIt = a_testPool.end(); } @@ -358,8 +361,8 @@ bool TestManager::nextTestCase() throw() { } } - // Soft reset to initialize already finished (in previous cycle) test cases: - a_currentTestIt->second->reset(false); + // Hard reset or soft reset to initialize already finished (in previous cycle) test cases: + a_currentTestIt->second->reset(a_autoResetHard); // Process test case: LOGDEBUG(anna::Logger::debug(anna::functions::asString("Processing test case id = %llu, currently '%s' state", a_currentTestIt->first, TestCase::asText(a_currentTestIt->second->getState())), ANNA_FILE_LOCATION)); @@ -427,18 +430,19 @@ void TestManager::receiveMessage(const anna::DataBlock &message, const anna::dia // Work with Test case: TestStepWait *tsw = tc->searchNextWaitConditionFulfilled(message, true /* comes from entity */); if (!tsw) { // store as 'uncovered' - std::string hint = "Uncovered condition for received message from entity over Session-Id '"; hint += sessionId; hint += "':"; + std::string hint = "Uncovered condition for received message from entity over Session-Id '"; hint += sessionId; hint += "'; "; try { static anna::diameter::codec::Message codecMsg; codecMsg.decode(message); - hint += "\n"; hint += codecMsg.asXMLString(); + hint += "HEX Message: '"; hint += anna::functions::asHexString(message); + hint += "'; XML Message:\n"; hint += codecMsg.asXMLString(); } catch (anna::RuntimeException &ex) { ex.trace(); - hint += "\n"; hint += ex.asString(); + hint += ex.asString(); } - hint += "\n"; hint += clientSession->asString(); + hint += "\nClient Session: "; hint += clientSession->asString(); tc->addDebugSummaryHint(hint); } @@ -467,18 +471,19 @@ void TestManager::receiveMessage(const anna::DataBlock &message, const anna::dia // Work with Test case: TestStepWait *tsw = tc->searchNextWaitConditionFulfilled(message, false /* comes from client */); if (!tsw) { // store as 'uncovered' - std::string hint = "Uncovered condition for received message from client over Session-Id '"; hint += sessionId; hint += "':"; + std::string hint = "Uncovered condition for received message from client over Session-Id '"; hint += sessionId; hint += "'; "; try { static anna::diameter::codec::Message codecMsg; codecMsg.decode(message); - hint += "\n"; hint += codecMsg.asXMLString(); + hint += "HEX Message: '"; hint += anna::functions::asHexString(message); + hint += "'; XML Message:\n"; hint += codecMsg.asXMLString(); } catch (anna::RuntimeException &ex) { ex.trace(); - hint += "\n"; hint += ex.asString(); + hint += ex.asString(); } - hint += "\n"; hint += serverSession->asString(); + hint += "\nServer Session: "; hint += serverSession->asString(); tc->addDebugSummaryHint(hint); } @@ -507,6 +512,7 @@ throw() { result->createAttribute("DumpFailedReports", (a_dumpFailedReports ? "yes":"no")); result->createAttribute("DumpSuccessReports", (a_dumpSuccessReports ? "yes":"no")); result->createAttribute("DumpHexMessages", (a_dumpHexMessages ? "yes":"no")); + result->createAttribute("AutoResetHard", (a_autoResetHard ? "yes":"no")); result->createAttribute("ReportsDirectory", a_reportsDirectory); if (a_clock) { result->createAttribute("AsynchronousSendings", a_synchronousAmount);