X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestStep.cpp;h=e58bb0bc43fd247910af647602b4cfb9fda212e0;hb=5bf5055ab79aaf464e2491cfbab173ba37ba3419;hp=cb1b0f91eefa549499bb1c8caa05c5a4a0bdc569;hpb=c6b62fd814b6e5b4e3ba65b6f092f6aa4e1d298d;p=anna.git diff --git a/example/diameter/launcher/testing/TestStep.cpp b/example/diameter/launcher/testing/TestStep.cpp index cb1b0f9..e58bb0b 100644 --- a/example/diameter/launcher/testing/TestStep.cpp +++ b/example/diameter/launcher/testing/TestStep.cpp @@ -33,7 +33,7 @@ #include // Process -#include +#include #include #include #include @@ -347,12 +347,12 @@ throw() { bool TestStepSendxml::do_execute() throw() { bool success = false; std::string failReason, s_warn; - MyDiameterEntity *entity = a_realmNode->getEntity(); // by default - MyLocalServer *localServer = a_realmNode->getDiameterServer(); // by default + MyDiameterEntity *entity = a_originHost->getEntity(); // by default + MyLocalServer *localServer = a_originHost->getDiameterServer(); // by default const TestStepWait *tsw = NULL; // Create comm message: - anna::diameter::comm::Message *msg = a_realmNode->createCommMessage(); + anna::diameter::comm::Message *msg = a_originHost->createCommMessage(); //msg->clearBody(); msg->setBody(a_message); @@ -409,10 +409,10 @@ bool TestStepSendxml::do_execute() throw() { } // else (normal sending) // Detailed log: - if(a_realmNode->logEnabled()) { + if(a_originHost->logEnabled()) { if (decodeMessage()) { std::string detail = usedClientSession ? usedClientSession->asString() : ""; // shouldn't happen - a_realmNode->writeLogFile(*a_messageCodec, (success ? "sent2e" : "send2eError"), detail); + a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2e" : "send2eError"), detail); } } } @@ -443,10 +443,10 @@ bool TestStepSendxml::do_execute() throw() { } // else (normal sending) // Detailed log: - if(a_realmNode->logEnabled()) { + if(a_originHost->logEnabled()) { if (decodeMessage()) { std::string detail = usedServerSession ? usedServerSession->asString() : ""; // shouldn't happen - a_realmNode->writeLogFile(*a_messageCodec, (success ? "sent2c" : "send2cError"), detail); + a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2c" : "send2cError"), detail); } } } @@ -456,7 +456,7 @@ bool TestStepSendxml::do_execute() throw() { } // release msg - a_realmNode->releaseCommMessage(msg); + a_originHost->releaseCommMessage(msg); if (!success) { a_testCase->addDebugSummaryHint(failReason); // before report (when set Failed state); @@ -483,12 +483,13 @@ throw() { anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepDelay"); - result->createAttribute("Delay", a_delay.asString()); + result->createAttribute("Delay", ((a_delay == 0) ? "dummy step, no delay" : a_delay.asString())); return result; } bool TestStepDelay::do_execute() throw() { + if (a_delay == 0) { complete(); return true; } // special case try { a_timer = TestManager::instantiate().createTimer((TestCaseStep*)this, a_delay, TestTimer::Type::Delay); } @@ -502,12 +503,14 @@ bool TestStepDelay::do_execute() throw() { } void TestStepDelay::do_complete() throw() { + if (a_delay == 0) return; // special case a_timer = NULL; next(); // next() invoked here because execute() is always false for delay and never advance the iterator // TODO, avoid this recursion } void TestStepDelay::do_reset() throw() { + if (a_delay == 0) return; // special case try { TestManager::instantiate().cancelTimer(a_timer); }