proxygen
HTTP2UpstreamSessionWithVirtualNodesTest Class Reference
Inheritance diagram for HTTP2UpstreamSessionWithVirtualNodesTest:
HTTPUpstreamTest< MockHTTPCodecPair > testing::Test HTTP2UpstreamSessionWithPriorityTree

Public Member Functions

void SetUp () override
 
void commonSetUp (unique_ptr< HTTPCodec > codec)
 
void TearDown () override
 
- Public Member Functions inherited from HTTPUpstreamTest< MockHTTPCodecPair >
 HTTPUpstreamTest (std::vector< int64_t > flowControl={-1,-1,-1})
 
void resumeWrites ()
 
virtual void onWriteChain (folly::AsyncTransportWrapper::WriteCallback *callback, std::shared_ptr< IOBuf > iob, WriteFlags)
 
void handleWrite (folly::AsyncTransportWrapper::WriteCallback *callback)
 
void SetUp () override
 
void commonSetUp (unique_ptr< HTTPCodec > codec)
 
unique_ptr< typename MockHTTPCodecPair::CodecmakeServerCodec ()
 
void enableExHeader (typename MockHTTPCodecPair::Codec *serverCodec)
 
void parseOutput (HTTPCodec &serverCodec)
 
void readAndLoop (const std::string &input)
 
void readAndLoop (IOBuf *buf)
 
void readAndLoop (const uint8_t *input, size_t length)
 
void testBasicRequest ()
 
void testBasicRequestHttp10 (bool keepalive)
 
void onCreate (const HTTPSessionBase &) override
 
void onDestroy (const HTTPSessionBase &) override
 
void onSettingsOutgoingStreamsFull (const HTTPSessionBase &) override
 
void onSettingsOutgoingStreamsNotFull (const HTTPSessionBase &) override
 
void TearDown () override
 
std::unique_ptr< StrictMock< MockHTTPHandler > > openTransaction (bool expectStartPaused=false)
 
std::unique_ptr< NiceMock< MockHTTPHandler > > openNiceTransaction (bool expectStartPaused=false)
 
void testSimpleUpgrade (const std::string &upgradeReqHeader, const std::string &upgradeRespHeader, CodecProtocol respCodecVersion)
 
MockByteEventTrackersetMockByteEventTracker ()
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 

Protected Attributes

MockHTTPCodeccodecPtr_ {nullptr}
 
HTTPCodec::CallbackcodecCb_ {nullptr}
 
uint32_t nextOutgoingTxn_ {1}
 
std::vector< HTTPCodec::StreamIDdependencies
 
uint8_t level_ {3}
 
std::shared_ptr< TestPriorityMapBuilderbuilder_
 
- Protected Attributes inherited from HTTPUpstreamTest< MockHTTPCodecPair >
bool sessionCreated_
 
bool sessionDestroyed_
 
bool transactionsFull_
 
bool transportGood_
 
EventBase eventBase_
 
EventBaseeventBasePtr_
 
MockAsyncTransporttransport_
 
folly::AsyncTransportWrapper::ReadCallbackreadCallback_
 
folly::AsyncTransport::ReplaySafetyCallbackreplaySafetyCallback_
 
folly::HHWheelTimer::UniquePtr transactionTimeouts_
 
std::vector< int64_tflowControl_
 
wangle::TransportInfo mockTransportInfo_
 
SocketAddress localAddr_
 
SocketAddress peerAddr_
 
HTTPUpstreamSessionhttpSession_
 
IOBufQueue writes_
 
std::vector< folly::AsyncTransportWrapper::WriteCallback * > cbs_
 
bool failWrites_
 
bool pauseWrites_
 
bool writeInLoop_
 

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)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
 Test ()
 
 Test ()
 

Detailed Description

Definition at line 861 of file HTTPUpstreamSessionTest.cpp.

Member Function Documentation

void HTTP2UpstreamSessionWithVirtualNodesTest::commonSetUp ( unique_ptr< HTTPCodec codec)
inline

Definition at line 884 of file HTTPUpstreamSessionTest.cpp.

References testing::_, ASSERT_EQ, testing::Assign(), EXPECT_CALL, folly::getEventBase(), testing::Invoke(), folly::gen::move, testing::Return(), and transport_.

