|
KiCad PCB EDA Suite
|
In-process HTTP library server used by QA tests. More...
#include <http_lib_fake_server.h>
Classes | |
| struct | RESPONSE |
Public Member Functions | |
| void | SetResponse (const std::string &aUrl, RESPONSE aResponse) |
| Replace the response served for an exact URL. | |
| int | RequestCount (const std::string &aUrl) const |
Number of times aUrl has been requested. | |
| HTTP_LIB_CONNECTION::RETRIEVER | MakeRetriever () |
| void | InstallStandardLibrary (const std::string &aRootUrl) |
Private Attributes | |
| std::mutex | m_mutex |
| std::map< std::string, RESPONSE > | m_responses |
| std::vector< std::string > | m_requests |
In-process HTTP library server used by QA tests.
A server instance must outlive every HTTP_LIB_CONNECTION built from its MakeRetriever()
Definition at line 34 of file http_lib_fake_server.h.
| void HTTP_LIB_FAKE_SERVER::InstallStandardLibrary | ( | const std::string & | aRootUrl | ) |
Definition at line 62 of file http_lib_fake_server.cpp.
References SetResponse().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and connectToStandardLibrary().
| HTTP_LIB_CONNECTION::RETRIEVER HTTP_LIB_FAKE_SERVER::MakeRetriever | ( | ) |
Definition at line 39 of file http_lib_fake_server.cpp.
References m_mutex, m_requests, and m_responses.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and connectToStandardLibrary().
| int HTTP_LIB_FAKE_SERVER::RequestCount | ( | const std::string & | aUrl | ) | const |
Number of times aUrl has been requested.
Definition at line 32 of file http_lib_fake_server.cpp.
References m_mutex, and m_requests.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| void HTTP_LIB_FAKE_SERVER::SetResponse | ( | const std::string & | aUrl, |
| RESPONSE | aResponse ) |
Replace the response served for an exact URL.
Definition at line 25 of file http_lib_fake_server.cpp.
References m_mutex, and m_responses.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and InstallStandardLibrary().
|
mutableprivate |
Definition at line 54 of file http_lib_fake_server.h.
Referenced by MakeRetriever(), RequestCount(), and SetResponse().
|
private |
Definition at line 56 of file http_lib_fake_server.h.
Referenced by MakeRetriever(), and RequestCount().
|
private |
Definition at line 55 of file http_lib_fake_server.h.
Referenced by MakeRetriever(), and SetResponse().