Search in sources :

Example 11 with ServiceFactory

use of io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory in project servicetalk by apple.

the class ClosureTest method blockingServiceImplIsClosed.

@ParameterizedTest(name = "graceful? => {0}")
@ValueSource(booleans = { true, false })
void blockingServiceImplIsClosed(final boolean param) throws Exception {
    setUp(param);
    CloseSignal signal = new CloseSignal(1);
    BlockingTesterService svc = setupBlockingCloseMock(mock(BlockingTesterService.class), signal);
    startServerAndClose(new ServiceFactory(svc), signal);
    verifyClosure(svc, 4);
    signal.verifyCloseAtLeastCount(closeGracefully);
}
Also used : BlockingTesterService(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService) ServiceFactory(io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 12 with ServiceFactory

use of io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory in project servicetalk by apple.

the class ErrorHandlingTest method setupForServiceThrows.

private ServiceFactory setupForServiceThrows(final Throwable toThrow) {
    final TesterService service = mockTesterService();
    setupForServiceThrows(service, toThrow);
    return new ServiceFactory(service);
}
Also used : ServiceFactory(io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory) TesterService(io.servicetalk.grpc.netty.TesterProto.Tester.TesterService) BlockingTesterService(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService)

Example 13 with ServiceFactory

use of io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory in project servicetalk by apple.

the class ErrorHandlingTest method setupForServiceEmitsDataThenError.

private ServiceFactory setupForServiceEmitsDataThenError(final Throwable toThrow) {
    final TesterService service = mockTesterService();
    setupForServiceEmitsDataThenError(service, toThrow);
    return new ServiceFactory(service);
}
Also used : ServiceFactory(io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory) TesterService(io.servicetalk.grpc.netty.TesterProto.Tester.TesterService) BlockingTesterService(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService)

Example 14 with ServiceFactory

use of io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory in project servicetalk by apple.

the class ErrorHandlingTest method setupForBlockingServiceThrows.

private ServiceFactory setupForBlockingServiceThrows(final Throwable toThrow) throws Exception {
    final BlockingTesterService blockingService = mock(BlockingTesterService.class);
    setupForBlockingServiceThrows(blockingService, toThrow);
    return new ServiceFactory(blockingService);
}
Also used : BlockingTesterService(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService) ServiceFactory(io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory)

Aggregations

ServiceFactory (io.servicetalk.grpc.netty.TesterProto.Tester.ServiceFactory)14 BlockingTesterService (io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService)10 TesterService (io.servicetalk.grpc.netty.TesterProto.Tester.TesterService)7 ClientFactory (io.servicetalk.grpc.netty.TesterProto.Tester.ClientFactory)5 HostAndPort (io.servicetalk.transport.api.HostAndPort)3 AddressUtils.serverHostAndPort (io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort)3 InetSocketAddress (java.net.InetSocketAddress)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 GrpcServerBuilder (io.servicetalk.grpc.api.GrpcServerBuilder)2 TestRequest (io.servicetalk.grpc.netty.TesterProto.TestRequest)2 BlockingIterable (io.servicetalk.concurrent.BlockingIterable)1 Publisher (io.servicetalk.concurrent.api.Publisher)1 Publisher.from (io.servicetalk.concurrent.api.Publisher.from)1 Publisher.fromIterable (io.servicetalk.concurrent.api.Publisher.fromIterable)1 Single (io.servicetalk.concurrent.api.Single)1 Single.defer (io.servicetalk.concurrent.api.Single.defer)1 GrpcClientBuilder (io.servicetalk.grpc.api.GrpcClientBuilder)1 GrpcPayloadWriter (io.servicetalk.grpc.api.GrpcPayloadWriter)1 GrpcServiceContext (io.servicetalk.grpc.api.GrpcServiceContext)1 INVALID_ARGUMENT (io.servicetalk.grpc.api.GrpcStatusCode.INVALID_ARGUMENT)1