#include <TestCase.hpp>
#include <TestClock.hpp>
#include <Launcher.hpp>
+#include <RealmNode.hpp>
class TestTimer;
if (!tests()) return result;
for (test_pool_nc_it it = a_testPool.begin(); it != a_testPool.end(); it++) {
- it->second->reset(hard);
- result = true;
+ if (it->second->reset(hard))
+ result = true;
}
//a_sessionIdTestCaseMap.clear();
return result;
return NULL;
}
-void TestManager::receiveMessage(const anna::DataBlock &message, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException) {
+void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *realm, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException) {
// Testing disabled:
if (!tests()) return;
std::string hint = "Uncovered condition for received message from entity over Session-Id '"; hint += sessionId; hint += "':";
try {
- Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
- static anna::diameter::codec::Message codecMsg(my_app.getCodecEngine());
+ static anna::diameter::codec::Message codecMsg;
codecMsg.decode(message);
hint += "\n"; hint += codecMsg.asXMLString();
+
+ // // Realm checking:
+ // std::string messageOR = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->getValue();
+ // if (messageOR != realm->getName()) {
+ // LOGWARNING(anna::Logger::warning(anna::functions::asString("Received message from realm '%s', with different Origin-Realm: %s", realm->getName().c_str(), messageOR.c_str()), ANNA_FILE_LOCATION));
+ // }
}
catch (anna::RuntimeException &ex) {
ex.trace();
}
else {
tsw->setClientSession(const_cast<anna::diameter::comm::ClientSession*>(clientSession));
+ tc->process();
}
}
-void TestManager::receiveMessage(const anna::DataBlock &message, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException) {
+void TestManager::receiveMessage(const anna::DataBlock &message, RealmNode *realm, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException) {
// Testing disabled:
if (!tests()) return;
std::string hint = "Uncovered condition for received message from client over Session-Id '"; hint += sessionId; hint += "':";
try {
- Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
- static anna::diameter::codec::Message codecMsg(my_app.getCodecEngine());
+ static anna::diameter::codec::Message codecMsg;
codecMsg.decode(message);
hint += "\n"; hint += codecMsg.asXMLString();
+
+ // // Realm checking:
+ // std::string messageOR = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->getValue();
+ // if (messageOR != realm->getName()) {
+ // LOGWARNING(anna::Logger::warning(anna::functions::asString("Received message from realm '%s', with different Origin-Realm: %s", realm->getName().c_str(), messageOR.c_str()), ANNA_FILE_LOCATION));
+ // }
}
catch (anna::RuntimeException &ex) {
ex.trace();
}
else {
tsw->setServerSession(const_cast<anna::diameter::comm::ServerSession*>(serverSession));
+ tc->process();
}
}