Search in sources :

Example 21 with CompatClient

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

the class ProtocolCompatibilityTest method serviceTalkToGrpcJavaClientTimeout.

@ParameterizedTest
@MethodSource("sslStreamingAndCompressionParams")
void serviceTalkToGrpcJavaClientTimeout(final boolean ssl, final boolean streaming, final String compression) throws Exception {
    final TestServerContext server = grpcJavaServer(ErrorMode.NONE, ssl, compression);
    try (ServerContext proxyCtx = buildTimeoutProxy(server.listenAddress(), null, ssl)) {
        final CompatClient client = serviceTalkClient(proxyCtx.listenAddress(), ssl, compression, DEFAULT_DEADLINE);
        testGrpcError(client, server, false, streaming, compression, DEADLINE_EXCEEDED, null);
    }
}
Also used : ServerContext(io.servicetalk.transport.api.ServerContext) 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 22 with CompatClient

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

the class ProtocolCompatibilityTest method serviceTalkToGrpcJavaCompressionError.

@ParameterizedTest
@MethodSource("sslAndStreamingParams")
void serviceTalkToGrpcJavaCompressionError(final boolean ssl, final boolean streaming) throws Exception {
    final String clientCompression = "gzip";
    final TestServerContext server = grpcJavaServer(ErrorMode.NONE, ssl, null);
    final CompatClient client = serviceTalkClient(server.listenAddress(), ssl, clientCompression, 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 23 with CompatClient

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

the class ProtocolCompatibilityTest method grpcJavaToServiceTalkClientTimeout.

@ParameterizedTest
@MethodSource("sslStreamingAndCompressionParams")
void grpcJavaToServiceTalkClientTimeout(final boolean ssl, final boolean streaming, final String compression) throws Exception {
    final TestServerContext server = serviceTalkServer(ErrorMode.NONE, ssl, compression, null);
    try (ServerContext proxyCtx = buildTimeoutProxy(server.listenAddress(), null, ssl)) {
        final CompatClient client = grpcJavaClient(proxyCtx.listenAddress(), compression, ssl, DEFAULT_DEADLINE);
        testGrpcError(client, server, false, streaming, compression, DEADLINE_EXCEEDED, null);
    }
}
Also used : ServerContext(io.servicetalk.transport.api.ServerContext) 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 24 with CompatClient

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

the class ProtocolCompatibilityTest method serviceTalkToGrpcJavaError.

@ParameterizedTest
@MethodSource("sslStreamingAndCompressionParams")
void serviceTalkToGrpcJavaError(final boolean ssl, final boolean streaming, final String compression) throws Exception {
    final TestServerContext server = grpcJavaServer(ErrorMode.SIMPLE, ssl, compression);
    final CompatClient client = serviceTalkClient(server.listenAddress(), ssl, compression, null);
    testGrpcError(client, server, false, 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 25 with CompatClient

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

the class ProtocolCompatibilityTest method grpcJavaToServiceTalkBlockingError.

@ParameterizedTest
@MethodSource("sslStreamingAndCompressionParams")
void grpcJavaToServiceTalkBlockingError(final boolean ssl, final boolean streaming, final String compression) throws Exception {
    final TestServerContext server = serviceTalkServerBlocking(ErrorMode.SIMPLE, ssl, compression);
    final CompatClient client = grpcJavaClient(server.listenAddress(), compression, ssl, null);
    testGrpcError(client, server, false, 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)

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