This commit is contained in:
Ren RenJuan 2014-01-29 11:44:52 +00:00
parent 9625729264
commit 60e34f29ec
3 changed files with 67 additions and 45 deletions

View File

@ -34,7 +34,7 @@ namespace AC_OTE {
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
auto_ptr<Session> sess(SessionFactory::newInstance(&props));
bool acTkInitialised = false, fatal = false, done = false;
bool acTkInitialised = false, fatal = false, done = false, transferGainer;
const char *thisRegistry="Donuts", *thatAccount="secura2-ote2", *thisAccount="secura1-ote";
char *thisName;
@ -44,28 +44,28 @@ namespace AC_OTE {
const string claims("claims"), dpml("custom"), landrush("landrush"), sunrise("sunrise");
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");
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");
const std::string pw("Ab9dW@rd");
const std::string RID("renjuan");
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 rrjPO(rrjName,rrjOrg,
rrjCrib,rrjCity,rrjProv,rrjPC,rrjGuo);
const IntPostalInfo ctcPO(ctcName,ctcOrg,
ctcCrib,ctcCity,ctcProv,ctcPC,ctcGuo);
LPCrtCmdExtension crtE1( &claims ), crtE2( &dpml );
Transaction thisTest;
@ -163,7 +163,7 @@ namespace AC_OTE {
void createContact() {
ContactCreateCommand oteCommand_0(rrj,rrjPW,&rrjPO,rrjEmail);
ContactCreateCommand oteCommand_0(ctc,ctcPW,&ctcPO,ctcEmail);
ContactCreateResponse oteResponse_0;
theseLogs->logN(1,"(skip) Create Contact(s).");
@ -185,29 +185,29 @@ namespace AC_OTE {
void dpmlCreate() { std::string dpmlName("face.dpml.zone");
theseLogs->logN(2,"(%d) Create %s w ICANN SMD file.",++cmd,dpmlName.c_str());
theseLogs->logN(2,"(%d) Create %s w ICANN SMD file.",++cmd,dpmlName.c_str());
DomainCreateCommand oteCommand_7(dpmlName,pw,&RID, &tech, &ns, &admin, &billing);
crtE2.setSMD();
oteCommand_7.appendExtension(crtE2);
DomainCreateResponse oteResponse_7;
DomainCreateCommand oteCommand_7(dpmlName,pw,&RID, &tech, &ns, &admin, &billing);
crtE2.setSMD();
oteCommand_7.appendExtension(crtE2);
DomainCreateResponse oteResponse_7;
try {
thisTest = Transaction(&oteCommand_7, &oteResponse_7);
manager->execute(thisTest);
}
catch (EPPException& e)
{ const char *eMsg = e.getMessage().c_str();
const char *opNow = op.c_str();
theseLogs->logN(2,"EPP Exception during OTE B (%s): %s .",opNow,eMsg);
throw e;
}
catch (...)
try {
thisTest = Transaction(&oteCommand_7, &oteResponse_7);
manager->execute(thisTest);
}
catch (EPPException& e)
{ const char *eMsg = e.getMessage().c_str();
const char *opNow = op.c_str();
theseLogs->logN(2,"EPP Exception during OTEX (%s): %s .",opNow,eMsg);
throw e;
}
catch (...)
{
theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str());
theseLogs->logN(1,"General ExceptionXE B (%s).",op.c_str());
}
}
}
void sunriseCreate() {
@ -234,12 +234,12 @@ namespace AC_OTE {
}
void transfer(bool &transferGainer) {
void transfer() {
DomainTransferRequestCommand
oteCommand_4a(thisName,rrjPW);
oteCommand_4a(thisName,ctcPW);
DomainTransferApproveCommand
oteCommand_4b(thisName,rrjPW);
oteCommand_4b(thisName,ctcPW);
DomainTransferResponse oteResponse_4;
try {
@ -265,9 +265,35 @@ namespace AC_OTE {
theseFuncs["case02"] = checkClaims;
theseFuncs["case03"] = create;
theseFuncs["case05"] = createClaimOverride;
theseFuncs["case04"] = sunriseCreate;
theseFuncs["case06"] = transfer;
}
bool setupTestCase(Json::Value where) { // Set recognized variables, silently ignore others
int i;
for (i=0;i<where.size();i++) {
thisName = (char *)where[i].get("name","missing").asString().c_str();
ctc = where[i].get("cont_id","renjuan").asString();
ctcPW = where[i].get("cont_pw","Ab9dW@rd").asString(); /*
ctcEmail = (char *)where[i].get("cont_email","juan@acm.org").asString();
ctcName = where[i].get("cont_name","Ren Ren-Juan").asString().c_str();
ctcCity = "Niagara Falls"
const std::vector<std::string>
ctcCrib = (1,"2926 2nd Street"
ctcProv = "NY"
ctcPC = "14305"
ctcGuo = "US"
ctcOrg = "American Kybernetik"
RID = "renjuan" */
}
}
} // AC_OTE
using namespace AC_OTE;
@ -299,7 +325,7 @@ bool ausRegEPPTK::registryXOTE()
theseLogs->logN(0,"No logic to bind to '%s', need it.");
return false;
}
theseCases[AC_OTE::nCases].parms = &suite[i];
theseCases[AC_OTE::nCases].parms = &suite[i];
theseCases[AC_OTE::nCases].fBody = theseFuncs[thisItem];
theseCases[AC_OTE::nCases++].caseName = thisItem;
}

View File

@ -18,7 +18,6 @@ public:
bool fatal;
mdJSON (char *fileName);
~mdJSON();
bool parse();
bool didDie() {return fatal;}
void die(){ fatal = true;}

View File

@ -99,15 +99,12 @@ bool mdJSON::parse()
return value;
}
mdJSON::mdJSON(char *fileName) {
path = string(fileName);
//rrj path = string(fileName);
}
mdJSON::~mdJSON() {
}