libtasks Documentation  1.6
test_http_sender.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 ADTECH GmbH
3  * Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING)
4  *
5  * Author: Andreas Pohl
6  */
7 
8 #include <cppunit/TestCase.h>
9 #include <cppunit/TestFixture.h>
10 #include <cppunit/extensions/HelperMacros.h>
11 
12 #include <tasks/dispatcher.h>
13 #include <tasks/net_io_task.h>
14 #include <tasks/net/http_sender.h>
15 
16 #include <mutex>
17 #include <condition_variable>
18 
20  public:
21  bool handle_response(std::shared_ptr<tasks::net::http_response> response);
22 };
23 
25  public:
26  bool handle_response(std::shared_ptr<tasks::net::http_response> response);
27 };
28 
30  public:
32  bool handle_event(tasks::worker*, int) { return false; }
33 };
34 
35 class test_http_sender : public CppUnit::TestFixture {
41 
42  public:
43  void setUp() {}
44  void tearDown() {}
45 
46  protected:
47  void requests();
48  void requests_keepalive();
49  void requests_close();
50 };
The net_io_task implements the base for socket based network tasks.
Definition: net_io_task.h:21
bool handle_event(tasks::worker *, int)
bool handle_response(std::shared_ptr< tasks::net::http_response > response)
The socket class.
Definition: socket.h:35
CPPUNIT_TEST_SUITE(test_http_sender)
net_io_task(int events)
Definition: net_io_task.h:23
test_http_close_handler(tasks::net::socket &socket)
bool handle_response(std::shared_ptr< tasks::net::http_response > response)
Definition: http_client.cpp:16
net::socket & socket()
Provide access to the underlying socket object.
Definition: net_io_task.h:35
CPPUNIT_TEST(requests)