#define MD_AUSREG
#include "cliever-md.h"
#include "session/SessionFactory.hpp"
#include "session/SessionManagerProperties.hpp"
#include "common/SystemProperties.hpp"
#include "session/Session.hpp"
#include "session/StatsManager.hpp"
using namespace std;
static TestEnvironment props;
static std::string TEST_SE =
"";
// static void testExecuteParallelTransactions() throw (EPPException);
bool ausRegEPPTK::didInit(const std::string propertiesFilePath) {
bool did=false;
try {
scenario( tkScenario );
did = true;
}
catch(std::exception &e) {
theseLogs->logN(2,"Scenario %d TK Exception: %s .",tkScenario,e.what());
}
return did;
}
void ausRegEPPTK::doOTEA()
{
int hours,hoops;
string op("newInstance");
if (!daysRunning)
scenario(tkScenario);
try {
Timer::setTime("20070101.010101");
auto_ptr manager(SessionManagerFactory::newInstance(&props));
auto_ptr sess(SessionFactory::newInstance(&props));
op = "startup";
manager->startup();
op = "run (keep-alive)";
manager->run();
sess->open();
for (hours=0;hours < 24;hours++) {
// Spawn the keep alive thread.
theseLogs->logN(1,"Send Test SEs on or about start OTE Test Hour %d.",hours);
for (hoops=0;hoops<7;hoops++) {
sess->writeXML(TEST_SE);
sess->read();
sleep(857);
}
}
sess->close();
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());
}
}
void ausRegEPPTK::doOTEB()
{
#define N_OTE_B
int cmd=0;
string op("newInstance");
if (!daysRunning)
scenario(tkScenario);
try {
Timer::setTime("20070101.010101");
auto_ptr manager(SessionManagerFactory::newInstance(&props));
auto_ptr sess(SessionFactory::newInstance(&props));
op = "startup";
manager->startup();
op = "run (keep-alive)";
manager->run();
sess->open();
theseLogs->logN(1,"OTE Basic Access Tests.");
theseLogs->logN(1,"OTE Basic Access Tests (%d).",cmd++);
sess->writeXML(TEST_SE);
sess->read();
theseLogs->logN(1,"Begin Actual Tests.");
sleep(2);
theseLogs->logN(1,"(%d) Conventional check of thoughtcrime.biz",cmd++);
theseLogs->logN(1,"(%d) LPE Check of test-validate.claimsgasix",cmd++);
theseLogs->logN(1,"(%d) Register .ote using OTE Account %d.",cmd++);
theseLogs->logN(1,"(%d) Transfer .ote to OTE Account %d.",cmd++);
theseLogs->logN(1,"(%d) Sunrise create with ICANN SMD test files.",cmd++);
theseLogs->logN(1,"End OTE Basic Access Tests.",cmd++);
sess->close();
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());
}
}