1 /* 2 * 3 * Copyright 2015-2016 gRPC authors. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 #ifndef GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H 20 #define GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H 21 22 #include <memory> 23 24 #include <grpcpp/channel.h> 25 #include <grpcpp/impl/codegen/client_interceptor.h> 26 #include <grpcpp/security/credentials.h> 27 #include <grpcpp/support/channel_arguments.h> 28 29 namespace grpc { 30 class Channel; 31 32 namespace testing { 33 34 typedef enum { INSECURE = 0, TLS, ALTS } transport_security; 35 36 } // namespace testing 37 38 std::shared_ptr<Channel> CreateTestChannel( 39 const std::string& server, testing::transport_security security_type); 40 41 std::shared_ptr<Channel> CreateTestChannel( 42 const std::string& server, const std::string& override_hostname, 43 testing::transport_security security_type, bool use_prod_roots); 44 45 std::shared_ptr<Channel> CreateTestChannel( 46 const std::string& server, const std::string& override_hostname, 47 testing::transport_security security_type, bool use_prod_roots, 48 const std::shared_ptr<CallCredentials>& creds); 49 50 std::shared_ptr<Channel> CreateTestChannel( 51 const std::string& server, const std::string& override_hostname, 52 testing::transport_security security_type, bool use_prod_roots, 53 const std::shared_ptr<CallCredentials>& creds, 54 const ChannelArguments& args); 55 56 std::shared_ptr<Channel> CreateTestChannel( 57 const std::string& server, const std::string& cred_type, 58 const std::string& override_hostname, bool use_prod_roots, 59 const std::shared_ptr<CallCredentials>& creds, 60 const ChannelArguments& args); 61 62 std::shared_ptr<Channel> CreateTestChannel( 63 const std::string& server, const std::string& credential_type, 64 const std::shared_ptr<CallCredentials>& creds); 65 66 std::shared_ptr<Channel> CreateTestChannel( 67 const std::string& server, const std::string& override_hostname, 68 testing::transport_security security_type, bool use_prod_roots, 69 const std::shared_ptr<CallCredentials>& creds, 70 std::vector< 71 std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> 72 interceptor_creators); 73 74 std::shared_ptr<Channel> CreateTestChannel( 75 const std::string& server, const std::string& override_hostname, 76 testing::transport_security security_type, bool use_prod_roots, 77 const std::shared_ptr<CallCredentials>& creds, const ChannelArguments& args, 78 std::vector< 79 std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> 80 interceptor_creators); 81 82 std::shared_ptr<Channel> CreateTestChannel( 83 const std::string& server, const std::string& cred_type, 84 const std::string& override_hostname, bool use_prod_roots, 85 const std::shared_ptr<CallCredentials>& creds, const ChannelArguments& args, 86 std::vector< 87 std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> 88 interceptor_creators); 89 90 std::shared_ptr<Channel> CreateTestChannel( 91 const std::string& server, const std::string& credential_type, 92 const std::shared_ptr<CallCredentials>& creds, 93 std::vector< 94 std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> 95 interceptor_creators); 96 97 } // namespace grpc 98 99 #endif // GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H 100