X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestStep.cpp;fp=example%2Fdiameter%2Flauncher%2Ftesting%2FTestStep.cpp;h=e53ae9a48ca5db8ee1c9a97ccfd6ae2541fc6eb3;hb=e3f60b6b4a178c63ebd6f8915431bfa485a2e601;hp=c4ec2e5dcd1797107c43b18dfb7d8bcd42642fb6;hpb=2921c651c9945cefec0715167201596aaa079e8d;p=anna.git diff --git a/example/diameter/launcher/testing/TestStep.cpp b/example/diameter/launcher/testing/TestStep.cpp index c4ec2e5..e53ae9a 100644 --- a/example/diameter/launcher/testing/TestStep.cpp +++ b/example/diameter/launcher/testing/TestStep.cpp @@ -161,15 +161,19 @@ anna::xml::Node* TestStepSendxml::asXML(anna::xml::Node* parent) const throw() { anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepSendxml"); + std::string msg = "", xmlmsg = ""; // Message - std::string msg = "", xmlmsg = ""; - if (a_message.isEmpty()) { - msg = ""; + if (TestManager::instantiate().getDumpHex()) { + if (a_message.isEmpty()) { + msg = ""; + } + else { + msg = "\n"; msg += a_message.asString(); msg += "\n"; + } } - else { - msg = "\n"; msg += a_message.asString(); msg += "\n"; - // Helper + + if (!a_message.isEmpty()) { try { Launcher& my_app = static_cast (anna::app::functions::getApp()); static anna::diameter::codec::Message codecMsg(my_app.getCodecEngine()); @@ -181,9 +185,11 @@ throw() { } } - result->createAttribute("Message", msg); + if (msg != "") result->createAttribute("Message", msg); if (xmlmsg != "") result->createAttribute("XMLMessage", xmlmsg); result->createAttribute("Expired", (a_expired ? "yes":"no")); + if (a_waitForRequestStepNumber != -1) + result->createAttribute("WaitForRequestStepNumber", a_waitForRequestStepNumber); return result; } @@ -334,25 +340,36 @@ anna::xml::Node* TestStepWait::asXML(anna::xml::Node* parent) const throw() { anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepWait"); + std::string msg = "", xmlmsg = ""; // Condition a_condition.asXML(result); + // Message + if (TestManager::instantiate().getDumpHex()) { + if (a_message.isEmpty()) { + msg = ""; + } + else { + msg = "\n"; msg += a_message.asString(); msg += "\n"; + } + } + if (!a_message.isEmpty()) { - // Message - result->createAttribute("MatchedMessage", a_message.asString()); - // Helper try { Launcher& my_app = static_cast (anna::app::functions::getApp()); static anna::diameter::codec::Message codecMsg(my_app.getCodecEngine()); codecMsg.decode(a_message); - result->createAttribute("MatchedXMLMessage", codecMsg.asXMLString()); + xmlmsg = "\n"; xmlmsg += codecMsg.asXMLString(); xmlmsg += "\n"; } catch (anna::RuntimeException &ex) { ex.trace(); } } + if (msg != "") result->createAttribute("MatchedMessage", msg); + if (xmlmsg != "") result->createAttribute("XMLMessage", xmlmsg); + return result; }