This commit is contained in:
parent
6bc00e701c
commit
dbef59cf01
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
extern mdLogger mdLog;
|
extern mdLogger mdLog;
|
||||||
|
|
||||||
|
XALAN_USING_XALAN(XalanDOMString)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Have to use static funcion instead of static variable
|
* Have to use static funcion instead of static variable
|
||||||
* since there is not guarantee about the construct/destruct
|
* since there is not guarantee about the construct/destruct
|
||||||
|
@ -14,10 +16,10 @@ extern mdLogger mdLog;
|
||||||
*/
|
*/
|
||||||
const std::string LPChkRespExtension::CKCLAIM_EXPR()
|
const std::string LPChkRespExtension::CKCLAIM_EXPR()
|
||||||
{
|
{
|
||||||
return EXTENSION_EXPR() + "/launch:cd/launch:name";
|
return EXTENSION_EXPR() + "//launch:name@exists";
|
||||||
}
|
}
|
||||||
|
|
||||||
LPChkRespExtension::LPChkRespExtension() : typeIsClaims(true)
|
LPChkRespExtension::LPChkRespExtension() : typeIsClaims(true), initialised(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,15 +27,15 @@ void LPChkRespExtension::fromXML(XMLDocument *xmlDoc)
|
||||||
{
|
{
|
||||||
const std::string respElement = CKCLAIM_EXPR();
|
const std::string respElement = CKCLAIM_EXPR();
|
||||||
const XalanNode * responSE = xmlDoc->getElement(respElement);
|
const XalanNode * responSE = xmlDoc->getElement(respElement);
|
||||||
const std::string respAttr("exists");
|
const XalanDOMString respValue("false");
|
||||||
|
|
||||||
|
initialised = true;
|
||||||
if (!responSE) {
|
if (!responSE) {
|
||||||
mdLog.logN(0,"Parse error in LPChkResponse");
|
mdLog.logN(0,"Parse error in LPChkResponse");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (responSE->getAttributes()) {}
|
if (responSE->getNodeValue().compare(respValue) != 0)
|
||||||
|
response = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,23 @@ class LPChkRespExtension : public ResponseExtension
|
||||||
|
|
||||||
virtual void fromXML(XMLDocument *xmlDoc);
|
virtual void fromXML(XMLDocument *xmlDoc);
|
||||||
bool affirmativeResponse();
|
bool affirmativeResponse();
|
||||||
|
bool getClaimsStatus() { return response; }
|
||||||
|
virtual bool isInitialised() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const XMLDocument *xmlDoc;
|
const XMLDocument *xmlDoc;
|
||||||
|
|
||||||
bool typeIsClaims; // False implies type is availablity
|
bool typeIsClaims; // False implies type is availablity
|
||||||
|
bool initialised;
|
||||||
bool response; // true/false attribute in reply
|
bool response; // true/false attribute in reply
|
||||||
|
|
||||||
static const std::string CKCLAIM_EXPR();
|
static const std::string CKCLAIM_EXPR();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline bool LPChkRespExtension::isInitialised() const
|
||||||
|
{
|
||||||
|
return initialised;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* LPCK_RESPONSE_EXTENSION_H_ */
|
#endif /* LPCK_RESPONSE_EXTENSION_H_ */
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
#include "se/ContactCreateResponse.hpp"
|
#include "se/ContactCreateResponse.hpp"
|
||||||
#include "se/DomainCreateCommand.hpp"
|
#include "se/DomainCreateCommand.hpp"
|
||||||
#include "se/DomainCreateResponse.hpp"
|
#include "se/DomainCreateResponse.hpp"
|
||||||
#include "se/DomainTransferCommand.hpp"
|
#include "se/DomainTransferApproveCommand.hpp"
|
||||||
|
#include "se/DomainTransferRequestCommand.hpp"
|
||||||
#include "se/DomainTransferResponse.hpp"
|
#include "se/DomainTransferResponse.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -31,13 +32,13 @@ using namespace std;
|
||||||
// : PostalInfo (type, name, org, street, city, state, pc, guo) { };
|
// : PostalInfo (type, name, org, street, city, state, pc, guo) { };
|
||||||
//};
|
//};
|
||||||
|
|
||||||
char *name1 = "bestever.camera";
|
char *name1 = "bestever.camera"; //
|
||||||
char *name2 = "yoda.guru";
|
char *name2 = "yoda.guru";
|
||||||
char *name3 = "pricey.holdings";
|
char *name3 = "pricey.holdings"; //
|
||||||
char *name4 = "unicycles.bike";
|
char *name4 = "unicycles.bike";
|
||||||
char *name5 = "greedy.ventures";
|
char *name5 = "greedy.ventures"; //
|
||||||
char *name6 = "shady.ventures";
|
char *name6 = "shady.ventures"; //
|
||||||
char *name7 = "hemmarhoid.camera";
|
char *name7 = "hemmarhoid.camera"; //
|
||||||
|
|
||||||
static TestEnvironment props;
|
static TestEnvironment props;
|
||||||
|
|
||||||
|
@ -105,10 +106,10 @@ void ausRegEPPTK::doOTEA()
|
||||||
}
|
}
|
||||||
void ausRegEPPTK::doOTEB()
|
void ausRegEPPTK::doOTEB()
|
||||||
{
|
{
|
||||||
bool addDomains = true, debug=true, contactCreated = true, doTransfers = false,
|
bool addDomains = false, debug=true, contactCreated = true, doTransfers = true,
|
||||||
transferGainer = false;
|
transferGainer = false;
|
||||||
int cmd=0;
|
int cmd=0;
|
||||||
const char *thatAccount="secura2-ote", *thisAccount="secura1-ote";
|
const char *thatAccount="secura2-ote2", *thisAccount="secura1-ote";
|
||||||
|
|
||||||
string op("newInstance");
|
string op("newInstance");
|
||||||
const string claims("claims"), sunrise("sunrise"),
|
const string claims("claims"), sunrise("sunrise"),
|
||||||
|
@ -130,14 +131,12 @@ void ausRegEPPTK::doOTEB()
|
||||||
|
|
||||||
sess->open();
|
sess->open();
|
||||||
|
|
||||||
theseLogs->logN(1,"OTE Basic Access [Hello] (%d).",cmd++);
|
theseLogs->logN(2,"OTE %s [Hello] (%d).",thisAccount,cmd++);
|
||||||
sess->writeXML(TEST_SE);
|
sess->writeXML(TEST_SE);
|
||||||
sess->read();
|
sess->read();
|
||||||
|
|
||||||
theseLogs->logN(1,"OTE Basic Access Setup (%d).",cmd++);
|
theseLogs->logN(1,"OTE Basic Access Setup (%d).",cmd++);
|
||||||
|
|
||||||
// const PostalInfoType *pits=new PostalInfoType(string("int"));
|
|
||||||
|
|
||||||
const std::string rrj("renjuan");
|
const std::string rrj("renjuan");
|
||||||
const std::string rrjPW("Ab9dW@rd");
|
const std::string rrjPW("Ab9dW@rd");
|
||||||
const std::string rrjEmail("juan@acm.org");
|
const std::string rrjEmail("juan@acm.org");
|
||||||
|
@ -221,7 +220,6 @@ void ausRegEPPTK::doOTEB()
|
||||||
std::vector<std::string> ns(1,std::string("ns1.google.com") );;
|
std::vector<std::string> ns(1,std::string("ns1.google.com") );;
|
||||||
|
|
||||||
|
|
||||||
theseLogs->logN(2," (%d) create in OTE %s.",cmd++, thisAccount);
|
|
||||||
LPCrtCmdExtension crtE1(&sunrise);
|
LPCrtCmdExtension crtE1(&sunrise);
|
||||||
|
|
||||||
if (addDomains) {
|
if (addDomains) {
|
||||||
|
@ -229,24 +227,25 @@ void ausRegEPPTK::doOTEB()
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (1) {
|
if (1) {
|
||||||
DomainCreateCommand
|
|
||||||
oteCommand_3(name3,pw,&RID, &tech, &ns, &admin, &billing);
|
|
||||||
oteCommand_3.appendExtension(crtE1);
|
|
||||||
DomainCreateResponse oteResponse_3;
|
|
||||||
LPCrtRespExtension crtRespE;
|
|
||||||
oteResponse_3.registerExtension(&crtRespE);
|
|
||||||
|
|
||||||
|
theseLogs->logN(3," (%d) normal create %s in OTE %s.",cmd++, name6, thisAccount);
|
||||||
|
DomainCreateCommand
|
||||||
|
oteCommand_3(name6,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
|
DomainCreateResponse oteResponse_3;
|
||||||
thisTest = Transaction(&oteCommand_3, &oteResponse_3);
|
thisTest = Transaction(&oteCommand_3, &oteResponse_3);
|
||||||
manager->execute(thisTest);
|
manager->execute(thisTest);
|
||||||
} if (0) {
|
|
||||||
DomainCreateCommand
|
|
||||||
oteCommand_3a(name2,pw,&RID, &tech, &ns, &admin, &billing);
|
|
||||||
oteCommand_3a.appendExtension(crtE1);
|
|
||||||
DomainCreateResponse oteResponse_3a;
|
|
||||||
|
|
||||||
|
} if (1) {
|
||||||
|
|
||||||
|
theseLogs->logN(3," (%d) normal create %s in OTE %s.",cmd++, name7, thisAccount);
|
||||||
|
DomainCreateCommand
|
||||||
|
oteCommand_3a(name7,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
|
DomainCreateResponse oteResponse_3a;
|
||||||
thisTest = Transaction(&oteCommand_3a, &oteResponse_3a);
|
thisTest = Transaction(&oteCommand_3a, &oteResponse_3a);
|
||||||
manager->execute(thisTest);
|
manager->execute(thisTest);
|
||||||
|
|
||||||
} if (0) {
|
} if (0) {
|
||||||
|
theseLogs->logN(3," (%d) LPE create %s in OTE %s.",cmd++, name5, thisAccount);
|
||||||
DomainCreateCommand
|
DomainCreateCommand
|
||||||
oteCommand_3b(name5,pw,&RID, &tech, &ns, &admin, &billing);
|
oteCommand_3b(name5,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
oteCommand_3b.appendExtension(crtE1);
|
oteCommand_3b.appendExtension(crtE1);
|
||||||
|
@ -255,13 +254,14 @@ void ausRegEPPTK::doOTEB()
|
||||||
thisTest = Transaction(&oteCommand_3b, &oteResponse_3b);
|
thisTest = Transaction(&oteCommand_3b, &oteResponse_3b);
|
||||||
manager->execute(thisTest);
|
manager->execute(thisTest);
|
||||||
} if (0) {
|
} if (0) {
|
||||||
DomainCreateCommand
|
theseLogs->logN(3," (%d) LPE create %s in OTE %s.",cmd++, name4, thisAccount);
|
||||||
|
/* DomainCreateCommand
|
||||||
oteCommand_3c(name4,pw,&RID, &tech, &ns, &admin, &billing);
|
oteCommand_3c(name4,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
oteCommand_3c.appendExtension(crtE1);
|
oteCommand_3c.appendExtension(crtE1);
|
||||||
DomainCreateResponse oteResponse_3c;
|
DomainCreateResponse oteResponse_3c;
|
||||||
|
|
||||||
thisTest = Transaction(&oteCommand_3c, &oteResponse_3c);
|
thisTest = Transaction(&oteCommand_3c, &oteResponse_3c);
|
||||||
manager->execute(thisTest);
|
manager->execute(thisTest); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (EPPException& e)
|
catch (EPPException& e)
|
||||||
|
@ -276,20 +276,37 @@ void ausRegEPPTK::doOTEB()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
theseLogs->logN(4,"skip %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, name1,thatAccount);
|
|
||||||
|
|
||||||
if (doTransfers) {
|
if (doTransfers) {
|
||||||
|
|
||||||
const TransferOp *thisTransfer =
|
// const TransferOp *thisTransfer =
|
||||||
transferGainer ? new TransferOp("request") : new TransferOp("approve") ;
|
// transferGainer ? new TransferOp("request") : new TransferOp("approve") ;
|
||||||
|
|
||||||
DomainTransferCommand
|
DomainTransferRequestCommand
|
||||||
oteCommand_4(thisTransfer,name1);
|
oteCommand_4a(name1,rrjPW);
|
||||||
|
DomainTransferApproveCommand
|
||||||
|
oteCommand_4b(name1,rrjPW);
|
||||||
DomainTransferResponse oteResponse_4;
|
DomainTransferResponse oteResponse_4;
|
||||||
|
|
||||||
|
DomainTransferRequestCommand
|
||||||
|
oteCommand_4c(name7,rrjPW);
|
||||||
|
DomainTransferApproveCommand
|
||||||
|
oteCommand_4d(name7,rrjPW);
|
||||||
|
DomainTransferResponse oteResponse_4a;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
thisTest = Transaction(&oteCommand_4, &oteResponse_4);
|
theseLogs->logN(4," %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, name1,thatAccount);
|
||||||
|
|
||||||
|
thisTest = transferGainer ? Transaction(&oteCommand_4a, &oteResponse_4) :
|
||||||
|
Transaction(&oteCommand_4b, &oteResponse_4) ;
|
||||||
|
manager->execute(thisTest);
|
||||||
|
|
||||||
|
theseLogs->logN(4," %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, name7,thatAccount);
|
||||||
|
|
||||||
|
thisTest = transferGainer ? Transaction(&oteCommand_4c, &oteResponse_4a) :
|
||||||
|
Transaction(&oteCommand_4d, &oteResponse_4) ;
|
||||||
|
|
||||||
manager->execute(thisTest);
|
manager->execute(thisTest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -342,6 +359,7 @@ void ausRegEPPTK::doOTEB()
|
||||||
theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str());
|
theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
theseLogs->logN(0,"End OTE Session.");
|
theseLogs->logN(0,"End OTE Session.");
|
||||||
|
|
||||||
sess->close();
|
sess->close();
|
||||||
|
|
Loading…
Reference in New Issue