aboutsummaryrefslogtreecommitdiff
path: root/testing-proto
diff options
context:
space:
mode:
authorEric Gribkoff <ericgribkoff@google.com>2017-04-20 12:37:36 -0700
committerEric Gribkoff <ericgribkoff@google.com>2017-04-21 10:22:05 -0700
commitb6bf25256657ff6eb0834f0af012274acec8855a (patch)
treef6708e981426ee63d3ab36b046e0d4438461aa43 /testing-proto
parente36d229dc2be61537eda20e23438ddb0d2f7db6d (diff)
downloadgrpc-grpc-java-b6bf25256657ff6eb0834f0af012274acec8855a.tar.gz
interop-testing: add cacheable_unary test
Diffstat (limited to 'testing-proto')
-rw-r--r--testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java85
-rw-r--r--testing-proto/src/generated/main/java/io/grpc/testing/integration/Test.java40
-rw-r--r--testing-proto/src/main/proto/io/grpc/testing/integration/test.proto5
3 files changed, 106 insertions, 24 deletions
diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java
index 9d07cd3e7..d14c834fd 100644
--- a/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java
+++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java
@@ -56,6 +56,18 @@ public final class TestServiceGrpc {
io.grpc.testing.integration.Messages.SimpleResponse.getDefaultInstance()))
.build();
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
+ public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.SimpleRequest,
+ io.grpc.testing.integration.Messages.SimpleResponse> METHOD_CACHEABLE_UNARY_CALL =
+ io.grpc.MethodDescriptor.<io.grpc.testing.integration.Messages.SimpleRequest, io.grpc.testing.integration.Messages.SimpleResponse>newBuilder()
+ .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(generateFullMethodName(
+ "grpc.testing.TestService", "CacheableUnaryCall"))
+ .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+ io.grpc.testing.integration.Messages.SimpleRequest.getDefaultInstance()))
+ .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+ io.grpc.testing.integration.Messages.SimpleResponse.getDefaultInstance()))
+ .build();
+ @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
io.grpc.MethodDescriptor.<io.grpc.testing.integration.Messages.StreamingOutputCallRequest, io.grpc.testing.integration.Messages.StreamingOutputCallResponse>newBuilder()
@@ -169,6 +181,18 @@ public final class TestServiceGrpc {
/**
* <pre>
+ * One request followed by one response. Response has cache control
+ * headers set such that a caching HTTP proxy (such as GFE) can
+ * satisfy subsequent requests.
+ * </pre>
+ */
+ public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request,
+ io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver) {
+ asyncUnimplementedUnaryCall(METHOD_CACHEABLE_UNARY_CALL, responseObserver);
+ }
+
+ /**
+ * <pre>
* One request followed by a sequence of responses (streamed download).
* The server returns the payload with client desired type and sizes.
* </pre>
@@ -242,6 +266,13 @@ public final class TestServiceGrpc {
io.grpc.testing.integration.Messages.SimpleResponse>(
this, METHODID_UNARY_CALL)))
.addMethod(
+ METHOD_CACHEABLE_UNARY_CALL,
+ asyncUnaryCall(
+ new MethodHandlers<
+ io.grpc.testing.integration.Messages.SimpleRequest,
+ io.grpc.testing.integration.Messages.SimpleResponse>(
+ this, METHODID_CACHEABLE_UNARY_CALL)))
+ .addMethod(
METHOD_STREAMING_OUTPUT_CALL,
asyncServerStreamingCall(
new MethodHandlers<
@@ -326,6 +357,19 @@ public final class TestServiceGrpc {
/**
* <pre>
+ * One request followed by one response. Response has cache control
+ * headers set such that a caching HTTP proxy (such as GFE) can
+ * satisfy subsequent requests.
+ * </pre>
+ */
+ public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request,
+ io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver) {
+ asyncUnaryCall(
+ getChannel().newCall(METHOD_CACHEABLE_UNARY_CALL, getCallOptions()), request, responseObserver);
+ }
+
+ /**
+ * <pre>
* One request followed by a sequence of responses (streamed download).
* The server returns the payload with client desired type and sizes.
* </pre>
@@ -432,6 +476,18 @@ public final class TestServiceGrpc {
/**
* <pre>
+ * One request followed by one response. Response has cache control
+ * headers set such that a caching HTTP proxy (such as GFE) can
+ * satisfy subsequent requests.
+ * </pre>
+ */
+ public io.grpc.testing.integration.Messages.SimpleResponse cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
+ return blockingUnaryCall(
+ getChannel(), METHOD_CACHEABLE_UNARY_CALL, getCallOptions(), request);
+ }
+
+ /**
+ * <pre>
* One request followed by a sequence of responses (streamed download).
* The server returns the payload with client desired type and sizes.
* </pre>
@@ -500,6 +556,19 @@ public final class TestServiceGrpc {
/**
* <pre>
+ * One request followed by one response. Response has cache control
+ * headers set such that a caching HTTP proxy (such as GFE) can
+ * satisfy subsequent requests.
+ * </pre>
+ */
+ public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> cacheableUnaryCall(
+ io.grpc.testing.integration.Messages.SimpleRequest request) {
+ return futureUnaryCall(
+ getChannel().newCall(METHOD_CACHEABLE_UNARY_CALL, getCallOptions()), request);
+ }
+
+ /**
+ * <pre>
* The test server will not implement this method. It will be used
* to test the behavior when clients call unimplemented methods.
* </pre>
@@ -513,11 +582,12 @@ public final class TestServiceGrpc {
private static final int METHODID_EMPTY_CALL = 0;
private static final int METHODID_UNARY_CALL = 1;
- private static final int METHODID_STREAMING_OUTPUT_CALL = 2;
- private static final int METHODID_UNIMPLEMENTED_CALL = 3;
- private static final int METHODID_STREAMING_INPUT_CALL = 4;
- private static final int METHODID_FULL_DUPLEX_CALL = 5;
- private static final int METHODID_HALF_DUPLEX_CALL = 6;
+ private static final int METHODID_CACHEABLE_UNARY_CALL = 2;
+ private static final int METHODID_STREAMING_OUTPUT_CALL = 3;
+ private static final int METHODID_UNIMPLEMENTED_CALL = 4;
+ private static final int METHODID_STREAMING_INPUT_CALL = 5;
+ private static final int METHODID_FULL_DUPLEX_CALL = 6;
+ private static final int METHODID_HALF_DUPLEX_CALL = 7;
private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
@@ -544,6 +614,10 @@ public final class TestServiceGrpc {
serviceImpl.unaryCall((io.grpc.testing.integration.Messages.SimpleRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse>) responseObserver);
break;
+ case METHODID_CACHEABLE_UNARY_CALL:
+ serviceImpl.cacheableUnaryCall((io.grpc.testing.integration.Messages.SimpleRequest) request,
+ (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse>) responseObserver);
+ break;
case METHODID_STREAMING_OUTPUT_CALL:
serviceImpl.streamingOutputCall((io.grpc.testing.integration.Messages.StreamingOutputCallRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) responseObserver);
@@ -596,6 +670,7 @@ public final class TestServiceGrpc {
.setSchemaDescriptor(new TestServiceDescriptorSupplier())
.addMethod(METHOD_EMPTY_CALL)
.addMethod(METHOD_UNARY_CALL)
+ .addMethod(METHOD_CACHEABLE_UNARY_CALL)
.addMethod(METHOD_STREAMING_OUTPUT_CALL)
.addMethod(METHOD_STREAMING_INPUT_CALL)
.addMethod(METHOD_FULL_DUPLEX_CALL)
diff --git a/testing-proto/src/generated/main/java/io/grpc/testing/integration/Test.java b/testing-proto/src/generated/main/java/io/grpc/testing/integration/Test.java
index 114d492a8..44903d277 100644
--- a/testing-proto/src/generated/main/java/io/grpc/testing/integration/Test.java
+++ b/testing-proto/src/generated/main/java/io/grpc/testing/integration/Test.java
@@ -26,29 +26,31 @@ public final class Test {
"\n&io/grpc/testing/integration/test.proto" +
"\022\014grpc.testing\032\'io/grpc/testing/integrat" +
"ion/empty.proto\032*io/grpc/testing/integra" +
- "tion/messages.proto2\372\004\n\013TestService\0225\n\tE" +
+ "tion/messages.proto2\313\005\n\013TestService\0225\n\tE" +
"mptyCall\022\023.grpc.testing.Empty\032\023.grpc.tes" +
"ting.Empty\022F\n\tUnaryCall\022\033.grpc.testing.S" +
"impleRequest\032\034.grpc.testing.SimpleRespon" +
- "se\022l\n\023StreamingOutputCall\022(.grpc.testing" +
+ "se\022O\n\022CacheableUnaryCall\022\033.grpc.testing." +
+ "SimpleRequest\032\034.grpc.testing.SimpleRespo" +
+ "nse\022l\n\023StreamingOutputCall\022(.grpc.testin",
+ "g.StreamingOutputCallRequest\032).grpc.test" +
+ "ing.StreamingOutputCallResponse0\001\022i\n\022Str" +
+ "eamingInputCall\022\'.grpc.testing.Streaming" +
+ "InputCallRequest\032(.grpc.testing.Streamin" +
+ "gInputCallResponse(\001\022i\n\016FullDuplexCall\022(" +
+ ".grpc.testing.StreamingOutputCallRequest" +
+ "\032).grpc.testing.StreamingOutputCallRespo" +
+ "nse(\0010\001\022i\n\016HalfDuplexCall\022(.grpc.testing" +
".StreamingOutputCallRequest\032).grpc.testi" +
- "ng.StreamingOutputCallResponse0\001\022i\n\022Stre",
- "amingInputCall\022\'.grpc.testing.StreamingI" +
- "nputCallRequest\032(.grpc.testing.Streaming" +
- "InputCallResponse(\001\022i\n\016FullDuplexCall\022(." +
- "grpc.testing.StreamingOutputCallRequest\032" +
- ").grpc.testing.StreamingOutputCallRespon" +
- "se(\0010\001\022i\n\016HalfDuplexCall\022(.grpc.testing." +
- "StreamingOutputCallRequest\032).grpc.testin" +
- "g.StreamingOutputCallResponse(\0010\001\022=\n\021Uni" +
- "mplementedCall\022\023.grpc.testing.Empty\032\023.gr" +
- "pc.testing.Empty2U\n\024UnimplementedService",
- "\022=\n\021UnimplementedCall\022\023.grpc.testing.Emp" +
- "ty\032\023.grpc.testing.Empty2\177\n\020ReconnectServ" +
- "ice\0221\n\005Start\022\023.grpc.testing.Empty\032\023.grpc" +
- ".testing.Empty\0228\n\004Stop\022\023.grpc.testing.Em" +
- "pty\032\033.grpc.testing.ReconnectInfoB\035\n\033io.g" +
- "rpc.testing.integrationb\006proto3"
+ "ng.StreamingOutputCallResponse(\0010\001\022=\n\021Un",
+ "implementedCall\022\023.grpc.testing.Empty\032\023.g" +
+ "rpc.testing.Empty2U\n\024UnimplementedServic" +
+ "e\022=\n\021UnimplementedCall\022\023.grpc.testing.Em" +
+ "pty\032\023.grpc.testing.Empty2\177\n\020ReconnectSer" +
+ "vice\0221\n\005Start\022\023.grpc.testing.Empty\032\023.grp" +
+ "c.testing.Empty\0228\n\004Stop\022\023.grpc.testing.E" +
+ "mpty\032\033.grpc.testing.ReconnectInfoB\035\n\033io." +
+ "grpc.testing.integrationb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
diff --git a/testing-proto/src/main/proto/io/grpc/testing/integration/test.proto b/testing-proto/src/main/proto/io/grpc/testing/integration/test.proto
index e4a41b4c9..c07d8a9dd 100644
--- a/testing-proto/src/main/proto/io/grpc/testing/integration/test.proto
+++ b/testing-proto/src/main/proto/io/grpc/testing/integration/test.proto
@@ -47,6 +47,11 @@ service TestService {
// One request followed by one response.
rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
+ // One request followed by one response. Response has cache control
+ // headers set such that a caching HTTP proxy (such as GFE) can
+ // satisfy subsequent requests.
+ rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse);
+
// One request followed by a sequence of responses (streamed download).
// The server returns the payload with client desired type and sizes.
rpc StreamingOutputCall(StreamingOutputCallRequest)