884  {
885  HTTPSession::setDefaultReadBufferLimit(65536);
886  HTTPSession::setDefaultWriteBufferLimit(65536);
887  EXPECT_CALL(*transport_, writeChain(_, _, _))
888  .WillRepeatedly(Invoke(
889  this,
891  EXPECT_CALL(*transport_, setReadCB(_))
892  .WillRepeatedly(SaveArg<0>(&readCallback_));
893  EXPECT_CALL(*transport_, getReadCB())
894  .WillRepeatedly(Return(readCallback_));
896  .WillRepeatedly(Return(&eventBase_));
897  EXPECT_CALL(*transport_, good())
898  .WillRepeatedly(ReturnPointee(&transportGood_));
899  EXPECT_CALL(*transport_, closeNow())
900  .WillRepeatedly(Assign(&transportGood_, false));
903  transactionTimeouts_.get(),
904  std::move(transportPtr),
906  std::move(codec),
908  this,
909  level_,
910  builder_);
911  eventBase_.loop();
912  ASSERT_EQ(this->sessionDestroyed_, false);
913  }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
folly::AsyncTransportWrapper::ReadCallback * readCallback_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
EventBase * getEventBase()
std::unique_ptr< AsyncTransportWrapper, Destructor > UniquePtr
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
std::shared_ptr< TestPriorityMapBuilder > builder_
PolymorphicAction< internal::AssignAction< T1, T2 > > Assign(T1 *ptr, T2 val)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
folly::HHWheelTimer::UniquePtr transactionTimeouts_
internal::ReturnAction< R > Return(R value)
void HTTP2UpstreamSessionWithVirtualNodesTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 864 of file HTTPUpstreamSessionTest.cpp.

References testing::_, codec, EXPECT_CALL, testing::Invoke(), folly::gen::move, and testing::Return().

864  {
865  auto codec = std::make_unique<NiceMock<MockHTTPCodec>>();
866  codecPtr_ = codec.get();
867  EXPECT_CALL(*codec, supportsParallelRequests())
868  .WillRepeatedly(Return(true));
869  EXPECT_CALL(*codec, getTransportDirection())
870  .WillRepeatedly(Return(TransportDirection::UPSTREAM));
871  EXPECT_CALL(*codec, getProtocol())
872  .WillRepeatedly(Return(CodecProtocol::HTTP_2));
873  EXPECT_CALL(*codec, setCallback(_))
874  .WillRepeatedly(SaveArg<0>(&codecCb_));
875  EXPECT_CALL(*codec, createStream())
876  .WillRepeatedly(Invoke([&] {
877  auto ret = nextOutgoingTxn_;
878  nextOutgoingTxn_ += 2;
879  return ret;
880  }));
882  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
CodecFactory codec
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
void commonSetUp(unique_ptr< HTTPCodec > codec)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
internal::ReturnAction< R > Return(R value)
void HTTP2UpstreamSessionWithVirtualNodesTest::TearDown ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 915 of file HTTPUpstreamSessionTest.cpp.

References EXPECT_TRUE.

915  {
917  }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859

Member Data Documentation

std::shared_ptr<TestPriorityMapBuilder> HTTP2UpstreamSessionWithVirtualNodesTest::builder_
protected

Definition at line 925 of file HTTPUpstreamSessionTest.cpp.

HTTPCodec::Callback* HTTP2UpstreamSessionWithVirtualNodesTest::codecCb_ {nullptr}
protected

Definition at line 921 of file HTTPUpstreamSessionTest.cpp.

MockHTTPCodec* HTTP2UpstreamSessionWithVirtualNodesTest::codecPtr_ {nullptr}
protected

Definition at line 920 of file HTTPUpstreamSessionTest.cpp.

std::vector<HTTPCodec::StreamID> HTTP2UpstreamSessionWithVirtualNodesTest::dependencies
protected

Definition at line 923 of file HTTPUpstreamSessionTest.cpp.

uint8_t HTTP2UpstreamSessionWithVirtualNodesTest::level_ {3}
protected

Definition at line 924 of file HTTPUpstreamSessionTest.cpp.

uint32_t HTTP2UpstreamSessionWithVirtualNodesTest::nextOutgoingTxn_ {1}
protected

Definition at line 922 of file HTTPUpstreamSessionTest.cpp.


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