DRDE/AusRegCliever/include/AC_OTE.h

176 lines
5.5 KiB
C++

/*
* donutsOTEB.h
*
* Created on: Jan 28, 2014
* Author: jdaugherty
*/
#ifndef REGISTRYOTE_H_
#define REGISTRYOTB_H_
typedef auto_ptr<SessionManager> AC_SESSMGR;
typedef auto_ptr<Session> AC_SESSION;
static AC_SESSMGR ac_mgr;
static AC_SESSION ac_sess;
namespace AC_OTE {
static int nCases;
testCases theseCases;
testFuncs theseFuncs;
bool acTkInitialised = false, fatal = false, done = false, transferGainer;
const char *thisRegistry="Unknown", *thatAccount="Unknown", *thisAccount="Unknown";
char *thisName;
int cmd=0,debug=1000;
string op("newInstance");
const string claims("claims"), dpml("custom"), landrush("landrush"), sunrise("sunrise");
std::string ctc("renjuan");
std::string ctcPW("Ab9dW@rd");
std::string ctcEmail("juan@acm.org");
std::string ctcName("Ren Ren-Juan");
std::string ctcCity("Niagara Falls");
std::vector<std::string>
ctcCrib(1,"2926 2nd Strt");
std::string ctcProv("NY");
std::string ctcPC("14305");
std::string ctcGuo("US");
std::string ctcOrg("American Kybernetik");
std::string pw("Ab9dW@rd");
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") );;
const IntPostalInfo ctcPO(ctcName,ctcOrg,
ctcCrib,ctcCity,ctcProv,ctcPC,ctcGuo);
LPCrtCmdExtension crtE1( &claims ), crtE2( &dpml );
Transaction *thisTest;
void check() {
theseLogs->logN(2,"Queue (%d) Unextended check of %s",cmd++,thisName);
DomainCheckCommand *c = new DomainCheckCommand(thisName);
DomainCheckResponse *r = new DomainCheckResponse();
acq.push( new Transaction(c, r) );
}
void checkClaims() {
theseLogs->logN(2,"(%d) Queue Claims type Check of %s",cmd++,thisName);
DomainCheckCommand *c = new DomainCheckCommand(thisName);
LPChkCmdExtension chkE(&claims);
c->appendExtension(chkE);
DomainCheckResponse *r = new DomainCheckResponse();
LPChkRespExtension chkRspE;
r->registerExtension(&chkRspE);
acq.push(new Transaction(c, r));
}
void create() {
theseLogs->logN(3," (%d) normal create %s in OTE %s.",cmd++, thisName, thisAccount);
DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing);
DomainCreateResponse *r = new DomainCreateResponse();
acq.push(new Transaction(c, r));
}
string noticeID("d85159710000000000000008692"),
notAfter("2015-01-01T12:00:00Z"), acceptedDate("2014-01-27T19:00:00Z");
void createClaimOverride() {
theseLogs->logN(2,"(%d) Create %s w Notice ID test data (TCN).",++cmd,thisName);
DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing);
crtE1.setNoticeID(noticeID, notAfter, acceptedDate);
c->appendExtension(crtE1);
DomainCreateResponse *r;
acq.push(new Transaction(c, r));
}
void createContact() {
theseLogs->logN(0,"Create a Contact.");
ContactCreateCommand *c = new ContactCreateCommand(ctc,ctcPW,&ctcPO,ctcEmail);
ContactCreateResponse *r = new ContactCreateResponse();
acq.push(new Transaction(c, r));
}
void dpmlCreate() { std::string dpmlName("face.dpml.zone");
theseLogs->logN(2,"(%d) Create %s w ICANN SMD file.",++cmd,dpmlName.c_str());
DomainCreateCommand *c = new DomainCreateCommand(dpmlName,pw,&RID, &tech, &ns, &admin, &billing);
crtE2.setSMD();
c->appendExtension(crtE2);
DomainCreateResponse *r = new DomainCreateResponse();
acq.push(new Transaction(c, r));
}
void sunriseCreate() {
theseLogs->logN(2,"(%d) Sunrise create %s with ICANN SMD test data.",++cmd,thisName);
DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing);
c->appendExtension(crtE1);
DomainCreateResponse *r = new DomainCreateResponse();
acq.push(new Transaction(c, r));
}
void transfer() {
DomainTransferRequestCommand *c0 = new DomainTransferRequestCommand(thisName,ctcPW);
DomainTransferApproveCommand *c1 = new DomainTransferApproveCommand(thisName,ctcPW);
DomainTransferResponse *r = new DomainTransferResponse();
theseLogs->logN(4," %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, thisName,thatAccount);
thisTest = transferGainer ? new Transaction(c0, r) : new Transaction(c1, r) ;
acq.push(thisTest);
} // transfer
int setFuncs() {
theseFuncs["case00"] = createContact;
theseFuncs["case01"] = check;
theseFuncs["case02"] = checkClaims;
theseFuncs["case03"] = create;
theseFuncs["case04"] = sunriseCreate;
theseFuncs["case05"] = createClaimOverride;
theseFuncs["case06"] = transfer;
theseLogs->logN(0,"7 test case backends available for scripting");
}
} // AC_OTE namespace
#endif /* REGISTRY_X */