From: Eduardo Ramos Testillano Date: Wed, 7 Oct 2015 23:15:54 +0000 (+0200) Subject: Session-Id don't have to be mandatory to programm testcases X-Git-Tag: REFACTORING_TESTING_LIBRARY~94 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=38f67dae313f5b4b988a11804cfee52f74e16e33;p=anna.git Session-Id don't have to be mandatory to programm testcases --- diff --git a/example/diameter/launcher/testing/TestCase.cpp b/example/diameter/launcher/testing/TestCase.cpp index 3d91f32..0b26170 100644 --- a/example/diameter/launcher/testing/TestCase.cpp +++ b/example/diameter/launcher/testing/TestCase.cpp @@ -241,8 +241,16 @@ void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(ann a_hopByHops[hbh] = NULL; // may be assigned to a wait condition } - if (registerSessionId) - TestManager::instantiate().registerSessionId(anna::diameter::helpers::base::functions::getSessionId(db), this); + if (registerSessionId) { + try { + std::string sid = anna::diameter::helpers::base::functions::getSessionId(db); + TestManager::instantiate().registerSessionId(sid, this); + } + catch (anna::RuntimeException &ex) { + //ex.trace(); + // if we don't have session-id ... don't worry + } + } } void TestCase::addTimeout(const anna::Millisecond &timeout) throw(anna::RuntimeException) {