1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#ifndef TEST_CONNECTION_H
#define TEST_CONNECTION_H
#include <sigc++/object.h>
#include <Atlas/Objects/Operation/Info.h>
class StubServer;
#include <Eris/Connection.h>
class TestConnection :
public SigC::Object
{
/*
ERIS_TEST_SUITE(TestConnection);
ERIS_TEST(testConnect);
CPPUNIT_TEST(testReconnect);
CPPUNIT_TEST(testTimeout);
CPPUNIT_TEST(testDisconnect);
CPPUNIT_TEST(testDispatch);
CPPUNIT_TEST(testSend);
CPPUNIT_TEST_SUITE_END();
*/
public:
TestConnection();
void testConnect();
void testReconnect();
void testTimeout();
void testDisconnect();
void testComplexDisconnect();
// Atlas transmission tests
void testDispatch();
void testSend();
void setUp();
void tearDown();
protected:
StubServer* m_server;
Eris::Connection* m_con;
void waitFor(int timeoutSeconds, bool &watch1, bool &watch2);
// callback traps
void onConnect();
void onFailure(const std::string &msg);
void onTimeout(Eris::BaseConnection::Status);
bool onDisconnecting();
bool onDisconnecting_delay();
void onDisconnect();
void onAnyDispatch(const Atlas::Objects::Operation::Info&);
bool m_gotFailure,
m_gotConnect,
m_gotTimeout,
m_gotDisconnecting,
m_gotDisconnect,
m_gotArbitraryDispatch;
};
#endif
|