proxygen
BroadcastPoolTest Class Reference
Inheritance diagram for BroadcastPoolTest:
testing::Test

Classes

class  ServerPipelineFactory
 

Public Member Functions

void SetUp () override
 
void TearDown () override
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 

Protected Member Functions

void startServer ()
 
void stopServer ()
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
 Test ()
 
 Test ()
 

Protected Attributes

std::unique_ptr< BroadcastPool< int, std::string > > pool
 
std::shared_ptr< StrictMock< MockServerPool > > serverPool
 
std::shared_ptr< StrictMock< MockBroadcastPipelineFactory > > pipelineFactory
 
NiceMock< MockSubscriber< int, std::string > > subscriber
 
std::unique_ptr< ServerBootstrap< DefaultPipeline > > server
 
std::shared_ptr< SocketAddressaddr
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 26 of file BroadcastPoolTest.cpp.

Member Function Documentation

void BroadcastPoolTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 28 of file BroadcastPoolTest.cpp.

References addr.

28  {
29  addr = std::make_shared<SocketAddress>();
30  serverPool = std::make_shared<StrictMock<MockServerPool>>(addr);
31 
33  std::make_shared<StrictMock<MockBroadcastPipelineFactory>>();
34 
35  pool = std::make_unique<BroadcastPool<int, std::string>>(
36  serverPool,
38  std::make_shared<ClientBootstrapFactory>());
39 
40  startServer();
41  }
std::unique_ptr< BroadcastPool< int, std::string > > pool
std::shared_ptr< StrictMock< MockServerPool > > serverPool
std::shared_ptr< SocketAddress > addr
std::shared_ptr< StrictMock< MockBroadcastPipelineFactory > > pipelineFactory
void BroadcastPoolTest::startServer ( )
inlineprotected

Definition at line 67 of file BroadcastPoolTest.cpp.

References addr.

67  {
68  server = std::make_unique<ServerBootstrap<DefaultPipeline>>();
69  server->childPipeline(std::make_shared<ServerPipelineFactory>());
70  server->bind(0);
71  server->getSockets()[0]->getAddress(addr.get());
72  }
std::shared_ptr< SocketAddress > addr
std::unique_ptr< ServerBootstrap< DefaultPipeline > > server
void BroadcastPoolTest::stopServer ( )
inlineprotected

Definition at line 74 of file BroadcastPoolTest.cpp.

74  {
75  server.reset();
76  }
std::unique_ptr< ServerBootstrap< DefaultPipeline > > server
void BroadcastPoolTest::TearDown ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 43 of file BroadcastPoolTest.cpp.

References addr.

43  {
44  Mock::VerifyAndClear(serverPool.get());
45  Mock::VerifyAndClear(pipelineFactory.get());
46 
47  serverPool.reset();
48  addr.reset();
49  pipelineFactory.reset();
50  pool.reset();
51 
52  stopServer();
53  }
std::unique_ptr< BroadcastPool< int, std::string > > pool
std::shared_ptr< StrictMock< MockServerPool > > serverPool
std::shared_ptr< SocketAddress > addr
std::shared_ptr< StrictMock< MockBroadcastPipelineFactory > > pipelineFactory

Member Data Documentation

std::shared_ptr<SocketAddress> BroadcastPoolTest::addr
protected

Definition at line 83 of file BroadcastPoolTest.cpp.

std::shared_ptr<StrictMock<MockBroadcastPipelineFactory> > BroadcastPoolTest::pipelineFactory
protected

Definition at line 80 of file BroadcastPoolTest.cpp.

std::unique_ptr<BroadcastPool<int, std::string> > BroadcastPoolTest::pool
protected

Definition at line 78 of file BroadcastPoolTest.cpp.

std::unique_ptr<ServerBootstrap<DefaultPipeline> > BroadcastPoolTest::server
protected

Definition at line 82 of file BroadcastPoolTest.cpp.

std::shared_ptr<StrictMock<MockServerPool> > BroadcastPoolTest::serverPool
protected

Definition at line 79 of file BroadcastPoolTest.cpp.

NiceMock<MockSubscriber<int, std::string> > BroadcastPoolTest::subscriber
protected

Definition at line 81 of file BroadcastPoolTest.cpp.


The documentation for this class was generated from the following file: