/// This method is virtual so as it can be overridden when customized
/// connections are to be used, e.g. in case of unit testing.
///
- /// @param io_service IO service to be used by the connection.
- /// @param acceptor Pointer to the TCP acceptor object used to listen for
- /// new HTTP connections.
- /// @param tls_context TLS context.
- /// @param connection_pool Connection pool in which this connection is
- /// stored.
/// @param response_creator Pointer to the response creator object used to
/// create HTTP response from the HTTP request received.
/// @param acceptor_callback Callback invoked when new connection is accepted.
/// @param handshake_callback Callback invoked when TLS handshake is performed.
- /// @param request_timeout Configured timeout for a HTTP request.
- /// @param idle_timeout Timeout after which persistent HTTP connection is
- /// closed by the server.
///
/// @return Pointer to the created connection.
virtual HttpConnectionPtr createConnection(const HttpResponseCreatorPtr& response_creator,
TlsContextPtr client_context_;
};
+#ifndef DISABLE_SOME_TESTS
// Test that two consecutive requests can be sent over the same (persistent)
// connection.
TEST_F(HttpsClientTest, consecutiveRequests) {
-#ifndef DISABLE_SOME_TESTS
+
ASSERT_NO_FATAL_FAILURE(testConsecutiveRequests(HttpVersion(1, 1)));
-#endif
}
// Test that two consecutive requests can be sent over the same (persistent)
// connection.
TEST_F(HttpsClientTest, consecutiveRequestsMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
-#ifndef DISABLE_SOME_TESTS
+
ASSERT_NO_FATAL_FAILURE(testConsecutiveRequests(HttpVersion(1, 1)));
-#endif
}
+#endif
// Test that two consecutive requests can be sent over non-persistent connection.
// This is achieved by sending HTTP/1.0 requests, which are non-persistent by
testClientRequestLateStart(false);
}
+#ifndef DISABLE_SOME_TESTS
// This test verifies the behavior of the HTTP client when the premature
// timeout occurs and there are requests queued after the request which
// times out.
TEST_F(HttpsClientTest, clientRequestLateStartQueue) {
-#ifndef DISABLE_SOME_TESTS
+
testClientRequestLateStart(true);
-#endif
}
// This test verifies the behavior of the HTTP client when the premature
// times out.
TEST_F(HttpsClientTest, clientRequestLateStartQueueMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
-#ifndef DISABLE_SOME_TESTS
testClientRequestLateStart(true);
-#endif
}
+#endif
// Test that client times out when connection takes too long.
TEST_F(HttpsClientTest, clientConnectTimeout) {
ASSERT_NO_FATAL_FAILURE(testClientConnectTimeout());
}
+#ifndef DISABLE_SOME_TESTS
/// Tests that connect and close callbacks work correctly.
TEST_F(HttpsClientTest, connectCloseCallbacks) {
-#ifndef DISABLE_SOME_TESTS
ASSERT_NO_FATAL_FAILURE(testConnectCloseCallbacks(HttpVersion(1, 1)));
-#endif
}
/// Tests that connect and close callbacks work correctly.
TEST_F(HttpsClientTest, connectCloseCallbacksMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
-#ifndef DISABLE_SOME_TESTS
ASSERT_NO_FATAL_FAILURE(testConnectCloseCallbacks(HttpVersion(1, 1)));
-#endif
}
+#endif
/// Tests that HttpClient::closeIfOutOfBand works correctly.
TEST_F(HttpsClientTest, closeIfOutOfBand) {
/// This method is virtual so as it can be overridden when customized
/// connections are to be used, e.g. in case of unit testing.
///
- /// @param io_service IO service to be used by the connection.
- /// @param acceptor Pointer to the TCP acceptor object used to listen for
- /// new HTTP connections.
- /// @param tls_context TLS context.
- /// @param connection_pool Connection pool in which this connection is
- /// stored.
/// @param response_creator Pointer to the response creator object used to
/// create HTTP response from the HTTP request received.
/// @param acceptor_callback Callback invoked when new connection is accepted.
/// @param handshake_callback Callback invoked when TLS handshake is performed.
- /// @param request_timeout Configured timeout for a HTTP request.
- /// @param idle_timeout Timeout after which persistent HTTP connection is
- /// closed by the server.
///
/// @return Pointer to the created connection.
virtual HttpConnectionPtr createConnection(const HttpResponseCreatorPtr& response_creator,