From 60e34f29ec0d015c2688c8023f45126027793bc4 Mon Sep 17 00:00:00 2001 From: Ren RenJuan Date: Wed, 29 Jan 2014 11:44:52 +0000 Subject: [PATCH] ! --- AusRegCliever/include/RegistryXOTE.h | 106 +++++++++++++++++---------- AusRegCliever/include/mdJSON.hpp | 1 - AusRegCliever/server/mdJSON.cpp | 5 +- 3 files changed, 67 insertions(+), 45 deletions(-) diff --git a/AusRegCliever/include/RegistryXOTE.h b/AusRegCliever/include/RegistryXOTE.h index 8bc7574..8af4fc4 100644 --- a/AusRegCliever/include/RegistryXOTE.h +++ b/AusRegCliever/include/RegistryXOTE.h @@ -34,7 +34,7 @@ namespace AC_OTE { auto_ptr manager(SessionManagerFactory::newInstance(&props)); auto_ptr 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 - 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 + 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 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 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 + 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; } diff --git a/AusRegCliever/include/mdJSON.hpp b/AusRegCliever/include/mdJSON.hpp index 790f20b..15f2dbf 100644 --- a/AusRegCliever/include/mdJSON.hpp +++ b/AusRegCliever/include/mdJSON.hpp @@ -18,7 +18,6 @@ public: bool fatal; mdJSON (char *fileName); - ~mdJSON(); bool parse(); bool didDie() {return fatal;} void die(){ fatal = true;} diff --git a/AusRegCliever/server/mdJSON.cpp b/AusRegCliever/server/mdJSON.cpp index da01a54..ffd9cf5 100644 --- a/AusRegCliever/server/mdJSON.cpp +++ b/AusRegCliever/server/mdJSON.cpp @@ -99,15 +99,12 @@ bool mdJSON::parse() return value; } - mdJSON::mdJSON(char *fileName) { - path = string(fileName); +//rrj path = string(fileName); } -mdJSON::~mdJSON() { -}