9 #ifndef anna_testing_TestStep_hpp 10 #define anna_testing_TestStep_hpp 61 struct Type {
enum _v { Unconfigured, Timeout, Sendxml2e, Sendxml2c, Delay,
Wait, Cmd, IpLimit }; };
62 static const char* asText(
const Type::_v type) ;
64 TestStep(
TestCase *testCase) : a_message(true), a_messageCodec(NULL), a_executed(false) { initialize(testCase); }
78 std::string asXMLString() ;
88 bool decodeMessage(
bool trust =
false) ;
91 virtual bool do_execute() = 0;
92 virtual void do_complete() = 0;
95 virtual void do_reset() = 0;
137 a_waitForRequestStepNumber(-1) {;}
196 a_clientSession = NULL;
197 a_serverSession = NULL;
202 void setCondition(
bool fromEntity,
203 const std::string &code,
const std::string &bitR,
const std::string &hopByHop,
const std::string &applicationId,
204 const std::string &sessionId,
const std::string &resultCode,
205 const std::string &msisdn,
const std::string &imsi,
const std::string &serviceContextId) ;
206 void setConditionRegexpXml(
bool fromEntity,
const std::string ®exp) ;
207 void setConditionRegexpHex(
bool fromEntity,
const std::string ®exp) ;
230 std::string a_script;
231 std::thread a_thread;
232 std::atomic<bool> a_threadRunning;
233 bool a_threadDeprecated;
235 std::string a_errorMsg;
241 TestStepCmd(
TestCase *testCase) :
TestStep(testCase), a_threadRunning(false), a_threadDeprecated(false), a_resultCode(-2), a_errorMsg(
""), a_childPid(-1) { a_type = Type::Cmd; }
259 void setScript(
const std::string &script) { a_script = script; }
260 const std::string &
getScript()
const {
return a_script; }
272 unsigned int a_ipLimit;
void setServerSession(anna::diameter::comm::ServerSession *ss)
Definition: TestStep.hpp:210
TestStepWaitDiameter(TestCase *testCase)
Definition: TestStep.hpp:194
void do_complete()
Definition: TestStep.hpp:150
void setChildPid(pid_t pid)
Definition: TestStep.hpp:256
Definition: Millisecond.hpp:24
TestStepTimeout(TestCase *testCase)
Definition: TestStep.hpp:105
const TestDiameterCondition & getCondition() const
Definition: TestStep.hpp:214
void setErrorMsg(const std::string &em)
Definition: TestStep.hpp:252
TestCase * a_testCase
Definition: TestStep.hpp:81
~TestStepCmd()
Definition: TestStep.hpp:242
anna::diameter::comm::ServerSession * getServerSession() const
Definition: TestStep.hpp:212
const std::string & getErrorMsg() const
Definition: TestStep.hpp:253
Definition: TestStep.hpp:121
anna::diameter::codec::Message * a_messageCodec
Definition: TestStep.hpp:87
void setOriginHost(anna::diameter::comm::OriginHost *host)
Definition: TestStep.hpp:141
void setWaitForRequestStepNumber(int stepNumber)
Definition: TestStep.hpp:143
Definition: TestDiameterCondition.hpp:27
Definition: TestTimer.hpp:25
void setThreadNotRunning()
Definition: TestStep.hpp:246
Type::_v a_type
Definition: TestStep.hpp:83
TestStepSendDiameterXml2c(TestCase *testCase)
Definition: TestStep.hpp:162
const anna::DataBlock & getMsgDataBlock() const
Definition: TestStep.hpp:146
void setIpLimit(unsigned int limit)
Definition: TestStep.hpp:279
~TestStepDelay()
Definition: TestStep.hpp:172
bool threadNotRunning() const
Definition: TestStep.hpp:248
virtual ~TestStep()
Definition: TestStep.hpp:65
~TestStepTimeout()
Definition: TestStep.hpp:106
void setTimeout(const anna::Millisecond &t)
Definition: TestStep.hpp:109
~TestStepWaitDiameter()
Definition: TestStep.hpp:199
Definition: TestStep.hpp:160
Definition: TestStep.hpp:166
Definition: TestStep.hpp:228
Definition: OriginHost.hpp:41
const Type::_v & getType() const
Definition: TestStep.hpp:68
anna::diameter::comm::ClientSession * getClientSession() const
Definition: TestStep.hpp:211
TestStepCmd(TestCase *testCase)
Definition: TestStep.hpp:241
void setResultCode(int rc)
Definition: TestStep.hpp:250
~TestStepSendDiameterXml()
Definition: TestStep.hpp:138
void setThreadRunning()
Definition: TestStep.hpp:245
unsigned int getIpLimit() const
Definition: TestStep.hpp:280
Definition: TestStep.hpp:187
void do_reset()
Definition: TestStep.hpp:285
Definition: Message.hpp:74
void setMsgDataBlock(const anna::DataBlock &db)
Definition: TestStep.hpp:145
anna::Millisecond getLapseMs() const
Definition: TestStep.hpp:71
Definition: ServerSession.hpp:53
const pid_t & getChildPid() const
Definition: TestStep.hpp:257
void setClientSession(anna::diameter::comm::ClientSession *cs)
Definition: TestStep.hpp:209
Definition: ClientSession.hpp:51
bool a_expired
Definition: TestStep.hpp:131
anna::diameter::comm::OriginHost * a_originHost
Definition: TestStep.hpp:125
int getWaitForRequestStepNumber() const
Definition: TestStep.hpp:144
anna::diameter::comm::OriginHost * getOriginHost() const
Definition: TestStep.hpp:142
anna::DataBlock a_message
Definition: TestStep.hpp:86
const anna::Millisecond & getTimeout() const
Definition: TestStep.hpp:110
TestStepSendDiameterXml(TestCase *testCase)
Definition: TestStep.hpp:134
xml::Node Node
Definition: Node.hpp:21
_v
Definition: TestStep.hpp:61
bool isCompleted() const
Definition: TestStep.hpp:70
Definition: TestStep.hpp:99
void setScript(const std::string &script)
Definition: TestStep.hpp:259
TestStepSendDiameterXml2e(TestCase *testCase)
Definition: TestStep.hpp:157
Definition: TestCase.hpp:42
bool threadRunning() const
Definition: TestStep.hpp:247
const anna::DataBlock & getMsgDataBlock() const
Definition: TestStep.hpp:217
Definition: TestStep.hpp:155
~TestStepIpLimit()
Definition: TestStep.hpp:276
int a_waitForRequestStepNumber
Definition: TestStep.hpp:128
const std::string & getScript() const
Definition: TestStep.hpp:260
Definition: TestStep.hpp:46
void setDelay(const anna::Millisecond &d)
Definition: TestStep.hpp:175
const int & getNumber() const
Definition: TestStep.hpp:69
Definition: TestStep.hpp:61
TestStepDelay(TestCase *testCase)
Definition: TestStep.hpp:171
int getResultCode() const
Definition: TestStep.hpp:251
Definition: TestStep.hpp:270
bool a_completed
Definition: TestStep.hpp:82
Definition: DataBlock.hpp:24
TestStep(TestCase *testCase)
Definition: TestStep.hpp:64
TestStepIpLimit(TestCase *testCase)
Definition: TestStep.hpp:275
Definition: TestStep.hpp:61
const anna::Millisecond & getDelay() const
Definition: TestStep.hpp:176