/* * donutsOTEB.h * * Created on: Jan 28, 2014 * Author: jdaugherty */ #ifndef REGISTRYOTE_H_ #define REGISTRYOTB_H_ typedef auto_ptr AC_SESSMGR; typedef auto_ptr AC_SESSION; static AC_SESSMGR ac_mgr; static AC_SESSION ac_sess; 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 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 tech(1,std::string("renjuan") ); std::vector admin(1,std::string("renjuan") ); std::vector billing(1,std::string("renjuan") ); std::vector 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() { DomainCheckCommand *c = new DomainCheckCommand(thisName); DomainCheckResponse *r = new DomainCheckResponse(); theseLogs->logN(2,"Queue (%d) Unextended check of %s",cmd++,thisName); acq.push( new Transaction(c, r) ); } void checkClaims() { DomainCheckCommand *c = new DomainCheckCommand(thisName); LPChkCmdExtension chkE(&claims); c->appendExtension(chkE); DomainCheckResponse *r = new DomainCheckResponse(); LPChkRespExtension chkRspE; r->registerExtension(&chkRspE); theseLogs->logN(2,"(%d) Queue Claims type Check of %s",cmd++,thisName); acq.push(new Transaction(c, r)); } void create() { theseLogs->logN(3,"(%d) Queue normal create of %s ( %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() { DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing); crtE1.setNoticeID(noticeID, notAfter, acceptedDate); c->appendExtension(crtE1); DomainCreateResponse *r; theseLogs->logN(2,"(%d)Queue create %s w Notice ID test data (TCN).",++cmd,thisName); acq.push(new Transaction(c, r)); } void createContact() { theseLogs->logN(2,"(%d)Queue create contact %s.",++cmd,ctc.c_str()); ContactCreateCommand *c = new ContactCreateCommand(ctc,ctcPW,&ctcPO,ctcEmail); ContactCreateResponse *r = new ContactCreateResponse(); theseLogs->logN(2,"(%d)Queue create contact %s.",++cmd,ctc.c_str()); acq.push(new Transaction(c, r)); } void dpmlCreate() { std::string dpmlName("face.dpml.zone"); DomainCreateCommand *c = new DomainCreateCommand(dpmlName,pw,&RID, &tech, &ns, &admin, &billing); crtE2.setSMD(); c->appendExtension(crtE2); DomainCreateResponse *r = new DomainCreateResponse(); theseLogs->logN(2,"(%d) Queue DPML block create %s w boitedetest.smd data.",++cmd,dpmlName.c_str()); acq.push(new Transaction(c, r)); } void sunriseCreate() { DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing); c->appendExtension(crtE1); DomainCreateResponse *r = new DomainCreateResponse(); theseLogs->logN(2,"(%d)Queue Sunrise create %s with ICANN SMD test data.",++cmd,thisName); acq.push(new Transaction(c, r)); } void transfer() { DomainTransferRequestCommand *c0 = new DomainTransferRequestCommand(thisName,ctcPW); DomainTransferApproveCommand *c1 = new DomainTransferApproveCommand(thisName,ctcPW); DomainTransferResponse *r = new DomainTransferResponse(); thisTest = transferGainer ? new Transaction(c0, r) : new Transaction(c1, r) ; theseLogs->logN(4,"Queue %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, thisName,thatAccount); 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"); } #endif /* REGISTRY_X */