X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Ftesting%2FTestStep.cpp;h=4a75f3beccbb3aea757ae599321c147d27309313;hb=dfc80ebaae97088df3188399b014652b4cf48dea;hp=7e9692639fd7a5bbfc197aab8eef4ef0c0cc3ec3;hpb=d723d5bf571eb48c641b092058eaa38bb6c4fcc8;p=anna.git diff --git a/source/testing/TestStep.cpp b/source/testing/TestStep.cpp index 7e96926..4a75f3b 100644 --- a/source/testing/TestStep.cpp +++ b/source/testing/TestStep.cpp @@ -101,6 +101,7 @@ namespace { // TODO: mutex the step while setting data here !! } +/* void cmdRunOnThreadWithFork (TestStepCmd *step, const std::string &cmd) { // Thread running: @@ -148,6 +149,7 @@ namespace { step->complete(); } } +*/ bool decodeMessage(const anna::DataBlock &message, anna::diameter::codec::Message &messageCodec) throw() { @@ -357,7 +359,7 @@ throw() { bool TestStepSendxml::do_execute() throw() { bool success = false; - std::string failReason; + std::string failReason = "Error sending diameter message"; anna::diameter::comm::Entity *entity = a_originHost->getEntity(); // by default anna::diameter::comm::LocalServer *localServer = a_originHost->getDiameterServer(); // by default const TestStepWait *tsw = NULL; @@ -559,10 +561,14 @@ void TestStepWait::setCondition(bool fromEntity, a_condition.setServiceContextId(serviceContextId); } -void TestStepWait::setCondition(bool fromEntity, const std::string ®exp) throw() { +void TestStepWait::setConditionRegexpHex(bool fromEntity, const std::string ®exp) throw() { + a_condition.setReceivedFromEntity(fromEntity); + a_condition.setRegexpHex(regexp); +} +void TestStepWait::setConditionRegexpXml(bool fromEntity, const std::string ®exp) throw() { a_condition.setReceivedFromEntity(fromEntity); - a_condition.setRegexp(regexp); + a_condition.setRegexpXml(regexp); } anna::xml::Node* TestStepWait::asXML(anna::xml::Node* parent) @@ -584,13 +590,18 @@ throw() { } } - if (decodeMessage()) { - xmlmsg = "\n"; - xmlmsg += a_messageCodec->asXMLString(); - xmlmsg += "\n"; + if (a_message.isEmpty()) { + xmlmsg = ""; } else { - xmlmsg = ""; + if (decodeMessage()) { + xmlmsg = "\n"; + xmlmsg += a_messageCodec->asXMLString(); + xmlmsg += "\n"; + } + else { + xmlmsg = ""; + } } if (msg != "") result->createAttribute("MatchedMessage", msg);