This commit is contained in:
Ren RenJuan 2014-01-21 01:34:40 +00:00
parent 0d764d3d2d
commit 712f5e7707
7 changed files with 130 additions and 32 deletions

View File

@ -22,7 +22,7 @@
#include <mdLogger.h> #include <mdLogger.h>
const char *otePeer="epp.ote.donuts.co"; const char *otePeer="epp.ote.donuts.co";
int tkScenario=0; int tkScenario=0;
mdLogger mdLog; mdLogger mdLog;
namespace { namespace {

View File

@ -3,9 +3,13 @@
#include <string> #include <string>
#ifndef AC_MD
char *userLogPath = "./logs/"; char *userLogPath = "./logs/";
int tkDebugThreshold = 9999999999; int tkDebugThreshold = 9999999999;
#endif
void init(const std::string &system_props_file); void init(const std::string &system_props_file);
void scenario(int which,const std::string &system_props_file); void scenario(int which,const std::string &system_props_file);

View File

@ -42,13 +42,13 @@ ACSession::~ACSession()
void ACSession::run() { void ACSession::run() {
mdLog.logN(0,"Begin Toolkit Scenario %d Session",tkScenario); mdLog.logN(1,"Begin Toolkit Scenario %d Session",tkScenario);
SessionManagerImpl::run(); SessionManagerImpl::run();
} }
void ACSession::shutdown() { void ACSession::shutdown() {
SessionManagerImpl::shutdown(); SessionManagerImpl::shutdown();
mdLog.logN(0,"End Toolkit Scenario %d Session",tkScenario); mdLog.logN(1,"End Toolkit Scenario %d Session",tkScenario);
} }

View File

@ -75,7 +75,7 @@ void SessionPoolImpl::init()
long SessionPoolImpl::keepAlive() throw (EPPIOException) long SessionPoolImpl::keepAlive() throw (EPPIOException)
{ {
debugLogger->LOG_FINEST("enter"); //debugLogger->LOG_FINEST("enter");
for (PoolIter session = pool.begin(); session != pool.end(); ++session) for (PoolIter session = pool.begin(); session != pool.end(); ++session)
{ {
@ -85,7 +85,7 @@ long SessionPoolImpl::keepAlive() throw (EPPIOException)
(*session)->keepAlive(); (*session)->keepAlive();
} }
} }
debugLogger->LOG_FINEST("exit"); //debugLogger->LOG_FINEST("exit");
return pollInterval; return pollInterval;
} }

View File

@ -64,7 +64,7 @@ SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thre
DLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thread -l log4cpp DLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thread -l log4cpp
SINCL= -I include -I /usr/include/log4cpp $(BOSINCL) SINCL= -I include -I /usr/include/log4cpp $(BOSINCL)
CFLAGS= -DCURRENT_DEBUG=1000 -ggdb3 -DARTKENABLED=$(ARTKENABLED) CFLAGS= -DCURRENT_DEBUG=1000 -ggdb3 -DARTKENABLED=$(ARTKENABLED) -DAC_MD
# #
# ---------- Should not need to change below # ---------- Should not need to change below

Binary file not shown.

View File

