mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2025-01-03 05:22:24 +08:00
Allow overriding DI injected variables in ClientServerTestRunner
Move OATPP_COMPONENT calls to constructor to allow supplying variables without using DI
This commit is contained in:
parent
1e5b0c4917
commit
d427e200e9
@ -51,10 +51,18 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::shared_ptr<oatpp::network::Server> m_server;
|
std::shared_ptr<oatpp::network::Server> m_server;
|
||||||
std::list<std::shared_ptr<ApiController>> m_controllers;
|
std::list<std::shared_ptr<ApiController>> m_controllers;
|
||||||
OATPP_COMPONENT(std::shared_ptr<HttpRouter>, m_router);
|
std::shared_ptr<HttpRouter> m_router;
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, m_connectionProvider);
|
std::shared_ptr<oatpp::network::ServerConnectionProvider> m_connectionProvider;
|
||||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, m_connectionHandler);
|
std::shared_ptr<oatpp::network::ConnectionHandler> m_connectionHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
ClientServerTestRunner(OATPP_COMPONENT(std::shared_ptr<HttpRouter>, router),
|
||||||
|
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, connectionProvider),
|
||||||
|
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, connectionHandler))
|
||||||
|
: m_router(router)
|
||||||
|
, m_connectionProvider(connectionProvider)
|
||||||
|
, m_connectionHandler(connectionHandler)
|
||||||
|
{}
|
||||||
|
|
||||||
std::shared_ptr<HttpRouter> getRouter() {
|
std::shared_ptr<HttpRouter> getRouter() {
|
||||||
return m_router;
|
return m_router;
|
||||||
|
Loading…
Reference in New Issue
Block a user