Imported Upstream version 1.41.0
[platform/upstream/grpc.git] / test / core / transport / binder / end2end / echo_service.h
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef TEST_CORE_TRANSPORT_BINDER_END2END_ECHO_SERVICE_H
16 #define TEST_CORE_TRANSPORT_BINDER_END2END_ECHO_SERVICE_H
17
18 #include "absl/strings/string_view.h"
19
20 #include "test/core/transport/binder/end2end/echo.grpc.pb.h"
21
22 namespace grpc_binder {
23 namespace end2end_testing {
24
25 // TODO(waynetu): Replace this with TestServiceImpl declared in
26 // test/cpp/end2end/test_service_impl.h
27 class EchoServer final : public EchoService::Service {
28  public:
29   static const absl::string_view kCancelledText;
30   static const absl::string_view kTimeoutText;
31
32   grpc::Status EchoUnaryCall(grpc::ServerContext* context,
33                              const EchoRequest* request,
34                              EchoResponse* response) override;
35
36   static const size_t kServerStreamingCounts;
37
38   grpc::Status EchoServerStreamingCall(
39       grpc::ServerContext* context, const EchoRequest* request,
40       grpc::ServerWriter<EchoResponse>* writer) override;
41   grpc::Status EchoClientStreamingCall(grpc::ServerContext* context,
42                                        grpc::ServerReader<EchoRequest>* reader,
43                                        EchoResponse* response) override;
44   grpc::Status EchoBiDirStreamingCall(
45       grpc::ServerContext* context,
46       grpc::ServerReaderWriter<EchoResponse, EchoRequest>* stream) override;
47 };
48
49 }  // namespace end2end_testing
50 }  // namespace grpc_binder
51
52 #endif  // TEST_CORE_TRANSPORT_BINDER_END2END_ECHO_SERVICE_H_