@ -2,6 +2,7 @@
#include "cliever-md.h" #include "cliever-md.h"
#include "session/SessionFactory.hpp" #include "session/SessionFactory.hpp"
#include "session/SessionManagerProperties.hpp" #include "session/SessionManagerProperties.hpp"
#include "session/Transaction.hpp"
#include "common/SystemProperties.hpp" #include "common/SystemProperties.hpp"
#include "session/Session.hpp" #include "session/Session.hpp"
#include "session/StatsManager.hpp" #include "session/StatsManager.hpp"
@ -9,15 +10,27 @@
#include "se/DomainCheckResponse.hpp" #include "se/DomainCheckResponse.hpp"
#include "OTE/LPECheckCommand.hpp" #include "OTE/LPECheckCommand.hpp"
#include "OTE/LPECheckResponse.hpp" #include "OTE/LPECheckResponse.hpp"
#include "se/TransferOp.hpp"
#include "se/PostalInfo.hpp"
#include "se/ContactCreateCommand.hpp"
#include "se/ContactCreateResponse.hpp"
#include "se/DomainCreateCommand.hpp" #include "se/DomainCreateCommand.hpp"
#include "se/DomainCreateResponse.hpp" #include "se/DomainCreateResponse.hpp"
#include "se/DomainRegistrantTransferCommand.hpp" #include "se/DomainTransferCommand.hpp"
#include "se/DomainRegistrantTransferResponse.hpp" #include "se/DomainTransferResponse.hpp"
#include "OTE/LPECreateCommand.hpp" #include "OTE/LPECreateCommand.hpp"
#include "OTE/LPECreateResponse.hpp" #include "OTE/LPECreateResponse.hpp"
using namespace std; using namespace std;
class RRJPI : public PostalInfo {
public:
RRJPI(const PostalInfoType *type,const string& name, const string& org,
const std::vector<std::string>& street, const string& city,
const string& state,const string& pc, const string& guo)
: PostalInfo (type, name, org, street, city, state, pc, guo) { };
};
static TestEnvironment props; static TestEnvironment props;
static std::string TEST_SE = static std::string TEST_SE =
@ -83,12 +96,14 @@ void ausRegEPPTK::doOTEA()
} }
} }
void ausRegEPPTK::doOTEB() void ausRegEPPTK::doOTEB()
{ { bool debug=true;
int cmd=0,thisAccount=0; int cmd=0,thisAccount=0;
string op("newInstance"); string op("newInstance");
Transaction thisTest;
scenario(tkScenario,thisConfig->cfg_path); scenario(thisConfig->tkScenario,thisConfig->cfg_path);
while(debug) { debug=false; // debugger needs this
try { try {
Timer::setTime("20140101.010101"); Timer::setTime("20140101.010101");
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props)); auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
@ -103,49 +118,127 @@ void ausRegEPPTK::doOTEB()
theseLogs->logN(1,"OTE Basic Access [Hello] (%d).",cmd++); theseLogs->logN(1,"OTE Basic Access [Hello] (%d).",cmd++);
sess->writeXML(TEST_SE); sess->writeXML(TEST_SE);
sess->read(); sess->read();
theseLogs->logN(1,"Begin Actual Tests.");
sleep(2);
theseLogs->logN(1,"(%d) Conventional check of thoughtcrime.biz",cmd++);
DomainCheckCommand baCommand_1("thoughtcrime.biz"); theseLogs->logN(1,"OTE Basic Access Setup (%d).",cmd++);
const PostalInfoType *pits=new PostalInfoType(string("int"));
const std::string rrj("renjuan");
const std::string rrjPW("Ab9dW@rd");
const std::string rrjEmail("juan@acm.org");
const std::string rrjName("Ren Ren-Juan");
const std::string rrjCity("Niagara Falls");
const std::vector<std::string>
rrjCrib(1,"2926 2nd Strt");
const std::string rrjProv("NY");
const std::string rrjPC("14305");
const std::string rrjGuo("US");
const std::string rrjOrg("American Kybernetik");
const RRJPI rrjPO(pits,rrjName,rrjOrg,
rrjCrib,rrjCity,rrjProv,rrjPC,rrjGuo);
ContactCreateCommand baCommand_0(rrj,rrjPW,&rrjPO,rrjEmail);
ContactCreateResponse baResponse_0;
try {
thisTest = Transaction(&baCommand_0, &baResponse_0);
manager->execute(thisTest);
}
catch(...)
{
theseLogs->logN(1,"Case %d Failed, harness catch.",cmd++);
}
theseLogs->logN(1,"Begin Basic Access OTE Transactions.");
sleep(2);
theseLogs->logN(1,"(%d) Conventional check of yoda.guru",cmd++);
DomainCheckCommand baCommand_1("yoda.guru");
DomainCheckResponse baResponse_1; DomainCheckResponse baResponse_1;
theseLogs->logN(1,"(%d) LPE Check of test-validate.claimsgasix",cmd++); try {
thisTest = Transaction(&baCommand_1, &baResponse_1);
manager->execute(thisTest);
}
catch(...)
{
theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++);
}
LPECheckCommand baCommand_2("test-validate.claimsgasix"); theseLogs->logN(1,"(%d) LPE Check of pricey.holdings",cmd++);
LPECheckCommand baCommand_2("pricey.holdings");
LPECheckResponse baResponse_2; LPECheckResponse baResponse_2;
theseLogs->logN(2,"(%d) Register <registrar>.ote using OTE Account %d.",cmd++, thisTest = Transaction(&baCommand_2, &baResponse_2);
manager->execute(thisTest);
const std::string pw("Ab9dW@rd");
const std::string RID("renjuan");
std::vector<std::string> tech(1,std::string("renjuan") );
std::vector<std::string> admin(1,std::string("renjuan") );
std::vector<std::string> billing(1,std::string("renjuan") );
std::vector<std::string> ns(1,std::string("ns1.google.com") );;
// admin.push_back(std::string("Administration"));
// tech.push_back(std::string("Technical"));
// billing.push_back(std::string("Billing"));
// ns.push_back(std::string("ns1.google.com"));
try { theseLogs->logN(2,"(%d) Try creating bestever.camera using OTE %d.",cmd++,
thisAccount++); thisAccount++);
const std::string pw("password"); DomainCreateCommand baCommand_3("bestever.camera",pw,&RID,
const std::string RID("registrantID"); &tech, &ns, &admin, &billing);
DomainCreateCommand baCommand_3("secura1.ote",pw,&RID);
DomainCreateResponse baResponse_3; DomainCreateResponse baResponse_3;
thisTest = Transaction(&baCommand_3, &baResponse_3);
manager->execute(thisTest);
theseLogs->logN(2,"(%d) Transfer <registrar>.ote to OTE Account %d.",cmd++, }
catch(...)
{
theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++);
}
theseLogs->logN(2,"(%d) Transfer bestever.camera to OTE Account %d.",cmd++,
thisAccount++); thisAccount++);
const XMLGregorianCalendar curExpDate; const TransferOp *thisTransfer = new TransferOp("request");
const std::string kvListName;
const std::string explanation;
DomainRegistrantTransferCommand DomainTransferCommand
baCommand_4("secura1.ote",curExpDate,kvListName,explanation); baCommand_4(thisTransfer,"bestever.camera");
DomainRegistrantTransferResponse baResponse_4; DomainTransferResponse baResponse_4;
theseLogs->logN(1,"(%d) Sunrise create with ICANN SMD test files.",cmd++); try {
LPECreateCommand baCommand_5("test-validate.claimsgasix",pw,&RID); thisTest = Transaction(&baCommand_4, &baResponse_4);
manager->execute(thisTest);
}
catch(...)
{
theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++);
}
theseLogs->logN(1,"(%d) Sunrise create bestever.camera with ICANN SMD test files.",cmd++);
LPECreateCommand baCommand_5("bestever.camera",pw,&RID);
LPECreateResponse baResponse_5; LPECreateResponse baResponse_5;
theseLogs->logN(1,"(%d) Attempt create subject to claims.",cmd++); thisTest = Transaction(&baCommand_5, &baResponse_5);
manager->execute(thisTest);
theseLogs->logN(1,"(%d) Create test-validate.claimsgasix (TCN).",cmd++);
LPECreateCommand baCommand_6("test-validate.claimsgasix",pw,&RID); LPECreateCommand baCommand_6("test-validate.claimsgasix",pw,&RID);
LPECreateResponse baResponse_6; LPECreateResponse baResponse_6;
thisTest = Transaction(&baCommand_6, &baResponse_6);
manager->execute(thisTest);
theseLogs->logN(1,"End OTE Basic Access Tests.",cmd++); theseLogs->logN(1,"End OTE Basic Access Tests.",cmd++);
sess->close(); sess->close();
@ -163,6 +256,7 @@ void ausRegEPPTK::doOTEB()
theseLogs->logN(2,"General Exception during OTE B (%s).",op.c_str()); theseLogs->logN(2,"General Exception during OTE B (%s).",op.c_str());
} }
}// debug while
} }
void ausRegEPPTK::doOTEP() void ausRegEPPTK::doOTEP()