diff --git a/AusRegCliever/Makefile b/AusRegCliever/Makefile index f2d3b98..245a537 100644 --- a/AusRegCliever/Makefile +++ b/AusRegCliever/Makefile @@ -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) diff --git a/AusRegCliever/include/RegistryXOTE.h b/AusRegCliever/include/RegistryXOTE.h index f96aef5..8bc7574 100644 --- a/AusRegCliever/include/RegistryXOTE.h +++ b/AusRegCliever/include/RegistryXOTE.h @@ -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 testCases; + typedef std::map testFuncs; + namespace AC_OTE { static TestEnvironment props; + static int nCases; + + testCases theseCases; + testFuncs theseFuncs; static std::string TEST_SE = ""; + auto_ptr manager(SessionManagerFactory::newInstance(&props)); auto_ptr 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;ilogN(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.");