Search in sources :

Example 31 with CompatClient

use of io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient in project servicetalk by apple.

the class ProtocolCompatibilityTest method serviceTalkToGrpcJavaErrorWithStatus.

@ParameterizedTest
@MethodSource("sslStreamingAndCompressionParams")
void serviceTalkToGrpcJavaErrorWithStatus(final boolean ssl, final boolean streaming, final String compression) throws Exception {
    final TestServerContext server = grpcJavaServer(ErrorMode.STATUS, ssl, compression);
    final CompatClient client = serviceTalkClient(server.listenAddress(), ssl, compression, null);
    testGrpcError(client, server, true, streaming, compression);
}
Also used : BlockingCompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.BlockingCompatClient) CompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 32 with CompatClient

use of io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient in project servicetalk by apple.

the class ProtocolCompatibilityTest method grpcJavaToServiceTalkBlocking.

@ParameterizedTest
@MethodSource("sslStreamingAndCompressionParams")
void grpcJavaToServiceTalkBlocking(final boolean ssl, final boolean streaming, final String compression) throws Exception {
    final TestServerContext server = serviceTalkServerBlocking(ErrorMode.NONE, ssl, compression);
    final CompatClient client = grpcJavaClient(server.listenAddress(), compression, ssl, null);
    testRequestResponse(client, server, streaming, compression);
}
Also used : BlockingCompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.BlockingCompatClient) CompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 33 with CompatClient

use of io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient in project servicetalk by apple.

the class ProtocolCompatibilityTest method grpcJavaToServiceTalkErrorInStreamingResponse.

@ParameterizedTest
@MethodSource("sslAndCompressionParams")
void grpcJavaToServiceTalkErrorInStreamingResponse(final boolean ssl, final String compression) throws Exception {
    final TestServerContext server = serviceTalkServer(ErrorMode.SIMPLE_IN_RESPONSE, ssl, compression, null);
    final CompatClient client = grpcJavaClient(server.listenAddress(), compression, ssl, null);
    testStreamResetOnUnexpectedErrorOnServiceTalkServer(client, server);
}
Also used : BlockingCompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.BlockingCompatClient) CompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 34 with CompatClient

use of io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient in project servicetalk by apple.

the class ProtocolCompatibilityTest method grpcJavaToGrpcJavaCompressionError.

@ParameterizedTest
@MethodSource("sslAndStreamingParams")
void grpcJavaToGrpcJavaCompressionError(final boolean ssl, final boolean streaming) throws Exception {
    final String clientCompression = "gzip";
    final TestServerContext server = grpcJavaServer(ErrorMode.NONE, ssl, null);
    final CompatClient client = grpcJavaClient(server.listenAddress(), clientCompression, ssl, null);
    testGrpcError(client, server, false, streaming, clientCompression, GrpcStatusCode.UNIMPLEMENTED, null);
}
Also used : BlockingCompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.BlockingCompatClient) CompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 35 with CompatClient

use of io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient in project servicetalk by apple.

the class ProtocolCompatibilityTest method grpcJavaToServiceTalkErrorWithStatusInStreamingResponse.

@ParameterizedTest
@MethodSource("sslAndCompressionParams")
void grpcJavaToServiceTalkErrorWithStatusInStreamingResponse(final boolean ssl, final String compression) throws Exception {
    final TestServerContext server = serviceTalkServer(ErrorMode.STATUS_IN_RESPONSE, ssl, compression, null);
    final CompatClient client = grpcJavaClient(server.listenAddress(), compression, ssl, null);
    testStreamResetOnUnexpectedErrorOnServiceTalkServer(client, server);
}
Also used : BlockingCompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.BlockingCompatClient) CompatClient(io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

BlockingCompatClient (io.servicetalk.grpc.netty.CompatProto.Compat.BlockingCompatClient)35 CompatClient (io.servicetalk.grpc.netty.CompatProto.Compat.CompatClient)35 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)34 MethodSource (org.junit.jupiter.params.provider.MethodSource)33 ServerContext (io.servicetalk.transport.api.ServerContext)5 PublisherSource (io.servicetalk.concurrent.PublisherSource)2 CompatRequest (io.servicetalk.grpc.netty.CompatProto.RequestContainer.CompatRequest)2 ManagedChannel (io.grpc.ManagedChannel)1 NettyChannelBuilder (io.grpc.netty.NettyChannelBuilder)1 StreamObserver (io.grpc.stub.StreamObserver)1 SslContext (io.netty.handler.ssl.SslContext)1 Processor (io.servicetalk.concurrent.SingleSource.Processor)1 Processors.newPublisherProcessor (io.servicetalk.concurrent.api.Processors.newPublisherProcessor)1 Processors.newSingleProcessor (io.servicetalk.concurrent.api.Processors.newSingleProcessor)1 Publisher (io.servicetalk.concurrent.api.Publisher)1 Single (io.servicetalk.concurrent.api.Single)1 DefaultGrpcClientMetadata (io.servicetalk.grpc.api.DefaultGrpcClientMetadata)1 GrpcClientMetadata (io.servicetalk.grpc.api.GrpcClientMetadata)1 BidirectionalStreamingCallMetadata (io.servicetalk.grpc.netty.CompatProto.Compat.BidirectionalStreamingCallMetadata)1 ClientStreamingCallMetadata (io.servicetalk.grpc.netty.CompatProto.Compat.ClientStreamingCallMetadata)1