Skip to content

Commit 3eb2d09

Browse files
committed
change back to use custom Empty, BoolValue.
1 parent 5f94457 commit 3eb2d09

File tree

4 files changed

+52
-13
lines changed

4 files changed

+52
-13
lines changed

BUILD.bazel

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ proto_library(
2424
proto_library(
2525
name = "messages_proto",
2626
srcs = ["grpc/testing/messages.proto"],
27-
deps = ["@com_google_protobuf//:wrappers_proto"],
2827
)
2928

3029
proto_library(
@@ -117,11 +116,16 @@ proto_library(
117116
srcs = ["grpc/testing/test.proto"],
118117
visibility = ["//visibility:public"],
119118
deps = [
119+
":empty_proto",
120120
":messages_proto",
121-
"@com_google_protobuf//:empty_proto",
122121
],
123122
)
124123

124+
proto_library(
125+
name = "empty_proto",
126+
srcs = ["grpc/testing/empty.proto"],
127+
)
128+
125129
# Deprecated: do not use
126130
proto_library(
127131
name = "reflection_proto_deprecated",

grpc/testing/empty.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2015 The 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+
syntax = "proto2";
15+
16+
package grpc.testing;
17+
18+
option java_package = "io.grpc.testing.integration";
19+
option java_outer_classname = "EmptyProtos";
20+
21+
// An empty message that you can re-use to avoid defining duplicated empty
22+
// messages in your project. A typical example is to use it as argument or the
23+
// return value of a service API. For instance:
24+
//
25+
// service Foo {
26+
// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
27+
// };
28+
//
29+
message Empty {}

grpc/testing/messages.proto

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ package grpc.testing;
2121

2222
option java_package = "io.grpc.testing.integration";
2323

24-
import "google/protobuf/wrappers.proto";
24+
// TODO(dgq): Go back to using well-known types once
25+
// https://github.com/grpc/grpc/issues/6980 has been fixed.
26+
// import "google/protobuf/wrappers.proto";
27+
message BoolValue {
28+
// The bool value.
29+
bool value = 1;
30+
}
2531

2632
// The type of payload that should be returned.
2733
enum PayloadType {
@@ -72,13 +78,13 @@ message SimpleRequest {
7278
// "nullable" in order to interoperate seamlessly with clients not able to
7379
// implement the full compression tests by introspecting the call to verify
7480
// the response's compression status.
75-
google.protobuf.BoolValue response_compressed = 6;
81+
BoolValue response_compressed = 6;
7682

7783
// Whether server should return a given status
7884
EchoStatus response_status = 7;
7985

8086
// Whether the server should expect this request to be compressed.
81-
google.protobuf.BoolValue expect_compressed = 8;
87+
BoolValue expect_compressed = 8;
8288
}
8389

8490
// Unary response, as configured by the request.
@@ -105,7 +111,7 @@ message StreamingInputCallRequest {
105111
// is "nullable" in order to interoperate seamlessly with servers not able to
106112
// implement the full compression tests by introspecting the call to verify
107113
// the request's compression status.
108-
google.protobuf.BoolValue expect_compressed = 2;
114+
BoolValue expect_compressed = 2;
109115

110116
// Not expecting any payload from the response.
111117
}
@@ -129,7 +135,7 @@ message ResponseParameters {
129135
// "nullable" in order to interoperate seamlessly with clients not able to
130136
// implement the full compression tests by introspecting the call to verify
131137
// the response's compression status.
132-
google.protobuf.BoolValue compressed = 3;
138+
BoolValue compressed = 3;
133139
}
134140

135141
// Server-streaming request.

grpc/testing/test.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// of unary/streaming requests/responses.
1616
syntax = "proto3";
1717

18-
import "google/protobuf/empty.proto";
18+
import "grpc/testing/empty.proto";
1919
import "grpc/testing/messages.proto";
2020

2121
package grpc.testing;
@@ -26,7 +26,7 @@ option java_package = "io.grpc.testing.integration";
2626
// performance with various types of payload.
2727
service TestService {
2828
// One empty request followed by one empty response.
29-
rpc EmptyCall(google.protobuf.Empty) returns (google.protobuf.Empty);
29+
rpc EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty);
3030

3131
// One request followed by one response.
3232
rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
@@ -61,21 +61,21 @@ service TestService {
6161

6262
// The test server will not implement this method. It will be used
6363
// to test the behavior when clients call unimplemented methods.
64-
rpc UnimplementedCall(google.protobuf.Empty) returns (google.protobuf.Empty);
64+
rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);
6565
}
6666

6767
// A simple service NOT implemented at servers so clients can test for
6868
// that case.
6969
service UnimplementedService {
7070
// A call that no server should implement
71-
rpc UnimplementedCall(google.protobuf.Empty) returns (google.protobuf.Empty);
71+
rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);
7272
}
7373

7474
// A service used to control reconnect server.
7575
service ReconnectService {
7676
// Starts ReconnectService
77-
rpc Start(google.protobuf.Empty) returns (google.protobuf.Empty);
77+
rpc Start(grpc.testing.Empty) returns (grpc.testing.Empty);
7878

7979
// Stops ReconnectService
80-
rpc Stop(google.protobuf.Empty) returns (grpc.testing.ReconnectInfo);
80+
rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo);
8181
}

0 commit comments

Comments
 (0)