X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestTimer.cpp;fp=example%2Fdiameter%2Flauncher%2Ftesting%2FTestTimer.cpp;h=abe8b4da0836e2bbeb6edd63fa972e7e8b8efc1f;hb=4c3f0a4d7e4db76996404d80c6f939548fca656f;hp=0000000000000000000000000000000000000000;hpb=c82a3818b279727e943a76343f3cf1a278ac9e19;p=anna.git diff --git a/example/diameter/launcher/testing/TestTimer.cpp b/example/diameter/launcher/testing/TestTimer.cpp new file mode 100644 index 0000000..abe8b4d --- /dev/null +++ b/example/diameter/launcher/testing/TestTimer.cpp @@ -0,0 +1,73 @@ +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // + + +// Project +#include + +// Process +#include +#include + +// Standard +#include + + +using namespace std; +using namespace anna; + + +void TestTimer::expire(anna::timex::Engine*) +throw(anna::RuntimeException) { + + TestStep *step = getTestCaseStep(); + + // action: + step->complete(); + + LOGDEBUG( + string msg("TestTimer::expire | Completed TestStep:\n\n"); + msg += step->asXMLString(); + anna::Logger::debug(msg, ANNA_FILE_LOCATION); + ); +} + +const char* TestTimer::asText(const Type::_v type) +throw() { + static const char* text [] = { "TimeLeft", "Delay" }; + return text [type]; +} + + +string TestTimer::asString() const +throw() { + string result("TestTimer { "); + result += anna::timex::Transaction::asString(); + result += " Type: "; + result += asText(a_type); + +// const TestStep *step = getTestCaseStep(); +// +// if(step != NULL) { +// result += " | "; +// result += step->asXMLString(); +// } else +// result += " | step: "; +// } + +// switch(getType()) { +// case Type::TimeLeft: +// //result += " | xxxxx: "; +// break; +// case Type::Delay: +// //result += " | xxxxx: "; +// break; +// } + + return result += " }"; +} +