X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestCase.cpp;h=8cbba4bab609d54710b0c1b6f78ea7e199cb1e57;hb=204a2f272da5c07340a1c3380ad59cec9a81f012;hp=bf08b4ef0d4fb8a302b51fc9e2c66a1f5bbd5d70;hpb=0a29aaeb86cc31d808f88d8c9a046f5858ed3089;p=anna.git diff --git a/example/diameter/launcher/testing/TestCase.cpp b/example/diameter/launcher/testing/TestCase.cpp index bf08b4e..8cbba4b 100644 --- a/example/diameter/launcher/testing/TestCase.cpp +++ b/example/diameter/launcher/testing/TestCase.cpp @@ -223,8 +223,8 @@ bool TestCase::reset(bool hard) throw() { } void TestCase::assertInitialized() const throw(anna::RuntimeException) { - if (a_state != State::Initialized) - throw anna::RuntimeException(anna::functions::asString("Cannot program anymore. The test case %llu was started. You must reset it to append new steps.", a_id), ANNA_FILE_LOCATION); + if (isFinished()) + throw anna::RuntimeException(anna::functions::asString("Cannot program anymore. The test case %llu has finished. You must reset it to append new steps (or do it during execution, which is also allowed).", a_id), ANNA_FILE_LOCATION); } void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(anna::RuntimeException) { @@ -253,7 +253,7 @@ void TestCase::addTimeout(const anna::Millisecond &timeout) throw(anna::RuntimeE addStep(step); } -void TestCase::addSendxml2e(const anna::DataBlock &db, RealmNode *realm, int stepNumber) throw(anna::RuntimeException) { +void TestCase::addSendxml2e(const anna::DataBlock &db, OriginHost *host, int stepNumber) throw(anna::RuntimeException) { assertInitialized(); assertMessage(db, true /* to entity */); @@ -273,18 +273,18 @@ void TestCase::addSendxml2e(const anna::DataBlock &db, RealmNode *realm, int ste TestStepSendxml2e *step = new TestStepSendxml2e(this); step->setMsgDataBlock(db); - step->setRealmNode(realm); + step->setOriginHost(host); step->setWaitForRequestStepNumber(stepNumber); // -1 means, no reference addStep(step); } -void TestCase::addSendxml2c(const anna::DataBlock &db, RealmNode *realm, int stepNumber) throw(anna::RuntimeException) { +void TestCase::addSendxml2c(const anna::DataBlock &db, OriginHost *host, int stepNumber) throw(anna::RuntimeException) { assertInitialized(); assertMessage(db, false /* to client */); TestStepSendxml2c *step = new TestStepSendxml2c(this); step->setMsgDataBlock(db); - step->setRealmNode(realm); + step->setOriginHost(host); addStep(step); }