MCPcopy Create free account
hub / github.com/apache/brpc / HttpTest

Method HttpTest

test/brpc_http_rpc_protocol_unittest.cpp:128–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126class HttpTest : public ::testing::Test{
127protected:
128 HttpTest() {
129 EXPECT_EQ(0, _server.AddBuiltinServices());
130 EXPECT_EQ(0, _server.AddService(
131 &_svc, brpc::SERVER_DOESNT_OWN_SERVICE));
132 // Hack: Regard `_server' as running
133 _server._status = brpc::Server::RUNNING;
134 _server._options.auth = &_auth;
135 if (!_server._options.rpc_pb_message_factory) {
136 _server._options.rpc_pb_message_factory = new brpc::DefaultRpcPBMessageFactory();
137 }
138
139 EXPECT_EQ(0, pipe(_pipe_fds));
140
141 brpc::SocketId id;
142 brpc::SocketOptions options;
143 options.fd = _pipe_fds[1];
144 EXPECT_EQ(0, brpc::Socket::Create(options, &id));
145 EXPECT_EQ(0, brpc::Socket::Address(id, &_socket));
146
147 brpc::SocketOptions h2_client_options;
148 h2_client_options.user = brpc::get_client_side_messenger();
149 h2_client_options.fd = _pipe_fds[1];
150 EXPECT_EQ(0, brpc::Socket::Create(h2_client_options, &id));
151 EXPECT_EQ(0, brpc::Socket::Address(id, &_h2_client_sock));
152 };
153
154 virtual ~HttpTest() {};
155 virtual void SetUp() {};

Callers

nothing calls this directly

Calls 2

AddBuiltinServicesMethod · 0.80
AddServiceMethod · 0.80

Tested by

no test coverage detected