proxygen
TestClientPipelineFactory Class Reference
Inheritance diagram for TestClientPipelineFactory:
wangle::PipelineFactory< BytesPipeline > wangle::PipelineFactory< DefaultPipeline >

Public Member Functions

DefaultPipeline::Ptr newPipeline (std::shared_ptr< AsyncTransportWrapper > socket) override
 
BytesPipeline::Ptr newPipeline (std::shared_ptr< AsyncTransportWrapper > sock) override
 
- Public Member Functions inherited from wangle::PipelineFactory< BytesPipeline >
virtual BytesPipeline::Ptr newPipeline (std::shared_ptr< folly::AsyncUDPSocket >, const folly::SocketAddress &)
 
virtual ~PipelineFactory ()=default
 
- Public Member Functions inherited from wangle::PipelineFactory< DefaultPipeline >
virtual DefaultPipeline::Ptr newPipeline (std::shared_ptr< folly::AsyncUDPSocket >, const folly::SocketAddress &)
 
virtual ~PipelineFactory ()=default
 

Detailed Description

Definition at line 25 of file AcceptRoutingHandlerTest.cpp.

Member Function Documentation

DefaultPipeline::Ptr TestClientPipelineFactory::newPipeline ( std::shared_ptr< AsyncTransportWrapper socket)
inlineoverridevirtual

Implements wangle::PipelineFactory< DefaultPipeline >.

Definition at line 27 of file AcceptRoutingHandlerTest.cpp.

References EXPECT_TRUE.

28  {
29  // Socket should be connected already
30  EXPECT_TRUE(socket->good());
31 
32  auto pipeline = DefaultPipeline::create();
33  pipeline->addBack(wangle::AsyncSocketHandler(socket));
34  pipeline->finalize();
35  return pipeline;
36  }
NetworkSocket socket(int af, int type, int protocol)
Definition: NetOps.cpp:412
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
BytesPipeline::Ptr TestClientPipelineFactory::newPipeline ( std::shared_ptr< AsyncTransportWrapper sock)
inlineoverridevirtual

Implements wangle::PipelineFactory< DefaultPipeline >.

Definition at line 37 of file BootstrapTest.cpp.

References wangle::Pipeline< R, W >::create(), EXPECT_TRUE, folly::EventBaseManager::get(), folly::EventBaseManager::getEventBase(), and folly::TimeoutManager::tryRunAfterDelay().

38  {
39  // Socket should be connected already
40  EXPECT_TRUE(sock->good());
41 
42  // Check after a small delay that socket is readable
43  EventBaseManager::get()->getEventBase()->tryRunAfterDelay([sock](){
44  EXPECT_TRUE(sock->readable());
45  }, 100);
46 
47  auto pipeline = BytesPipeline::create();
48  pipeline->addBack(new BytesToBytesHandler());
49  pipeline->finalize();
50  return pipeline;
51  }
HandlerAdapter< folly::IOBufQueue &, std::unique_ptr< folly::IOBuf > > BytesToBytesHandler
Definition: Handler.h:173
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
static Ptr create()
Definition: Pipeline.h:174
PUSHMI_INLINE_VAR constexpr detail::get_fn< T > get
Definition: submit.h:391

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