DRDE/AusRegCliever/server/mdAusReg.cpp

58 lines
1.3 KiB
C++
Raw Normal View History

2014-01-11 00:58:45 +00:00
#define MD_AUSREG
#include "cliever-md.h"
2014-01-07 17:59:27 +00:00
2014-01-11 00:58:45 +00:00
using namespace std;
static TestEnvironment props;
2014-01-07 17:59:27 +00:00
2014-01-11 00:58:45 +00:00
// static void testExecuteParallelTransactions() throw (EPPException);
bool ausRegEPPTK::didInit(const std::string propertiesFilePath) {
2014-01-07 17:59:27 +00:00
2014-01-10 20:05:42 +00:00
bool did=false;
2014-01-07 17:59:27 +00:00
2014-01-10 20:05:42 +00:00
try {
scenario( tkScenario );
did = true;
}
catch(std::exception &e) {
2014-01-10 22:01:44 +00:00
theseLogs->logN(2,"Scenario %d TK Exception: %s .",tkScenario,e.what());
2014-01-10 20:05:42 +00:00
}
2014-01-10 22:01:44 +00:00
return did;
2014-01-07 17:59:27 +00:00
}
2014-01-11 00:58:45 +00:00
void ausRegEPPTK::doOTEA()
{
int hours;
string op("newInstance");
scenario(tkScenario);
try {
Timer::setTime("20070101.010101");
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
op = "startup";
manager->startup();
op = "run (keep-alive)";
manager->run();
for (hours=0;hours < 22;hours++) {
// Spawn the keep alive thread.
theseLogs->logN(1,"Start of OTE Test Hour %d.",hours);
sleep(3630);
}
manager->shutdown();
}
catch (EPPException& e)
{ const char *eMsg = e.getMessage().c_str();
const char *opNow = op.c_str();
theseLogs->logN(2,"EPP Exception during OTE A (%s): %s .",opNow,eMsg);
throw e;
}
catch (...)
{
theseLogs->logN(2,"General Exception during OTE A (%s).",op.c_str());
}
}