///////////////////////////////////////////////////////////////////////////////////////////////////
-void TestCase::DebugSummary::addHint(const std::string &hint) throw() {
+void TestCase::DebugSummary::addHint(const std::string &hint) {
event_t event;
event.Timestamp = anna::functions::millisecond();
event.Hint = hint;
a_events.push_back(event);
}
-void TestCase::DebugSummary::clear() throw() {
+void TestCase::DebugSummary::clear() {
a_events.clear();
}
-anna::xml::Node* TestCase::DebugSummary::asXML(anna::xml::Node* parent) const throw() {
+anna::xml::Node* TestCase::DebugSummary::asXML(anna::xml::Node* parent) const {
anna::xml::Node* result = parent->createChild("DebugSummary");
std::vector<event_t>::const_iterator it;
return result;
};
-std::string TestCase::DebugSummary::asString() const throw() {
+std::string TestCase::DebugSummary::asString() const {
std::string result = "";
std::vector<event_t>::const_iterator it;
const char* TestCase::asText(const State::_v state)
-throw() {
+{
static const char* text [] = { "Initialized", "InProgress", "Failed", "Success" };
return text [state];
}
-anna::Millisecond TestCase::getLapseMs() const throw() {
+anna::Millisecond TestCase::getLapseMs() const {
return ((a_finishTimestamp >= a_startTimestamp) ? (a_finishTimestamp - a_startTimestamp) : (anna::Millisecond)0);
}
anna::xml::Node* TestCase::asXML(anna::xml::Node* parent) const
-throw() {
+{
anna::xml::Node* result = parent->createChild("TestCase");
result->createAttribute("Id", a_id);
return result;
}
-std::string TestCase::asXMLString() const throw() {
+std::string TestCase::asXMLString() const {
anna::xml::Node root("root");
return anna::xml::Compiler().apply(asXML(&root));
}
-bool TestCase::hasSameCondition(const TestDiameterCondition &condition) const throw() {
+bool TestCase::hasSameCondition(const TestDiameterCondition &condition) const {
std::vector<TestStep*>::const_iterator it;
TestStepWaitDiameter *step;
for (it = a_steps.begin(); it != a_steps.end(); it++) {
}
-void TestCase::setState(const State::_v &state) throw() {
+void TestCase::setState(const State::_v &state) {
State::_v previousState = a_state;
if (state == previousState) return;
}
}
-bool TestCase::done() throw() {
+bool TestCase::done() {
if (a_stepsIt == a_steps.end()) {
setState(State::Success);
return true;
return false;
}
-bool TestCase::process() throw() {
+bool TestCase::process() {
if (steps() == 0) {
LOGWARNING(anna::Logger::warning(anna::functions::asString("Test case %llu (%s) is empty, nothing to execute", a_id, a_description.c_str()), ANNA_FILE_LOCATION));
return false;
return somethingDone;
}
-bool TestCase::reset(bool hard) throw() {
+bool TestCase::reset(bool hard) {
// Soft reset if finished:
if (!hard /* is soft reset */ && !isFinished()) return false;
return true;
}
-void TestCase::assertInitialized() const throw(anna::RuntimeException) {
+void TestCase::assertInitialized() const noexcept(false) {
if (isFinished())
throw anna::RuntimeException(anna::functions::asString("Cannot program anymore. The test case %llu (%s) has finished. You must reset it to append new steps (or do it during execution, which is also allowed).", a_id, a_description.c_str()), ANNA_FILE_LOCATION);
}
-void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(anna::RuntimeException) {
+void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) noexcept(false) {
bool isRequest = anna::diameter::codec::functions::isRequest(db);
bool registerKeys = ((isRequest && toEntity) || (!isRequest && !toEntity) /* (*) */);
}
}
-void TestCase::addTimeout(const anna::Millisecond &timeout) throw(anna::RuntimeException) {
+void TestCase::addTimeout(const anna::Millisecond &timeout) noexcept(false) {
assertInitialized();
TestStepTimeout *step = new TestStepTimeout(this);
step->setTimeout(timeout);
addStep(step);
}
-void TestCase::addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) throw(anna::RuntimeException) {
+void TestCase::addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) noexcept(false) {
assertInitialized();
assertMessage(db, true /* to entity */);
addStep(step);
}
-void TestCase::addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) throw(anna::RuntimeException) {
+void TestCase::addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) noexcept(false) {
assertInitialized();
assertMessage(db, false /* to client */);
addStep(step);
}
-void TestCase::addDelay(const anna::Millisecond &delay) throw(anna::RuntimeException) {
+void TestCase::addDelay(const anna::Millisecond &delay) noexcept(false) {
assertInitialized();
TestStepDelay *step = new TestStepDelay(this);
step->setDelay(delay);
void TestCase::addWaitDiameter(bool fromEntity,
const std::string &code, const std::string &bitR, const std::string &hopByHop, const std::string &applicationId,
const std::string &sessionId, const std::string &resultCode,
- const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) throw(anna::RuntimeException) {
+ const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) noexcept(false) {
assertInitialized();
std::string usedHopByHop = hopByHop;
TestStepWaitDiameter *step = NULL;
addStep(step);
}
-void TestCase::addWaitDiameterRegexpHex(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) {
+void TestCase::addWaitDiameterRegexpHex(bool fromEntity, const std::string ®exp) noexcept(false) {
assertInitialized();
TestStepWaitDiameter *step = new TestStepWaitDiameter(this);
addStep(step);
}
-void TestCase::addWaitDiameterRegexpXml(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) {
+void TestCase::addWaitDiameterRegexpXml(bool fromEntity, const std::string ®exp) noexcept(false) {
assertInitialized();
TestStepWaitDiameter *step = new TestStepWaitDiameter(this);
addStep(step);
}
-void TestCase::addCommand(const std::string &cmd) throw(anna::RuntimeException) {
+void TestCase::addCommand(const std::string &cmd) noexcept(false) {
assertInitialized();
TestStepCmd *step = new TestStepCmd(this);
addStep(step);
}
-void TestCase::addIpLimit(unsigned int ipLimit) throw(anna::RuntimeException) {
+void TestCase::addIpLimit(unsigned int ipLimit) noexcept(false) {
assertInitialized();
TestStepIpLimit *step = new TestStepIpLimit(this);
addStep(step);
}
-TestStepWaitDiameter *TestCase::searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) throw() {
+TestStepWaitDiameter *TestCase::searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) {
TestStepWaitDiameter *result;
for (std::vector<TestStep*>::const_iterator it = a_stepsIt /* current */; it != a_steps.end(); it++) {
return NULL;
}
-const TestStep *TestCase::getStep(int stepNumber) const throw() {
+const TestStep *TestCase::getStep(int stepNumber) const {
if (stepNumber < 1 || stepNumber > steps()) return NULL;
// return a_steps.at(stepNumber-1); // http://stackoverflow.com/questions/3269809/stdvectorat-vs-operator-surprising-results-5-to-10-times-slower-f
return a_steps[stepNumber-1];