This commit is contained in:
Ren RenJuan 2014-01-29 02:48:14 +00:00
parent 5df36b62f5
commit 9625729264
2 changed files with 66 additions and 22 deletions

View File

@ -77,7 +77,7 @@ CLFLAGS= -Wall -Wundef -Wpointer-arith -Wshadow \
-Wstrict-prototypes -Waggregate-return -Wno-implicit
ACOBJS= build/cliever.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \
build/mdHost.o build/mdState.o build/mdJSON.o build/mdAusReg.o
build/mdHost.o build/mdState.o build/mdAusReg.o build/mdJSON.o
MDOBJS= build/md.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \
build/mdHost.o build/mdState.o
@ -103,28 +103,28 @@ md: build/ausreg-md
build/mdLogger.o: server/mdLogger.cpp include/mdLogger.h
$(CC) $(CFLAGS) server/mdLogger.cpp -c -o build/mdLogger.o $(SINCL) $(ARTKINCL)
build/cliever.o: server/cliever-md.cpp include/*.h
build/cliever.o: server/cliever-md.cpp include/cliever-md.h
$(CC) $(CFLAGS) server/cliever-md.cpp -c -o build/cliever.o $(SINCL) $(ARTKINCL)
build/md.o: server/cliever-md.cpp include/*.h
build/md.o: server/cliever-md.cpp include/cliever-md.h
$(CC) $(CFLAGS) server/cliever-md.cpp -c -o build/md.o $(SINCL)
build/masterDaemonConfig.o: server/masterDaemonConfig.cpp include/*.h
build/masterDaemonConfig.o: server/masterDaemonConfig.cpp include/masterDaemonConfig.h
$(CC) $(CFLAGS) server/masterDaemonConfig.cpp -c -o build/masterDaemonConfig.o $(SINCL) $(ARTKINCL)
build/mdHost.o: server/mdHost.cpp include/*.h
build/mdHost.o: server/mdHost.cpp include/mdHost.h
$(CC) $(CFLAGS) server/mdHost.cpp -c -o build/mdHost.o $(SINCL) $(ARTKINCL)
build/mdState.o: server/mdState.cpp include/*.h
build/mdState.o: server/mdState.cpp include/mdState.h
$(CC) $(CFLAGS) server/mdState.cpp -c -o build/mdState.o $(SINCL) $(ARTKINCL)
build/masterDaemon.o: server/masterDaemon.cpp include/*.h
build/masterDaemon.o: server/masterDaemon.cpp include/masterDaemon.h
$(CC) $(CFLAGS) server/masterDaemon.cpp -c -o build/masterDaemon.o $(SINCL) $(ARTKINCL)
build/mdJSON.o: server/mdJSON.cpp include/mdJSON.hpp
build/mdJSON.o: server/mdJSON.cpp include/mdJSON.hpp include/RegistryXOTE.h
$(CC) $(CFLAGS) server/mdJSON.cpp -c -o build/mdJSON.o $(SINCL) $(ARTKINCL)
build/mdAusReg.o: server/mdAusReg.cpp include/*.h
build/mdAusReg.o: server/mdAusReg.cpp include/ausRegTK.h
$(CC) $(CFLAGS) server/mdAusReg.cpp -c -o build/mdAusReg.o $(SINCL) $(ARTKINCL) $(ARTKLIB) -l libACTK1_0.so
build/ausreg-md: $(MDOBJS)

View File

@ -8,13 +8,29 @@
#ifndef REGISTRYOTE_H_
#define REGISTRYOTB_H_
typedef void (*caseBody)(void);
typedef struct {
const char *caseName;
caseBody fBody;
const Json::Value *parms;
} testCase;
typedef std::map<int,testCase> testCases;
typedef std::map<string,caseBody> testFuncs;
namespace AC_OTE {
static TestEnvironment props;
static int nCases;
testCases theseCases;
testFuncs theseFuncs;
static std::string TEST_SE =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd\"><hello/></epp>";
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
auto_ptr<Session> sess(SessionFactory::newInstance(&props));
@ -103,7 +119,6 @@ namespace AC_OTE {
theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str());
}
}
void create() {
@ -217,7 +232,6 @@ namespace AC_OTE {
theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str());
}
}
void transfer(bool &transferGainer) {
@ -244,25 +258,52 @@ namespace AC_OTE {
} // transfer
int setFuncs() {
theseFuncs["case00"] = createContact;
theseFuncs["case01"] = check;
theseFuncs["case02"] = checkClaims;
theseFuncs["case03"] = create;
theseFuncs["case05"] = createClaimOverride;
}
} // AC_OTE
using namespace AC_OTE;
bool walkDontRun() {
}
bool walkAndRun() {
}
bool ausRegEPPTK::registryXOTE()
{
bool debug=true; int i=0;
if (!acTkInitialised) {
scenario(thisConfig->tkScenario,thisConfig->cfg_path);
acTkInitialised = true;
}
const Json::Value suite = root["testSuite00"];
if (!suite) {
theseLogs->logN(0,"'testSuite00' suite root not found, need it.");
return true;
}
for ( i = 0; i < suite.size(); ++i ) { const char *thisItem = suite[i].asString().c_str();
if (debug)
theseLogs->logN(1,"item %.",thisItem);
if (strncmp(thisItem,"case",4)) continue;
if (strlen(thisItem) != 6) continue;
if (debug)
theseLogs->logN(1,"case %.",thisItem);
if (!theseFuncs[thisItem]) {
theseLogs->logN(0,"No logic to bind to '%s', need it.");
return false;
}
theseCases[AC_OTE::nCases].parms = &suite[i];
theseCases[AC_OTE::nCases].fBody = theseFuncs[thisItem];
theseCases[AC_OTE::nCases++].caseName = thisItem;
}
while(!done) {
try {
@ -279,10 +320,13 @@ bool ausRegEPPTK::registryXOTE()
sess->writeXML(TEST_SE);
sess->read();
// Walk the JSON tree from "testSuite00" and do any setup of
// recognized variables, announce the test case.
for (i=0;i<theseCases.size();i++) {
// No problem so far so do again this time to execute
theseLogs->logN(2,"%d (%s) Begin ",i,theseCases[i].caseName );
theseCases[i].fBody();
theseLogs->logN(2,"%d (%s) End ",i,theseCases[i].caseName );
}
theseLogs->logN(0,"End OTE Session.");
theseLogs->logN(0,"Restart with toolkit scenario >= 5 for production ops.");