bool result = true;
try {
+ messageCodec.setEngine(NULL); // perhaps we will need another codec engine ...
messageCodec.decode(message);
}
catch (anna::RuntimeException &ex) {
const char* TestStep::asText(const Type::_v type)
throw() {
- static const char* text [] = { "Unconfigured", "Timeout", "Sendxml2e", "Sendxml2c", "Delay", "Wait", "Cmd" };
+ static const char* text [] = { "Unconfigured", "Timeout", "Sendxml2e", "Sendxml2c", "Delay", "Wait", "Command" };
return text [type];
}
}
bool TestStep::execute() throw() {
+
+ int ia = a_testCase->interactiveAmount();
+ if (ia > -1) {
+ if (ia == 0) return false;
+ a_testCase->interactiveExecution();
+ LOGDEBUG(anna::Logger::debug("Interactive execution ...", ANNA_FILE_LOCATION));
+ if (a_executed) return false; // avoid repeating (this implies amount consumption)
+ }
+
LOGDEBUG(anna::Logger::debug(anna::functions::asString("EXECUTING %s (step number %d) for Test Case %llu (%p) (%p)", asText(a_type), a_number, a_testCase->getId(), (TestCaseStep*)this, this), ANNA_FILE_LOCATION));
setBeginTimestamp(anna::functions::millisecond());
+ a_executed = true;
return do_execute();
}
LOGDEBUG(anna::Logger::debug(anna::functions::asString("RESET %s (step number %d) for Test Case %llu (%p) (%p)", asText(a_type), a_number, a_testCase->getId(), (TestCaseStep*)this, this), ANNA_FILE_LOCATION));
// type and testCase kept
a_completed = false;
+ a_executed = false;
a_beginTimestamp = 0;
a_endTimestamp = 0;
do_reset();
//parent->createChild("TestStepCmd");
result->createAttribute("Script", (a_script != "") ? a_script:"<no script>");
- result->createAttribute("Parameters", (a_parameters != "") ? a_parameters:"<no parameters>");
if (a_errorMsg != "") result->createAttribute("ErrorMessage", a_errorMsg);
if (!a_threadRunning && a_resultCode != -2) {
result->createAttribute("ResultCode", a_resultCode);
if (!a_threadRunning /* || a_threadDeprecated DO NOT WANT TO OVERLAP ... */) {
// Special tags to replace:
std::string cmd = getScript();
- cmd += " ";
- cmd += getParameters();
size_t index;
while ((index = cmd.find(SH_COMMAND_TAG_FOR_REPLACE__CYCLE_ID)) != std::string::npos)
cmd.replace(index, strlen(SH_COMMAND_TAG_FOR_REPLACE__CYCLE_ID), anna::functions::asString(TestManager::instantiate().getPoolCycle()));