use of io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService in project servicetalk by apple.
the class ErrorHandlingTest method setupForBlockingServiceWritesThenThrows.
private ServiceFactory setupForBlockingServiceWritesThenThrows(final Throwable toThrow) throws Exception {
final BlockingTesterService blockingService = mock(BlockingTesterService.class);
setupForBlockingServiceWritesThenThrows(blockingService, toThrow);
return new ServiceFactory(blockingService);
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService in project servicetalk by apple.
the class GrpcRouterConfigurationTest method testCanNotOverrideAlreadyRegisteredPathWithAnotherStrategy.
@Test
void testCanNotOverrideAlreadyRegisteredPathWithAnotherStrategy() {
final TesterService asyncService = DEFAULT_STRATEGY_ASYNC_SERVICE;
testCanNotOverrideAlreadyRegisteredPath(TestRpc.PATH, builder -> builder.test(asyncService).test(offloadNever(), asyncService));
testCanNotOverrideAlreadyRegisteredPath(TestBiDiStreamRpc.PATH, builder -> builder.testBiDiStream(asyncService).testBiDiStream(offloadNever(), asyncService));
testCanNotOverrideAlreadyRegisteredPath(TestResponseStreamRpc.PATH, builder -> builder.testResponseStream(asyncService).testResponseStream(offloadNever(), asyncService));
testCanNotOverrideAlreadyRegisteredPath(TestRequestStreamRpc.PATH, builder -> builder.testRequestStream(asyncService).testRequestStream(offloadNever(), asyncService));
final BlockingTesterService blockingService = DEFAULT_STRATEGY_BLOCKING_SERVICE;
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRpc.PATH, builder -> builder.testBlocking(blockingService).testBlocking(offloadNever(), blockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestBiDiStreamRpc.PATH, builder -> builder.testBiDiStreamBlocking(blockingService).testBiDiStreamBlocking(offloadNever(), blockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestResponseStreamRpc.PATH, builder -> builder.testResponseStreamBlocking(blockingService).testResponseStreamBlocking(offloadNever(), blockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRequestStreamRpc.PATH, builder -> builder.testRequestStreamBlocking(blockingService).testRequestStreamBlocking(offloadNever(), blockingService));
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService in project servicetalk by apple.
the class GrpcRouterConfigurationTest method testCanNotOverrideAlreadyRegisteredPath.
@Test
void testCanNotOverrideAlreadyRegisteredPath() {
final TesterService asyncService = DEFAULT_STRATEGY_ASYNC_SERVICE;
final TesterService alternativeAsyncService = CLASS_NO_OFFLOADS_STRATEGY_ASYNC_SERVICE;
testCanNotOverrideAlreadyRegisteredPath(TestRpc.PATH, builder -> builder.test(asyncService).test(alternativeAsyncService));
testCanNotOverrideAlreadyRegisteredPath(TestBiDiStreamRpc.PATH, builder -> builder.testBiDiStream(asyncService).testBiDiStream(alternativeAsyncService));
testCanNotOverrideAlreadyRegisteredPath(TestResponseStreamRpc.PATH, builder -> builder.testResponseStream(asyncService).testResponseStream(alternativeAsyncService));
testCanNotOverrideAlreadyRegisteredPath(TestRequestStreamRpc.PATH, builder -> builder.testRequestStream(asyncService).testRequestStream(alternativeAsyncService));
final BlockingTesterService blockingService = DEFAULT_STRATEGY_BLOCKING_SERVICE;
final BlockingTesterService alternativeBlockingService = CLASS_NO_OFFLOADS_STRATEGY_BLOCKING_SERVICE;
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRpc.PATH, builder -> builder.testBlocking(blockingService).testBlocking(alternativeBlockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestBiDiStreamRpc.PATH, builder -> builder.testBiDiStreamBlocking(blockingService).testBiDiStreamBlocking(alternativeBlockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestResponseStreamRpc.PATH, builder -> builder.testResponseStreamBlocking(blockingService).testResponseStreamBlocking(alternativeBlockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRequestStreamRpc.PATH, builder -> builder.testRequestStreamBlocking(blockingService).testRequestStreamBlocking(alternativeBlockingService));
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService in project servicetalk by apple.
the class GrpcRouterConfigurationTest method testCanNotOverrideAlreadyRegisteredPathWithAnotherApi.
@Test
void testCanNotOverrideAlreadyRegisteredPathWithAnotherApi() {
final TesterService asyncService = DEFAULT_STRATEGY_ASYNC_SERVICE;
final BlockingTesterService blockingService = DEFAULT_STRATEGY_BLOCKING_SERVICE;
// Test registering of async RPC then blocking RPC for the same path:
testCanNotOverrideAlreadyRegisteredPath(TestRpc.PATH, builder -> builder.test(asyncService).testBlocking(blockingService));
testCanNotOverrideAlreadyRegisteredPath(TestBiDiStreamRpc.PATH, builder -> builder.testBiDiStream(asyncService).testBiDiStreamBlocking(blockingService));
testCanNotOverrideAlreadyRegisteredPath(TestResponseStreamRpc.PATH, builder -> builder.testResponseStream(asyncService).testResponseStreamBlocking(blockingService));
testCanNotOverrideAlreadyRegisteredPath(TestRequestStreamRpc.PATH, builder -> builder.testRequestStream(asyncService).testRequestStreamBlocking(blockingService));
// Test registering of blocking RPC then async RPC for the same path:
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRpc.PATH, builder -> builder.testBlocking(blockingService).test(asyncService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestBiDiStreamRpc.PATH, builder -> builder.testBiDiStreamBlocking(blockingService).testBiDiStream(asyncService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestResponseStreamRpc.PATH, builder -> builder.testResponseStreamBlocking(blockingService).testResponseStream(asyncService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRequestStreamRpc.PATH, builder -> builder.testRequestStreamBlocking(blockingService).testRequestStream(asyncService));
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTesterService 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);
}
Aggregations