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<SessionManager> manager(SessionManagerFactory::newInstance(&props));
auto_ptr<Session> sess(SessionFactory::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"; const char *thisRegistry="Donuts", *thatAccount="secura2-ote2", *thisAccount="secura1-ote";
char *thisName; char *thisName;
@ -44,28 +44,28 @@ namespace AC_OTE {
const string claims("claims"), dpml("custom"), landrush("landrush"), sunrise("sunrise"); const string claims("claims"), dpml("custom"), landrush("landrush"), sunrise("sunrise");
const std::string rrj("renjuan"); std::string ctc("renjuan");
const std::string rrjPW("Ab9dW@rd"); std::string ctcPW("Ab9dW@rd");
const std::string rrjEmail("juan@acm.org"); std::string ctcEmail("juan@acm.org");
const std::string rrjName("Ren Ren-Juan"); std::string ctcName("Ren Ren-Juan");
const std::string rrjCity("Niagara Falls"); std::string ctcCity("Niagara Falls");
const std::vector<std::string> std::vector<std::string>
rrjCrib(1,"2926 2nd Strt"); ctcCrib(1,"2926 2nd Strt");
const std::string rrjProv("NY"); std::string ctcProv("NY");
const std::string rrjPC("14305"); std::string ctcPC("14305");
const std::string rrjGuo("US"); std::string ctcGuo("US");
const std::string rrjOrg("American Kybernetik"); std::string ctcOrg("American Kybernetik");
const std::string pw("Ab9dW@rd"); std::string pw("Ab9dW@rd");
const std::string RID("renjuan"); std::string RID("renjuan");
std::vector<std::string> tech(1,std::string("renjuan") ); std::vector<std::string> tech(1,std::string("renjuan") );
std::vector<std::string> admin(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> billing(1,std::string("renjuan") );
std::vector<std::string> ns(1,std::string("ns1.google.com") );; std::vector<std::string> ns(1,std::string("ns1.google.com") );;
const IntPostalInfo rrjPO(rrjName,rrjOrg, const IntPostalInfo ctcPO(ctcName,ctcOrg,
rrjCrib,rrjCity,rrjProv,rrjPC,rrjGuo); ctcCrib,ctcCity,ctcProv,ctcPC,ctcGuo);
LPCrtCmdExtension crtE1( &claims ), crtE2( &dpml ); LPCrtCmdExtension crtE1( &claims ), crtE2( &dpml );
Transaction thisTest; Transaction thisTest;
@ -163,7 +163,7 @@ namespace AC_OTE {
void createContact() { void createContact() {
ContactCreateCommand oteCommand_0(rrj,rrjPW,&rrjPO,rrjEmail); ContactCreateCommand oteCommand_0(ctc,ctcPW,&ctcPO,ctcEmail);
ContactCreateResponse oteResponse_0; ContactCreateResponse oteResponse_0;
theseLogs->logN(1,"(skip) Create Contact(s)."); theseLogs->logN(1,"(skip) Create Contact(s).");
@ -199,12 +199,12 @@ namespace AC_OTE {
catch (EPPException& e) catch (EPPException& e)
{ const char *eMsg = e.getMessage().c_str(); { const char *eMsg = e.getMessage().c_str();
const char *opNow = op.c_str(); const char *opNow = op.c_str();
theseLogs->logN(2,"EPP Exception during OTE B (%s): %s .",opNow,eMsg); theseLogs->logN(2,"EPP Exception during OTEX (%s): %s .",opNow,eMsg);
throw e; throw e;
} }
catch (...) catch (...)
{ {
theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str()); theseLogs->logN(1,"General ExceptionXE B (%s).",op.c_str());
} }
} }
@ -234,12 +234,12 @@ namespace AC_OTE {
} }
void transfer(bool &transferGainer) { void transfer() {
DomainTransferRequestCommand DomainTransferRequestCommand
oteCommand_4a(thisName,rrjPW); oteCommand_4a(thisName,ctcPW);
DomainTransferApproveCommand DomainTransferApproveCommand
oteCommand_4b(thisName,rrjPW); oteCommand_4b(thisName,ctcPW);
DomainTransferResponse oteResponse_4; DomainTransferResponse oteResponse_4;
try { try {
@ -265,9 +265,35 @@ namespace AC_OTE {
theseFuncs["case02"] = checkClaims; theseFuncs["case02"] = checkClaims;
theseFuncs["case03"] = create; theseFuncs["case03"] = create;
theseFuncs["case05"] = createClaimOverride; 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 } // AC_OTE
using namespace AC_OTE; using namespace AC_OTE;

View File

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

View File

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