Introduced InteropContextInspector to be able to peek into server contexts during interop testing.

pull/2533/head
David Garcia Quintas 10 years ago
parent 20a3538ddc
commit 3922005878
  1. 5
      include/grpc++/server_context.h
  2. 4
      test/cpp/interop/server_helper.cc
  3. 11
      test/cpp/interop/server_helper.h

@ -75,6 +75,10 @@ class CallOpBuffer;
class CompletionQueue;
class Server;
namespace testing {
class InteropContextInspector;
} // namespace testing
// Interface of server side rpc context.
class ServerContext {
public:
@ -109,6 +113,7 @@ class ServerContext {
void set_compression_algorithm(grpc_compression_algorithm algorithm);
private:
friend class ::grpc::testing::InteropContextInspector;
friend class ::grpc::Server;
template <class W, class R>
friend class ::grpc::ServerAsyncReader;

@ -58,5 +58,9 @@ std::shared_ptr<ServerCredentials> CreateInteropServerCredentials() {
}
}
InteropContextInspector::InteropContextInspector(
const ::grpc::ServerContext& context)
: context_(context) {}
} // namespace testing
} // namespace grpc

@ -36,6 +36,7 @@
#include <memory>
#include <grpc++/server_context.h>
#include <grpc++/server_credentials.h>
namespace grpc {
@ -43,6 +44,16 @@ namespace testing {
std::shared_ptr<ServerCredentials> CreateInteropServerCredentials();
class InteropContextInspector {
public:
InteropContextInspector (const ::grpc::ServerContext& context);
// Inspector methods, able to peek inside ServerContext go here.
private:
const ::grpc::ServerContext& context_;
};
} // namespace testing
} // namespace grpc

Loading…
Cancel
Save