Removing all references to "stubby"

This commit is contained in:
nmittler 2015-01-27 10:25:39 -08:00
parent aeeebb7cdb
commit f83145865a
151 changed files with 1057 additions and 1042 deletions

View File

@ -11,7 +11,7 @@ datamodel/IDL/interface you are adapting. An example is provided of a binding to
#### Key Interfaces
[Stream Observer](https://github.com/google/grpc-java/blob/master/stub/src/main/java/com/google/net/stubby/stub/StreamObserver.java)
[Stream Observer](https://github.com/google/grpc-java/blob/master/stub/src/main/java/io/grpc/stub/StreamObserver.java)
## Channel
@ -20,17 +20,17 @@ The 'channel' layer is an abstraction over transport handling that is suitable f
#### Common
* [Metadata - headers & trailers](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Metadata.java)
* [Status - error code namespace & handling](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Status.java)
* [Metadata - headers & trailers](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Metadata.java)
* [Status - error code namespace & handling](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Status.java)
#### Client
* [Channel - client side binding](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Channel.java)
* [Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Call.java)
* [Client Interceptor](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/ClientInterceptor.java)
* [Channel - client side binding](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Channel.java)
* [Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Call.java)
* [Client Interceptor](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/ClientInterceptor.java)
#### Server
* [Server call handler - analog to Channel on server](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/ServerCallHandler.java)
* [Server Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/ServerCall.java)
* [Server call handler - analog to Channel on server](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/ServerCallHandler.java)
* [Server Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/ServerCall.java)
## Transport
@ -39,20 +39,20 @@ The 'transport' layer does the heavy lifting of putting & taking bytes off the w
#### Common
* [Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/Stream.java)
* [Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/StreamListener.java)
* [Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/Stream.java)
* [Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/StreamListener.java)
#### Client
* [Client Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ClientStream.java)
* [Client Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ClientStreamListener.java)
* [Client Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ClientStream.java)
* [Client Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ClientStreamListener.java)
#### Server
* [Server Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ServerStream.java)
* [Server Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ServerStreamListener.java)
* [Server Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ServerStream.java)
* [Server Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ServerStreamListener.java)
# Examples
Tests showing how these layers are composed to execute calls using protobuf messages can be found here https://github.com/google/grpc-java/tree/master/integration-testing/src/main/java/com/google/net/stubby/testing/integration
Tests showing how these layers are composed to execute calls using protobuf messages can be found here https://github.com/google/grpc-java/tree/master/integration-testing/src/main/java/io/grpc/testing/integration

View File

@ -1,14 +1,14 @@
description = "Stubby: All"
description = "gRPC: All"
// Make sure that no transitive dependencies are included.
configurations.compile.transitive = false
dependencies {
compile project(':stubby-core'),
project(':stubby-stub'),
project(':stubby-auth'),
project(':stubby-netty'),
project(':stubby-okhttp')
compile project(':grpc-core'),
project(':grpc-stub'),
project(':grpc-auth'),
project(':grpc-netty'),
project(':grpc-okhttp')
}
// Create a fat jar containing only the direct dependencies

View File

@ -2,9 +2,9 @@ plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = "Stubby: Auth"
description = "gRpc: Auth"
dependencies {
compile project(':stubby-core'),
compile project(':grpc-core'),
libraries.oauth_client,
libraries.javaee_api
}

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.auth;
package io.grpc.auth;
import com.google.api.client.auth.oauth2.Credential;
import com.google.common.base.Preconditions;

View File

@ -29,15 +29,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.auth;
package io.grpc.auth;
import com.google.api.client.auth.oauth2.Credential;
import com.google.net.stubby.Call;
import com.google.net.stubby.Channel;
import com.google.net.stubby.ClientInterceptor;
import com.google.net.stubby.ClientInterceptors.ForwardingCall;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.MethodDescriptor;
import io.grpc.Call;
import io.grpc.Channel;
import io.grpc.ClientInterceptor;
import io.grpc.ClientInterceptors.ForwardingCall;
import io.grpc.Metadata;
import io.grpc.MethodDescriptor;
import java.util.concurrent.Executor;

View File

@ -3,7 +3,7 @@ subprojects {
apply plugin: "maven"
apply plugin: "idea"
group = "com.google.net.stubby"
group = "io.grpc"
version = "0.1.0-SNAPSHOT"
sourceCompatibility = 1.6

View File

@ -15,6 +15,6 @@ GOLDEN_FILE="$TEST_SRC_DIR/TestService.java.txt"
protoc --plugin=protoc-gen-java_rpc=build/binaries/java_pluginExecutable/java_plugin \
--java_rpc_out="$OUTPUT_FILE" --proto_path="$TEST_SRC_DIR" "$INPUT_FILE" && \
unzip -o -d "$TEST_TMP_DIR" "$OUTPUT_FILE" && \
diff "$TEST_TMP_DIR/com/google/net/stubby/testing/integration/TestServiceGrpc.java" \
diff "$TEST_TMP_DIR/io/grpc/testing/integration/TestServiceGrpc.java" \
"$GOLDEN_FILE" && \
echo "PASS"

View File

@ -470,11 +470,11 @@ static void PrintBindServiceMethod(const ServiceDescriptor* service,
if (client_streaming) {
(*vars)["calls_method"] = "asyncStreamingRequestCall";
(*vars)["invocation_class"] =
"com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod";
"io.grpc.stub.ServerCalls.StreamingRequestMethod";
} else {
(*vars)["calls_method"] = "asyncUnaryRequestCall";
(*vars)["invocation_class"] =
"com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod";
"io.grpc.stub.ServerCalls.UnaryRequestMethod";
}
p->Print(*vars, ".addMethod(createMethodDefinition(\n");
p->Indent();
@ -586,27 +586,27 @@ static void PrintService(const ServiceDescriptor* service,
void PrintImports(Printer* p) {
p->Print(
"import static "
"com.google.net.stubby.stub.Calls.createMethodDescriptor;\n"
"io.grpc.stub.Calls.createMethodDescriptor;\n"
"import static "
"com.google.net.stubby.stub.Calls.asyncUnaryCall;\n"
"io.grpc.stub.Calls.asyncUnaryCall;\n"
"import static "
"com.google.net.stubby.stub.Calls.asyncServerStreamingCall;\n"
"io.grpc.stub.Calls.asyncServerStreamingCall;\n"
"import static "
"com.google.net.stubby.stub.Calls.asyncClientStreamingCall;\n"
"io.grpc.stub.Calls.asyncClientStreamingCall;\n"
"import static "
"com.google.net.stubby.stub.Calls.duplexStreamingCall;\n"
"io.grpc.stub.Calls.duplexStreamingCall;\n"
"import static "
"com.google.net.stubby.stub.Calls.blockingUnaryCall;\n"
"io.grpc.stub.Calls.blockingUnaryCall;\n"
"import static "
"com.google.net.stubby.stub.Calls.blockingServerStreamingCall;\n"
"io.grpc.stub.Calls.blockingServerStreamingCall;\n"
"import static "
"com.google.net.stubby.stub.Calls.unaryFutureCall;\n"
"io.grpc.stub.Calls.unaryFutureCall;\n"
"import static "
"com.google.net.stubby.stub.ServerCalls.createMethodDefinition;\n"
"io.grpc.stub.ServerCalls.createMethodDefinition;\n"
"import static "
"com.google.net.stubby.stub.ServerCalls.asyncUnaryRequestCall;\n"
"io.grpc.stub.ServerCalls.asyncUnaryRequestCall;\n"
"import static "
"com.google.net.stubby.stub.ServerCalls.asyncStreamingRequestCall;\n\n");
"io.grpc.stub.ServerCalls.asyncStreamingRequestCall;\n\n");
}
void GenerateService(const ServiceDescriptor* service,
@ -616,18 +616,18 @@ void GenerateService(const ServiceDescriptor* service,
map<string, string> vars;
vars["String"] = "java.lang.String";
vars["Override"] = "java.lang.Override";
vars["Channel"] = "com.google.net.stubby.Channel";
vars["MethodType"] = "com.google.net.stubby.MethodType";
vars["Channel"] = "io.grpc.Channel";
vars["MethodType"] = "io.grpc.MethodType";
vars["ServerServiceDefinition"] =
"com.google.net.stubby.ServerServiceDefinition";
vars["AbstractStub"] = "com.google.net.stubby.stub.AbstractStub";
vars["Method"] = "com.google.net.stubby.stub.Method";
"io.grpc.ServerServiceDefinition";
vars["AbstractStub"] = "io.grpc.stub.AbstractStub";
vars["Method"] = "io.grpc.stub.Method";
vars["AbstractServiceDescriptor"] =
"com.google.net.stubby.stub.AbstractServiceDescriptor";
"io.grpc.stub.AbstractServiceDescriptor";
vars["ImmutableList"] = "com.google.common.collect.ImmutableList";
vars["MethodDescriptor"] = "com.google.net.stubby.MethodDescriptor";
vars["ProtoUtils"] = "com.google.net.stubby.proto.ProtoUtils";
vars["StreamObserver"] = "com.google.net.stubby.stub.StreamObserver";
vars["MethodDescriptor"] = "io.grpc.MethodDescriptor";
vars["ProtoUtils"] = "io.grpc.proto.ProtoUtils";
vars["StreamObserver"] = "io.grpc.stub.StreamObserver";
vars["Iterator"] = "java.util.Iterator";
vars["Map"] = "java.util.Map";
vars["TimeUnit"] = "java.util.concurrent.TimeUnit";

View File

@ -1,62 +1,62 @@
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import static com.google.net.stubby.stub.Calls.createMethodDescriptor;
import static com.google.net.stubby.stub.Calls.asyncUnaryCall;
import static com.google.net.stubby.stub.Calls.asyncServerStreamingCall;
import static com.google.net.stubby.stub.Calls.asyncClientStreamingCall;
import static com.google.net.stubby.stub.Calls.duplexStreamingCall;
import static com.google.net.stubby.stub.Calls.blockingUnaryCall;
import static com.google.net.stubby.stub.Calls.blockingServerStreamingCall;
import static com.google.net.stubby.stub.Calls.unaryFutureCall;
import static com.google.net.stubby.stub.ServerCalls.createMethodDefinition;
import static com.google.net.stubby.stub.ServerCalls.asyncUnaryRequestCall;
import static com.google.net.stubby.stub.ServerCalls.asyncStreamingRequestCall;
import static io.grpc.stub.Calls.createMethodDescriptor;
import static io.grpc.stub.Calls.asyncUnaryCall;
import static io.grpc.stub.Calls.asyncServerStreamingCall;
import static io.grpc.stub.Calls.asyncClientStreamingCall;
import static io.grpc.stub.Calls.duplexStreamingCall;
import static io.grpc.stub.Calls.blockingUnaryCall;
import static io.grpc.stub.Calls.blockingServerStreamingCall;
import static io.grpc.stub.Calls.unaryFutureCall;
import static io.grpc.stub.ServerCalls.createMethodDefinition;
import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall;
import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall;
@javax.annotation.Generated("by gRPC proto compiler")
public class TestServiceGrpc {
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.SimpleRequest,
com.google.net.stubby.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.UNARY, "UnaryCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.SimpleRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.SimpleResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.SERVER_STREAMING, "StreamingOutputCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.CLIENT_STREAMING, "StreamingInputCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.SimpleRequest,
io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.UNARY, "UnaryCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.SERVER_STREAMING, "StreamingOutputCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingInputCallRequest,
io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.CLIENT_STREAMING, "StreamingInputCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
public static TestServiceStub newStub(com.google.net.stubby.Channel channel) {
public static TestServiceStub newStub(io.grpc.Channel channel) {
return new TestServiceStub(channel, CONFIG);
}
public static TestServiceBlockingStub newBlockingStub(
com.google.net.stubby.Channel channel) {
io.grpc.Channel channel) {
return new TestServiceBlockingStub(channel, CONFIG);
}
public static TestServiceFutureStub newFutureStub(
com.google.net.stubby.Channel channel) {
io.grpc.Channel channel) {
return new TestServiceFutureStub(channel, CONFIG);
}
@ -65,17 +65,17 @@ public class TestServiceGrpc {
@javax.annotation.concurrent.Immutable
public static class TestServiceServiceDescriptor extends
com.google.net.stubby.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.SimpleRequest,
com.google.net.stubby.testing.integration.Test.SimpleResponse> unaryCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
io.grpc.testing.integration.Test.SimpleResponse> unaryCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
private TestServiceServiceDescriptor() {
unaryCall = createMethodDescriptor(
@ -91,33 +91,33 @@ public class TestServiceGrpc {
}
private TestServiceServiceDescriptor(
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
unaryCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.SimpleRequest,
com.google.net.stubby.testing.integration.Test.SimpleResponse>) methodMap.get(
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get(
CONFIG.unaryCall.getName());
streamingOutputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
CONFIG.streamingOutputCall.getName());
streamingInputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
CONFIG.streamingInputCall.getName());
fullDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
CONFIG.fullDuplexCall.getName());
halfDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
CONFIG.halfDuplexCall.getName());
}
@java.lang.Override
protected TestServiceServiceDescriptor build(
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
return new TestServiceServiceDescriptor(methodMap);
}
@java.lang.Override
public com.google.common.collect.ImmutableList<com.google.net.stubby.MethodDescriptor<?, ?>> methods() {
return com.google.common.collect.ImmutableList.<com.google.net.stubby.MethodDescriptor<?, ?>>of(
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
unaryCall,
streamingOutputCall,
streamingInputCall,
@ -128,198 +128,198 @@ public class TestServiceGrpc {
public static interface TestService {
public void unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.SimpleResponse> responseObserver);
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
public void streamingOutputCall(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> responseObserver);
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
}
public static interface TestServiceBlockingClient {
public com.google.net.stubby.testing.integration.Test.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request);
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
public java.util.Iterator<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request);
public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
}
public static interface TestServiceFutureClient {
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Test.SimpleResponse> unaryCall(
com.google.net.stubby.testing.integration.Test.SimpleRequest request);
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
io.grpc.testing.integration.Test.SimpleRequest request);
}
public static class TestServiceStub extends
com.google.net.stubby.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
implements TestService {
private TestServiceStub(com.google.net.stubby.Channel channel,
private TestServiceStub(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceStub build(com.google.net.stubby.Channel channel,
protected TestServiceStub build(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceStub(channel, config);
}
@java.lang.Override
public void unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.SimpleResponse> responseObserver) {
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
asyncUnaryCall(
channel.newCall(config.unaryCall), request, responseObserver);
}
@java.lang.Override
public void streamingOutputCall(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
asyncServerStreamingCall(
channel.newCall(config.streamingOutputCall), request, responseObserver);
}
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
return asyncClientStreamingCall(
channel.newCall(config.streamingInputCall), responseObserver);
}
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
return duplexStreamingCall(
channel.newCall(config.fullDuplexCall), responseObserver);
}
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
return duplexStreamingCall(
channel.newCall(config.halfDuplexCall), responseObserver);
}
}
public static class TestServiceBlockingStub extends
com.google.net.stubby.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
implements TestServiceBlockingClient {
private TestServiceBlockingStub(com.google.net.stubby.Channel channel,
private TestServiceBlockingStub(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceBlockingStub build(com.google.net.stubby.Channel channel,
protected TestServiceBlockingStub build(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceBlockingStub(channel, config);
}
@java.lang.Override
public com.google.net.stubby.testing.integration.Test.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request) {
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
return blockingUnaryCall(
channel.newCall(config.unaryCall), request);
}
@java.lang.Override
public java.util.Iterator<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request) {
public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
channel.newCall(config.streamingOutputCall), request);
}
}
public static class TestServiceFutureStub extends
com.google.net.stubby.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
implements TestServiceFutureClient {
private TestServiceFutureStub(com.google.net.stubby.Channel channel,
private TestServiceFutureStub(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceFutureStub build(com.google.net.stubby.Channel channel,
protected TestServiceFutureStub build(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceFutureStub(channel, config);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Test.SimpleResponse> unaryCall(
com.google.net.stubby.testing.integration.Test.SimpleRequest request) {
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
io.grpc.testing.integration.Test.SimpleRequest request) {
return unaryFutureCall(
channel.newCall(config.unaryCall), request);
}
}
public static com.google.net.stubby.ServerServiceDefinition bindService(
public static io.grpc.ServerServiceDefinition bindService(
final TestService serviceImpl) {
return com.google.net.stubby.ServerServiceDefinition.builder("grpc.testing.TestService")
return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService")
.addMethod(createMethodDefinition(
METHOD_UNARY_CALL,
asyncUnaryRequestCall(
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
com.google.net.stubby.testing.integration.Test.SimpleRequest,
com.google.net.stubby.testing.integration.Test.SimpleResponse>() {
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
io.grpc.testing.integration.Test.SimpleRequest,
io.grpc.testing.integration.Test.SimpleResponse>() {
@java.lang.Override
public void invoke(
com.google.net.stubby.testing.integration.Test.SimpleRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.SimpleResponse> responseObserver) {
io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
serviceImpl.unaryCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_STREAMING_OUTPUT_CALL,
asyncUnaryRequestCall(
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>() {
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
@java.lang.Override
public void invoke(
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
serviceImpl.streamingOutputCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_STREAMING_INPUT_CALL,
asyncStreamingRequestCall(
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse>() {
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
io.grpc.testing.integration.Test.StreamingInputCallRequest,
io.grpc.testing.integration.Test.StreamingInputCallResponse>() {
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest> invoke(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
return serviceImpl.streamingInputCall(responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_FULL_DUPLEX_CALL,
asyncStreamingRequestCall(
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>() {
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> invoke(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
return serviceImpl.fullDuplexCall(responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_HALF_DUPLEX_CALL,
asyncStreamingRequestCall(
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>() {
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> invoke(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
return serviceImpl.halfDuplexCall(responseObserver);
}
}))).build();

View File

@ -3,7 +3,7 @@ syntax = "proto2";
package grpc.testing;
option java_package = "com.google.net.stubby.testing.integration";
option java_package = "io.grpc.testing.integration";
message SimpleRequest {
}

View File

@ -2,7 +2,7 @@ plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = 'Stubby: Core'
description = 'gRPC: Core'
dependencies {
compile libraries.protobuf,

View File

@ -29,12 +29,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.google.net.stubby.SharedResourceHolder.Resource;
import com.google.net.stubby.transport.ClientTransportFactory;
import io.grpc.SharedResourceHolder.Resource;
import io.grpc.transport.ClientTransportFactory;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

View File

@ -29,13 +29,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static com.google.net.stubby.AbstractChannelBuilder.DEFAULT_EXECUTOR;
import static io.grpc.AbstractChannelBuilder.DEFAULT_EXECUTOR;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Service;
import com.google.net.stubby.transport.ServerListener;
import io.grpc.transport.ServerListener;
import java.util.concurrent.ExecutorService;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
/**

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,17 +29,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Service.Listener;
import com.google.common.util.concurrent.Service.State;
import com.google.net.stubby.transport.ClientStream;
import com.google.net.stubby.transport.ClientStreamListener;
import com.google.net.stubby.transport.ClientTransport;
import com.google.net.stubby.transport.ClientTransportFactory;
import io.grpc.transport.ClientStream;
import io.grpc.transport.ClientStreamListener;
import io.grpc.transport.ClientTransport;
import io.grpc.transport.ClientTransportFactory;
import java.io.IOException;
import java.io.InputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@ -142,8 +142,8 @@ public class ClientInterceptors {
}
/**
* A {@link com.google.net.stubby.Call.Listener} which forwards all of its methods to another
* {@link com.google.net.stubby.Call.Listener}.
* A {@link io.grpc.Call.Listener} which forwards all of its methods to another
* {@link io.grpc.Call.Listener}.
*/
public static class ForwardingListener<T> extends Call.Listener<T> {

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import java.io.IOException;
import java.io.InputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
/**
* Common constants and utilities for GRPC protocol framing.

View File

@ -29,10 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
import com.google.net.stubby.ServerMethodDefinition;
import com.google.net.stubby.ServerServiceDefinition;
package io.grpc;
import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import java.io.InputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static com.google.common.base.Charsets.US_ASCII;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
/**
* The call type of a method.

View File

@ -29,9 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
import com.google.net.stubby.ServerServiceDefinition;
package io.grpc;
import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
/**

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,21 +29,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Service;
import com.google.net.stubby.transport.ServerListener;
import com.google.net.stubby.transport.ServerStream;
import com.google.net.stubby.transport.ServerStreamListener;
import com.google.net.stubby.transport.ServerTransportListener;
import io.grpc.transport.ServerListener;
import io.grpc.transport.ServerStream;
import io.grpc.transport.ServerStreamListener;
import io.grpc.transport.ServerTransportListener;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import javax.annotation.concurrent.ThreadSafe;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import java.io.InputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.Preconditions;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

View File

@ -29,13 +29,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.proto;
package io.grpc.proto;
import com.google.common.io.ByteStreams;
import com.google.net.stubby.DeferredInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.MessageLite;
import io.grpc.DeferredInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;
@ -43,7 +44,7 @@ import java.io.OutputStream;
import javax.annotation.Nullable;
/**
* Implementation of {@link com.google.net.stubby.DeferredInputStream} backed by a protobuf.
* Implementation of {@link io.grpc.DeferredInputStream} backed by a protobuf.
*/
public class DeferredProtoInputStream extends DeferredInputStream<MessageLite> {

View File

@ -29,16 +29,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.proto;
package io.grpc.proto;
import com.google.net.stubby.Marshaller;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import com.google.protobuf.MessageLite;
import com.google.protobuf.Parser;
import io.grpc.Marshaller;
import io.grpc.Metadata;
import io.grpc.Status;
import java.io.InputStream;
/**

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
/**
* Abstract base class for {@link Buffer} implementations.

View File

@ -29,12 +29,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import io.grpc.Metadata;
import io.grpc.Status;
import java.io.InputStream;
import java.nio.ByteBuffer;
@ -98,7 +99,7 @@ public abstract class AbstractClientStream<IdT> extends AbstractStream<IdT>
* Called by transport implementations when they receive headers. When receiving headers
* a transport may determine that there is an error in the protocol at this phase which is
* why this method takes an error {@link Status}. If a transport reports an
* {@link com.google.net.stubby.Status.Code#INTERNAL} error
* {@link io.grpc.Status.Code#INTERNAL} error
*
* @param headers the parsed headers
*/

View File

@ -29,12 +29,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.AbstractService;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.MethodDescriptor;
import io.grpc.Metadata;
import io.grpc.MethodDescriptor;
/**
* Abstract base class for all {@link ClientTransport} implementations. Implements the

View File

@ -29,11 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.Preconditions;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import io.grpc.Metadata;
import io.grpc.Status;
import java.io.InputStream;
import java.nio.ByteBuffer;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import java.io.Closeable;
import java.io.IOException;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.UTF_8;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
/**
* Extension of {@link Stream} to support client-side termination semantics.

View File

@ -29,10 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import io.grpc.Metadata;
import io.grpc.Status;
/** An observer of client-side stream events. */
public interface ClientStreamListener extends StreamListener {
@ -40,7 +40,7 @@ public interface ClientStreamListener extends StreamListener {
* Called upon receiving all header information from the remote end-point. Note that transports
* are not required to call this method if no header information is received, this would occur
* when a stream immediately terminates with an error and only
* {@link #closed(com.google.net.stubby.Status, Metadata.Trailers)} is called.
* {@link #closed(io.grpc.Status, Metadata.Trailers)} is called.
*
* <p>This method should return quickly, as the same thread may be used to process other streams.
*
@ -50,7 +50,7 @@ public interface ClientStreamListener extends StreamListener {
/**
* Called when the stream is fully closed. {@link
* com.google.net.stubby.Status.Code#OK} is the only status code that is guaranteed
* io.grpc.Status.Code#OK} is the only status code that is guaranteed
* to have been sent from the remote server. Any other status code may have been caused by
* abnormal stream termination. This is guaranteed to always be the final call on a listener. No
* further callbacks will be issued.

View File

@ -29,11 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.util.concurrent.Service;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.MethodDescriptor;
import io.grpc.Metadata;
import io.grpc.MethodDescriptor;
/**
* The client-side transport encapsulating a single connection to a remote server. Allows creation

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
/** Pre-configured factory for creating {@link ClientTransport} instances. */
public interface ClientTransportFactory {

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.Preconditions;

View File

@ -29,12 +29,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import io.grpc.Metadata;
import io.grpc.Status;
import java.nio.charset.Charset;

View File

@ -29,10 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import io.grpc.Metadata;
import io.grpc.Status;
import java.net.HttpURLConnection;

View File

@ -29,11 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.Preconditions;
import com.google.common.io.ByteStreams;
import com.google.net.stubby.Status;
import io.grpc.Status;
import java.io.ByteArrayInputStream;
import java.io.Closeable;

View File

@ -29,11 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.base.Preconditions;
import com.google.common.io.ByteStreams;
import com.google.net.stubby.DeferredInputStream;
import io.grpc.DeferredInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.common.util.concurrent.Service;

View File

@ -29,10 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.Status;
import io.grpc.Metadata;
import io.grpc.Status;
/**
* Extension of {@link Stream} to support server-side termination semantics.
@ -50,7 +50,7 @@ public interface ServerStream extends Stream {
/**
* Closes the stream for both reading and writing. A status code of
* {@link com.google.net.stubby.Status.Code#OK} implies normal termination of the
* {@link io.grpc.Status.Code#OK} implies normal termination of the
* stream. Any other value implies abnormal termination.
*
* @param status details of the closure

View File

@ -29,9 +29,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.net.stubby.Status;
import io.grpc.Status;
/** An observer of server-side stream events. */
public interface ServerStreamListener extends StreamListener {
@ -45,7 +45,7 @@ public interface ServerStreamListener extends StreamListener {
/**
* Called when the stream is fully closed. A status code of {@link
* com.google.net.stubby.Status.Code#OK} implies normal termination of the stream.
* io.grpc.Status.Code#OK} implies normal termination of the stream.
* Any other value implies abnormal termination. Since clients cannot send status, the passed
* status is always library-generated and only is concerned with transport-level stream shutdown
* (the call itself may have had a failing status, but if the stream terminated cleanly with the

View File

@ -29,9 +29,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import com.google.net.stubby.Metadata;
import io.grpc.Metadata;
/**
* A observer of a server-side transport for stream creation events.

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import java.io.InputStream;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import java.io.InputStream;

View File

@ -29,12 +29,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.US_ASCII;
import com.google.common.io.BaseEncoding;
import com.google.net.stubby.Metadata;
import io.grpc.Metadata;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -29,21 +29,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.same;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.net.stubby.ClientInterceptors.ForwardingCall;
import com.google.net.stubby.ClientInterceptors.ForwardingListener;
import io.grpc.ClientInterceptors.ForwardingCall;
import io.grpc.ClientInterceptors.ForwardingListener;
import org.junit.Before;
import org.junit.Test;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static com.google.common.base.Charsets.US_ASCII;
import static com.google.common.base.Charsets.UTF_8;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@ -38,10 +38,7 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import com.google.net.stubby.ServerMethodDefinition;
import com.google.net.stubby.ServerCallHandler;
import com.google.net.stubby.ServerServiceDefinition;
import com.google.net.stubby.HandlerRegistry.Method;
import io.grpc.HandlerRegistry.Method;
import org.junit.After;
import org.junit.Test;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static com.google.common.base.Charsets.UTF_8;
import static org.junit.Assert.assertEquals;
@ -49,9 +49,10 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import com.google.common.io.ByteStreams;
import com.google.common.util.concurrent.AbstractService;
import com.google.common.util.concurrent.Service;
import com.google.net.stubby.transport.ServerStream;
import com.google.net.stubby.transport.ServerStreamListener;
import com.google.net.stubby.transport.ServerTransportListener;
import io.grpc.transport.ServerStream;
import io.grpc.transport.ServerStreamListener;
import io.grpc.transport.ServerTransportListener;
import org.junit.After;
import org.junit.Before;
@ -60,7 +61,6 @@ import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import java.io.ByteArrayInputStream;

View File

@ -29,18 +29,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.same;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import com.google.net.stubby.Metadata.Headers;
import io.grpc.Metadata.Headers;
import org.junit.After;
import org.junit.Before;
@ -51,8 +51,8 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/** Unit tests for {@link ServerInterceptors}. */

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby;
package io.grpc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@ -38,13 +38,12 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.when;
import com.google.net.stubby.SharedResourceHolder.Resource;
import io.grpc.SharedResourceHolder.Resource;
import org.junit.Before;
import org.junit.Test;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.UTF_8;
import static org.junit.Assert.assertEquals;

View File

@ -29,10 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.UTF_8;
import static com.google.net.stubby.transport.Buffers.wrap;
import static io.grpc.transport.Buffers.wrap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.UTF_8;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.UTF_8;
import static org.junit.Assert.assertEquals;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@ -42,7 +42,8 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import com.google.common.io.ByteStreams;
import com.google.common.primitives.Bytes;
import com.google.net.stubby.transport.MessageDeframer.Listener;
import io.grpc.transport.MessageDeframer.Listener;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

View File

@ -29,20 +29,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.transport;
package io.grpc.transport;
import static com.google.common.base.Charsets.US_ASCII;
import static com.google.common.base.Charsets.UTF_8;
import static com.google.net.stubby.Metadata.ASCII_STRING_MARSHALLER;
import static io.grpc.Metadata.ASCII_STRING_MARSHALLER;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import com.google.common.io.BaseEncoding;
import com.google.net.stubby.Metadata.BinaryMarshaller;
import com.google.net.stubby.Metadata.Headers;
import com.google.net.stubby.Metadata.Key;
import io.grpc.Metadata.BinaryMarshaller;
import io.grpc.Metadata.Headers;
import io.grpc.Metadata.Key;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -29,13 +29,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.examples;
package io.grpc.examples;
import com.google.common.util.concurrent.SettableFuture;
import com.google.net.stubby.ChannelImpl;
import com.google.net.stubby.stub.StreamObserver;
import com.google.net.stubby.transport.netty.NegotiationType;
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
import com.google.protos.net.stubby.examples.CalcGrpc;
import com.google.protos.net.stubby.examples.CalcGrpc.CalcBlockingStub;
import com.google.protos.net.stubby.examples.CalcGrpc.CalcStub;
@ -44,6 +40,11 @@ import com.google.protos.net.stubby.examples.Math.DivReply;
import com.google.protos.net.stubby.examples.Math.FibArgs;
import com.google.protos.net.stubby.examples.Math.Num;
import io.grpc.ChannelImpl;
import io.grpc.stub.StreamObserver;
import io.grpc.transport.netty.NegotiationType;
import io.grpc.transport.netty.NettyChannelBuilder;
import java.util.Iterator;
import java.util.Random;
import java.util.concurrent.CountDownLatch;

View File

@ -29,17 +29,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.examples;
package io.grpc.examples;
import com.google.net.stubby.ServerImpl;
import com.google.net.stubby.stub.StreamObserver;
import com.google.net.stubby.transport.netty.NettyServerBuilder;
import com.google.protos.net.stubby.examples.CalcGrpc;
import com.google.protos.net.stubby.examples.Math.DivArgs;
import com.google.protos.net.stubby.examples.Math.DivReply;
import com.google.protos.net.stubby.examples.Math.FibArgs;
import com.google.protos.net.stubby.examples.Math.Num;
import io.grpc.ServerImpl;
import io.grpc.stub.StreamObserver;
import io.grpc.transport.netty.NettyServerBuilder;
import java.util.logging.Level;
import java.util.logging.Logger;

View File

@ -29,18 +29,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.examples;
package io.grpc.examples;
import com.google.net.stubby.ChannelImpl;
import com.google.net.stubby.stub.StreamObserver;
import com.google.net.stubby.transport.netty.NegotiationType;
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
import com.google.protos.net.stubby.examples.StockGrpc;
import com.google.protos.net.stubby.examples.StockGrpc.StockBlockingStub;
import com.google.protos.net.stubby.examples.StockGrpc.StockStub;
import com.google.protos.net.stubby.examples.StockOuterClass.StockReply;
import com.google.protos.net.stubby.examples.StockOuterClass.StockRequest;
import io.grpc.ChannelImpl;
import io.grpc.stub.StreamObserver;
import io.grpc.transport.netty.NegotiationType;
import io.grpc.transport.netty.NettyChannelBuilder;
import java.util.Iterator;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

View File

@ -29,15 +29,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.examples;
package io.grpc.examples;
import com.google.net.stubby.ServerImpl;
import com.google.net.stubby.stub.StreamObserver;
import com.google.net.stubby.transport.netty.NettyServerBuilder;
import com.google.protos.net.stubby.examples.StockGrpc;
import com.google.protos.net.stubby.examples.StockOuterClass.StockReply;
import com.google.protos.net.stubby.examples.StockOuterClass.StockRequest;
import io.grpc.ServerImpl;
import io.grpc.stub.StreamObserver;
import io.grpc.transport.netty.NettyServerBuilder;
import java.util.Random;
/**

View File

@ -1,6 +1,6 @@
syntax = "proto2";
package net.stubby.examples;
package io.grpc.examples;
option java_outer_classname = "Math";
message DivArgs {

View File

@ -1,6 +1,6 @@
syntax = "proto2";
package net.stubby.examples;
package io.grpc.examples;
// Protocol type definitions
message StockRequest {

View File

@ -1,7 +1,7 @@
apply plugin: 'protobuf'
apply plugin:'application'
description = "Stubby: Integration Testing"
description = "gRPC: Integration Testing"
// Add dependency on the protobuf plugin
buildscript {
@ -18,11 +18,11 @@ configurations {
}
dependencies {
compile project(':stubby-core'),
project(':stubby-netty'),
project(':stubby-okhttp'),
project(':stubby-stub'),
project(':stubby-testing'),
compile project(':grpc-core'),
project(':grpc-netty'),
project(':grpc-okhttp'),
project(':grpc-stub'),
project(':grpc-testing'),
libraries.junit,
libraries.mockito

View File

@ -1,382 +0,0 @@
package com.google.net.stubby.testing.integration;
import static com.google.net.stubby.stub.Calls.createMethodDescriptor;
import static com.google.net.stubby.stub.Calls.asyncUnaryCall;
import static com.google.net.stubby.stub.Calls.asyncServerStreamingCall;
import static com.google.net.stubby.stub.Calls.asyncClientStreamingCall;
import static com.google.net.stubby.stub.Calls.duplexStreamingCall;
import static com.google.net.stubby.stub.Calls.blockingUnaryCall;
import static com.google.net.stubby.stub.Calls.blockingServerStreamingCall;
import static com.google.net.stubby.stub.Calls.unaryFutureCall;
import static com.google.net.stubby.stub.ServerCalls.createMethodDefinition;
import static com.google.net.stubby.stub.ServerCalls.asyncUnaryRequestCall;
import static com.google.net.stubby.stub.ServerCalls.asyncStreamingRequestCall;
@javax.annotation.Generated("by gRPC proto compiler")
public class TestServiceGrpc {
private static final com.google.net.stubby.stub.Method<com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty> METHOD_EMPTY_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.UNARY, "EmptyCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.SimpleRequest,
com.google.net.stubby.testing.integration.Messages.SimpleResponse> METHOD_UNARY_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.UNARY, "UnaryCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.SimpleRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.SimpleResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.SERVER_STREAMING, "StreamingOutputCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.CLIENT_STREAMING, "StreamingInputCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
com.google.net.stubby.stub.Method.create(
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
public static TestServiceStub newStub(com.google.net.stubby.Channel channel) {
return new TestServiceStub(channel, CONFIG);
}
public static TestServiceBlockingStub newBlockingStub(
com.google.net.stubby.Channel channel) {
return new TestServiceBlockingStub(channel, CONFIG);
}
public static TestServiceFutureStub newFutureStub(
com.google.net.stubby.Channel channel) {
return new TestServiceFutureStub(channel, CONFIG);
}
public static final TestServiceServiceDescriptor CONFIG =
new TestServiceServiceDescriptor();
@javax.annotation.concurrent.Immutable
public static class TestServiceServiceDescriptor extends
com.google.net.stubby.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
public final com.google.net.stubby.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty> emptyCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.SimpleRequest,
com.google.net.stubby.testing.integration.Messages.SimpleResponse> unaryCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> streamingInputCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> fullDuplexCall;
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> halfDuplexCall;
private TestServiceServiceDescriptor() {
emptyCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_EMPTY_CALL);
unaryCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_UNARY_CALL);
streamingOutputCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_STREAMING_OUTPUT_CALL);
streamingInputCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_STREAMING_INPUT_CALL);
fullDuplexCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_FULL_DUPLEX_CALL);
halfDuplexCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_HALF_DUPLEX_CALL);
}
private TestServiceServiceDescriptor(
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
emptyCall = (com.google.net.stubby.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty>) methodMap.get(
CONFIG.emptyCall.getName());
unaryCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.SimpleRequest,
com.google.net.stubby.testing.integration.Messages.SimpleResponse>) methodMap.get(
CONFIG.unaryCall.getName());
streamingOutputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
CONFIG.streamingOutputCall.getName());
streamingInputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse>) methodMap.get(
CONFIG.streamingInputCall.getName());
fullDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
CONFIG.fullDuplexCall.getName());
halfDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
CONFIG.halfDuplexCall.getName());
}
@java.lang.Override
protected TestServiceServiceDescriptor build(
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
return new TestServiceServiceDescriptor(methodMap);
}
@java.lang.Override
public com.google.common.collect.ImmutableList<com.google.net.stubby.MethodDescriptor<?, ?>> methods() {
return com.google.common.collect.ImmutableList.<com.google.net.stubby.MethodDescriptor<?, ?>>of(
emptyCall,
unaryCall,
streamingOutputCall,
streamingInputCall,
fullDuplexCall,
halfDuplexCall);
}
}
public static interface TestService {
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
com.google.net.stubby.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver);
public void unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.SimpleResponse> responseObserver);
public void streamingOutputCall(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> responseObserver);
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
}
public static interface TestServiceBlockingClient {
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request);
public com.google.net.stubby.testing.integration.Messages.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request);
public java.util.Iterator<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request);
}
public static interface TestServiceFutureClient {
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
com.google.protobuf.EmptyProtos.Empty request);
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Messages.SimpleResponse> unaryCall(
com.google.net.stubby.testing.integration.Messages.SimpleRequest request);
}
public static class TestServiceStub extends
com.google.net.stubby.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
implements TestService {
private TestServiceStub(com.google.net.stubby.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceStub build(com.google.net.stubby.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceStub(channel, config);
}
@java.lang.Override
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
com.google.net.stubby.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
asyncUnaryCall(
channel.newCall(config.emptyCall), request, responseObserver);
}
@java.lang.Override
public void unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.SimpleResponse> responseObserver) {
asyncUnaryCall(
channel.newCall(config.unaryCall), request, responseObserver);
}
@java.lang.Override
public void streamingOutputCall(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
asyncServerStreamingCall(
channel.newCall(config.streamingOutputCall), request, responseObserver);
}
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
return asyncClientStreamingCall(
channel.newCall(config.streamingInputCall), responseObserver);
}
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return duplexStreamingCall(
channel.newCall(config.fullDuplexCall), responseObserver);
}
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return duplexStreamingCall(
channel.newCall(config.halfDuplexCall), responseObserver);
}
}
public static class TestServiceBlockingStub extends
com.google.net.stubby.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
implements TestServiceBlockingClient {
private TestServiceBlockingStub(com.google.net.stubby.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceBlockingStub build(com.google.net.stubby.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceBlockingStub(channel, config);
}
@java.lang.Override
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request) {
return blockingUnaryCall(
channel.newCall(config.emptyCall), request);
}
@java.lang.Override
public com.google.net.stubby.testing.integration.Messages.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request) {
return blockingUnaryCall(
channel.newCall(config.unaryCall), request);
}
@java.lang.Override
public java.util.Iterator<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
channel.newCall(config.streamingOutputCall), request);
}
}
public static class TestServiceFutureStub extends
com.google.net.stubby.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
implements TestServiceFutureClient {
private TestServiceFutureStub(com.google.net.stubby.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceFutureStub build(com.google.net.stubby.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceFutureStub(channel, config);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
com.google.protobuf.EmptyProtos.Empty request) {
return unaryFutureCall(
channel.newCall(config.emptyCall), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Messages.SimpleResponse> unaryCall(
com.google.net.stubby.testing.integration.Messages.SimpleRequest request) {
return unaryFutureCall(
channel.newCall(config.unaryCall), request);
}
}
public static com.google.net.stubby.ServerServiceDefinition bindService(
final TestService serviceImpl) {
return com.google.net.stubby.ServerServiceDefinition.builder("grpc.testing.TestService")
.addMethod(createMethodDefinition(
METHOD_EMPTY_CALL,
asyncUnaryRequestCall(
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty>() {
@java.lang.Override
public void invoke(
com.google.protobuf.EmptyProtos.Empty request,
com.google.net.stubby.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
serviceImpl.emptyCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_UNARY_CALL,
asyncUnaryRequestCall(
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
com.google.net.stubby.testing.integration.Messages.SimpleRequest,
com.google.net.stubby.testing.integration.Messages.SimpleResponse>() {
@java.lang.Override
public void invoke(
com.google.net.stubby.testing.integration.Messages.SimpleRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.SimpleResponse> responseObserver) {
serviceImpl.unaryCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_STREAMING_OUTPUT_CALL,
asyncUnaryRequestCall(
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>() {
@java.lang.Override
public void invoke(
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request,
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
serviceImpl.streamingOutputCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_STREAMING_INPUT_CALL,
asyncStreamingRequestCall(
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse>() {
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest> invoke(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
return serviceImpl.streamingInputCall(responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_FULL_DUPLEX_CALL,
asyncStreamingRequestCall(
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>() {
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> invoke(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return serviceImpl.fullDuplexCall(responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_HALF_DUPLEX_CALL,
asyncStreamingRequestCall(
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>() {
@java.lang.Override
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> invoke(
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return serviceImpl.halfDuplexCall(responseObserver);
}
}))).build();
}
}

View File

@ -29,10 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import static com.google.net.stubby.testing.integration.Messages.PayloadType.COMPRESSABLE;
import static com.google.net.stubby.testing.integration.Util.assertEquals;
import static io.grpc.testing.integration.Messages.PayloadType.COMPRESSABLE;
import static io.grpc.testing.integration.Util.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.timeout;
@ -41,30 +41,31 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import com.google.common.util.concurrent.SettableFuture;
import com.google.common.util.concurrent.Uninterruptibles;
import com.google.net.stubby.AbstractServerBuilder;
import com.google.net.stubby.Call;
import com.google.net.stubby.ChannelImpl;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.ServerImpl;
import com.google.net.stubby.ServerInterceptors;
import com.google.net.stubby.Status;
import com.google.net.stubby.proto.ProtoUtils;
import com.google.net.stubby.stub.MetadataUtils;
import com.google.net.stubby.stub.StreamObserver;
import com.google.net.stubby.stub.StreamRecorder;
import com.google.net.stubby.testing.TestUtils;
import com.google.net.stubby.testing.integration.Messages.Payload;
import com.google.net.stubby.testing.integration.Messages.PayloadType;
import com.google.net.stubby.testing.integration.Messages.ResponseParameters;
import com.google.net.stubby.testing.integration.Messages.SimpleRequest;
import com.google.net.stubby.testing.integration.Messages.SimpleResponse;
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest;
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse;
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest;
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse;
import com.google.protobuf.ByteString;
import com.google.protobuf.EmptyProtos.Empty;
import io.grpc.AbstractServerBuilder;
import io.grpc.Call;
import io.grpc.ChannelImpl;
import io.grpc.Metadata;
import io.grpc.ServerImpl;
import io.grpc.ServerInterceptors;
import io.grpc.Status;
import io.grpc.proto.ProtoUtils;
import io.grpc.stub.MetadataUtils;
import io.grpc.stub.StreamObserver;
import io.grpc.stub.StreamRecorder;
import io.grpc.testing.TestUtils;
import io.grpc.testing.integration.Messages.Payload;
import io.grpc.testing.integration.Messages.PayloadType;
import io.grpc.testing.integration.Messages.ResponseParameters;
import io.grpc.testing.integration.Messages.SimpleRequest;
import io.grpc.testing.integration.Messages.SimpleResponse;
import io.grpc.testing.integration.Messages.StreamingInputCallRequest;
import io.grpc.testing.integration.Messages.StreamingInputCallResponse;
import io.grpc.testing.integration.Messages.StreamingOutputCallRequest;
import io.grpc.testing.integration.Messages.StreamingOutputCallResponse;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;

View File

@ -29,13 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
import com.google.net.stubby.ChannelImpl;
import com.google.net.stubby.transport.netty.NegotiationType;
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
import com.google.net.stubby.transport.okhttp.OkHttpChannelBuilder;
package io.grpc.testing.integration;
import io.grpc.ChannelImpl;
import io.grpc.transport.netty.NegotiationType;
import io.grpc.transport.netty.NettyChannelBuilder;
import io.grpc.transport.okhttp.OkHttpChannelBuilder;
import io.netty.handler.ssl.SslContext;
import java.io.File;

View File

@ -0,0 +1,382 @@
package io.grpc.testing.integration;
import static io.grpc.stub.Calls.asyncClientStreamingCall;
import static io.grpc.stub.Calls.asyncServerStreamingCall;
import static io.grpc.stub.Calls.asyncUnaryCall;
import static io.grpc.stub.Calls.blockingServerStreamingCall;
import static io.grpc.stub.Calls.blockingUnaryCall;
import static io.grpc.stub.Calls.createMethodDescriptor;
import static io.grpc.stub.Calls.duplexStreamingCall;
import static io.grpc.stub.Calls.unaryFutureCall;
import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall;
import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall;
import static io.grpc.stub.ServerCalls.createMethodDefinition;
@javax.annotation.Generated("by gRPC proto compiler")
public class TestServiceGrpc {
private static final io.grpc.stub.Method<com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty> METHOD_EMPTY_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.UNARY, "EmptyCall",
io.grpc.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER),
io.grpc.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.SimpleRequest,
io.grpc.testing.integration.Messages.SimpleResponse> METHOD_UNARY_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.UNARY, "UnaryCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.SERVER_STREAMING, "StreamingOutputCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
io.grpc.testing.integration.Messages.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.CLIENT_STREAMING, "StreamingInputCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
io.grpc.stub.Method.create(
io.grpc.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
public static TestServiceStub newStub(io.grpc.Channel channel) {
return new TestServiceStub(channel, CONFIG);
}
public static TestServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new TestServiceBlockingStub(channel, CONFIG);
}
public static TestServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
return new TestServiceFutureStub(channel, CONFIG);
}
public static final TestServiceServiceDescriptor CONFIG =
new TestServiceServiceDescriptor();
@javax.annotation.concurrent.Immutable
public static class TestServiceServiceDescriptor extends
io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
public final io.grpc.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty> emptyCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.SimpleRequest,
io.grpc.testing.integration.Messages.SimpleResponse> unaryCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
io.grpc.testing.integration.Messages.StreamingInputCallResponse> streamingInputCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> fullDuplexCall;
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> halfDuplexCall;
private TestServiceServiceDescriptor() {
emptyCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_EMPTY_CALL);
unaryCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_UNARY_CALL);
streamingOutputCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_STREAMING_OUTPUT_CALL);
streamingInputCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_STREAMING_INPUT_CALL);
fullDuplexCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_FULL_DUPLEX_CALL);
halfDuplexCall = createMethodDescriptor(
"grpc.testing.TestService", METHOD_HALF_DUPLEX_CALL);
}
private TestServiceServiceDescriptor(
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
emptyCall = (io.grpc.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty>) methodMap.get(
CONFIG.emptyCall.getName());
unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.SimpleRequest,
io.grpc.testing.integration.Messages.SimpleResponse>) methodMap.get(
CONFIG.unaryCall.getName());
streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
CONFIG.streamingOutputCall.getName());
streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
io.grpc.testing.integration.Messages.StreamingInputCallResponse>) methodMap.get(
CONFIG.streamingInputCall.getName());
fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
CONFIG.fullDuplexCall.getName());
halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
CONFIG.halfDuplexCall.getName());
}
@java.lang.Override
protected TestServiceServiceDescriptor build(
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
return new TestServiceServiceDescriptor(methodMap);
}
@java.lang.Override
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
emptyCall,
unaryCall,
streamingOutputCall,
streamingInputCall,
fullDuplexCall,
halfDuplexCall);
}
}
public static interface TestService {
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
io.grpc.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver);
public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver);
public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallResponse> responseObserver);
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
}
public static interface TestServiceBlockingClient {
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request);
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request);
public java.util.Iterator<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
io.grpc.testing.integration.Messages.StreamingOutputCallRequest request);
}
public static interface TestServiceFutureClient {
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
com.google.protobuf.EmptyProtos.Empty request);
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> unaryCall(
io.grpc.testing.integration.Messages.SimpleRequest request);
}
public static class TestServiceStub extends
io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
implements TestService {
private TestServiceStub(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceStub build(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceStub(channel, config);
}
@java.lang.Override
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
io.grpc.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
asyncUnaryCall(
channel.newCall(config.emptyCall), request, responseObserver);
}
@java.lang.Override
public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver) {
asyncUnaryCall(
channel.newCall(config.unaryCall), request, responseObserver);
}
@java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
asyncServerStreamingCall(
channel.newCall(config.streamingOutputCall), request, responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
return asyncClientStreamingCall(
channel.newCall(config.streamingInputCall), responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return duplexStreamingCall(
channel.newCall(config.fullDuplexCall), responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return duplexStreamingCall(
channel.newCall(config.halfDuplexCall), responseObserver);
}
}
public static class TestServiceBlockingStub extends
io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
implements TestServiceBlockingClient {
private TestServiceBlockingStub(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceBlockingStub build(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceBlockingStub(channel, config);
}
@java.lang.Override
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request) {
return blockingUnaryCall(
channel.newCall(config.emptyCall), request);
}
@java.lang.Override
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
return blockingUnaryCall(
channel.newCall(config.unaryCall), request);
}
@java.lang.Override
public java.util.Iterator<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
io.grpc.testing.integration.Messages.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
channel.newCall(config.streamingOutputCall), request);
}
}
public static class TestServiceFutureStub extends
io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
implements TestServiceFutureClient {
private TestServiceFutureStub(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
super(channel, config);
}
@java.lang.Override
protected TestServiceFutureStub build(io.grpc.Channel channel,
TestServiceServiceDescriptor config) {
return new TestServiceFutureStub(channel, config);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
com.google.protobuf.EmptyProtos.Empty request) {
return unaryFutureCall(
channel.newCall(config.emptyCall), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> unaryCall(
io.grpc.testing.integration.Messages.SimpleRequest request) {
return unaryFutureCall(
channel.newCall(config.unaryCall), request);
}
}
public static io.grpc.ServerServiceDefinition bindService(
final TestService serviceImpl) {
return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService")
.addMethod(createMethodDefinition(
METHOD_EMPTY_CALL,
asyncUnaryRequestCall(
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
com.google.protobuf.EmptyProtos.Empty,
com.google.protobuf.EmptyProtos.Empty>() {
@java.lang.Override
public void invoke(
com.google.protobuf.EmptyProtos.Empty request,
io.grpc.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
serviceImpl.emptyCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_UNARY_CALL,
asyncUnaryRequestCall(
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
io.grpc.testing.integration.Messages.SimpleRequest,
io.grpc.testing.integration.Messages.SimpleResponse>() {
@java.lang.Override
public void invoke(
io.grpc.testing.integration.Messages.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver) {
serviceImpl.unaryCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_STREAMING_OUTPUT_CALL,
asyncUnaryRequestCall(
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>() {
@java.lang.Override
public void invoke(
io.grpc.testing.integration.Messages.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
serviceImpl.streamingOutputCall(request, responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_STREAMING_INPUT_CALL,
asyncStreamingRequestCall(
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
io.grpc.testing.integration.Messages.StreamingInputCallRequest,
io.grpc.testing.integration.Messages.StreamingInputCallResponse>() {
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallRequest> invoke(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
return serviceImpl.streamingInputCall(responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_FULL_DUPLEX_CALL,
asyncStreamingRequestCall(
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>() {
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> invoke(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return serviceImpl.fullDuplexCall(responseObserver);
}
})))
.addMethod(createMethodDefinition(
METHOD_HALF_DUPLEX_CALL,
asyncStreamingRequestCall(
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>() {
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> invoke(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
return serviceImpl.halfDuplexCall(responseObserver);
}
}))).build();
}
}

View File

@ -29,22 +29,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import com.google.common.collect.Queues;
import com.google.net.stubby.stub.StreamObserver;
import com.google.net.stubby.testing.integration.Messages.Payload;
import com.google.net.stubby.testing.integration.Messages.PayloadType;
import com.google.net.stubby.testing.integration.Messages.ResponseParameters;
import com.google.net.stubby.testing.integration.Messages.SimpleRequest;
import com.google.net.stubby.testing.integration.Messages.SimpleResponse;
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest;
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse;
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest;
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse;
import com.google.protobuf.ByteString;
import com.google.protobuf.EmptyProtos;
import io.grpc.stub.StreamObserver;
import io.grpc.testing.integration.Messages.Payload;
import io.grpc.testing.integration.Messages.PayloadType;
import io.grpc.testing.integration.Messages.ResponseParameters;
import io.grpc.testing.integration.Messages.SimpleRequest;
import io.grpc.testing.integration.Messages.SimpleResponse;
import io.grpc.testing.integration.Messages.StreamingInputCallRequest;
import io.grpc.testing.integration.Messages.StreamingInputCallResponse;
import io.grpc.testing.integration.Messages.StreamingOutputCallRequest;
import io.grpc.testing.integration.Messages.StreamingOutputCallResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
@ -59,7 +60,7 @@ import java.util.concurrent.TimeUnit;
*/
public class TestServiceImpl implements TestServiceGrpc.TestService {
private static final String UNCOMPRESSABLE_FILE =
"/com/google/net/stubby/testing/integration/testdata/uncompressable.bin";
"/io/grpc/testing/integration/testdata/uncompressable.bin";
private final Random random = new Random();
private final ScheduledExecutorService executor;

View File

@ -29,14 +29,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.net.stubby.ServerImpl;
import com.google.net.stubby.ServerInterceptors;
import com.google.net.stubby.testing.TestUtils;
import com.google.net.stubby.transport.netty.NettyServerBuilder;
import io.grpc.ServerImpl;
import io.grpc.ServerInterceptors;
import io.grpc.testing.TestUtils;
import io.grpc.transport.netty.NettyServerBuilder;
import io.netty.handler.ssl.SslContext;
import java.io.File;

View File

@ -29,12 +29,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import com.google.net.stubby.Metadata;
import com.google.net.stubby.proto.ProtoUtils;
import com.google.protobuf.MessageLite;
import io.grpc.Metadata;
import io.grpc.proto.ProtoUtils;
import org.junit.Assert;
import java.io.IOException;

View File

@ -8,9 +8,9 @@ syntax = "proto2";
package stubby.testing;
import "stubby/testing/integration/message_set.proto";
import "io/grpc/testing/integration/message_set.proto";
option java_package = "com.google.net.stubby.testing.integration";
option java_package = "io.grpc.testing.integration";
// The type of payload that should be returned.
enum PayloadType {

View File

@ -29,14 +29,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.stub;
package io.grpc.stub;
import static org.junit.Assert.assertEquals;
import com.google.net.stubby.Call;
import com.google.net.stubby.Channel;
import com.google.net.stubby.MethodDescriptor;
import com.google.net.stubby.testing.integration.TestServiceGrpc;
import io.grpc.Call;
import io.grpc.Channel;
import io.grpc.MethodDescriptor;
import io.grpc.testing.integration.TestServiceGrpc;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -29,12 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import com.google.net.stubby.ChannelImpl;
import com.google.net.stubby.transport.netty.NegotiationType;
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
import com.google.net.stubby.transport.netty.NettyServerBuilder;
import io.grpc.ChannelImpl;
import io.grpc.transport.netty.NegotiationType;
import io.grpc.transport.netty.NettyChannelBuilder;
import io.grpc.transport.netty.NettyServerBuilder;
import org.junit.AfterClass;
import org.junit.BeforeClass;

View File

@ -29,11 +29,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.google.net.stubby.testing.integration;
package io.grpc.testing.integration;
import com.google.net.stubby.ChannelImpl;
import com.google.net.stubby.transport.netty.NettyServerBuilder;
import com.google.net.stubby.transport.okhttp.OkHttpChannelBuilder;
import io.grpc.ChannelImpl;
import io.grpc.transport.netty.NettyServerBuilder;
import io.grpc.transport.okhttp.OkHttpChannelBuilder;
import org.junit.AfterClass;
import org.junit.BeforeClass;

View File

@ -1,9 +1,9 @@
description = "Stubby: Netty"
description = "gRPC: Netty"
dependencies {
compile project(':stubby-core'),
compile project(':grpc-core'),
libraries.hpack,
libraries.netty
// Tests depend on base class defined by core module.
testCompile project(':stubby-core').sourceSets.test.output
testCompile project(':grpc-core').sourceSets.test.output
}

Some files were not shown because too many files have changed in this diff Show More