|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN |
|
|
|
|
|
#include <string> |
|
|
|
|
|
using namespace std; |
|
|
|
|
|
#include "xmlrpc-c/girerr.hpp" |
|
|
using girerr::error; |
|
|
using girerr::throwf; |
|
|
#include "xmlrpc-c/base.hpp" |
|
|
#include "xmlrpc-c/AbyssServer.hpp" |
|
|
#include "xmlrpc-c/AbyssEnvironment.hpp" |
|
|
#include "xmlrpc-c/AbyssChanSwitch.hpp" |
|
|
#ifdef _WIN32 |
|
|
#include "xmlrpc-c/AbyssChanSwitchWin.hpp" |
|
|
#else |
|
|
#include "xmlrpc-c/AbyssChanSwitchUnix.hpp" |
|
|
#endif |
|
|
|
|
|
using namespace xmlrpc_c; |
|
|
|
|
|
#include "tools.hpp" |
|
|
#include "abyss.hpp" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const AbyssEnvironment global; |
|
|
|
|
|
namespace { |
|
|
|
|
|
|
|
|
|
|
|
class addHandlerTestSuite : public testSuite { |
|
|
|
|
|
public: |
|
|
virtual string suiteName() { |
|
|
return "addHandlerTestSuite"; |
|
|
} |
|
|
virtual void runtests(unsigned int const) { |
|
|
|
|
|
class AbyssReqHandler_Test : public AbyssServer::ReqHandler { |
|
|
public: |
|
|
AbyssReqHandler_Test() {} |
|
|
|
|
|
void |
|
|
handleRequest(AbyssServer::Session * const , |
|
|
bool * const ) {} |
|
|
}; |
|
|
|
|
|
#ifdef _WIN32 |
|
|
AbyssChanSwitchWin chanSwitch(8080); |
|
|
#else |
|
|
AbyssChanSwitchUnix chanSwitch(8080); |
|
|
#endif |
|
|
|
|
|
AbyssServer abyssServer(&chanSwitch); |
|
|
|
|
|
AbyssReqHandler_Test abyssReqHandler; |
|
|
|
|
|
abyssServer.addRequestHandler(&abyssReqHandler); |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class createTestSuite : public testSuite { |
|
|
|
|
|
public: |
|
|
virtual string suiteName() { |
|
|
return "createTestSuite"; |
|
|
} |
|
|
virtual void runtests(unsigned int const) { |
|
|
#ifdef _WIN32 |
|
|
AbyssChanSwitchWin chanSwitch(8080); |
|
|
#else |
|
|
AbyssChanSwitchUnix chanSwitch(8080); |
|
|
#endif |
|
|
AbyssServer abyssServer(&chanSwitch); |
|
|
|
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string |
|
|
abyssTestSuite::suiteName() { |
|
|
return "abyssTestSuite"; |
|
|
} |
|
|
|
|
|
|
|
|
void |
|
|
abyssTestSuite::runtests(unsigned int const indentation) { |
|
|
|
|
|
createTestSuite().run(indentation+1); |
|
|
|
|
|
addHandlerTestSuite().run(indentation+1); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|