Search in sources :

Example 1 with BlockingTestResponseStreamRpc

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

the class ClosureTest method mixedModeRpcMethodsAreClosed.

@ParameterizedTest(name = "graceful? => {0}")
@ValueSource(booleans = { true, false })
void mixedModeRpcMethodsAreClosed(final boolean param) throws Exception {
    setUp(param);
    CloseSignal signal = new CloseSignal(4);
    TestRpc testRpc = setupCloseMock(mock(TestRpc.class), signal);
    TestRequestStreamRpc testRequestStreamRpc = setupCloseMock(mock(TestRequestStreamRpc.class), signal);
    BlockingTestResponseStreamRpc testResponseStreamRpc = setupBlockingCloseMock(mock(BlockingTestResponseStreamRpc.class), signal);
    BlockingTestBiDiStreamRpc testBiDiStreamRpc = setupBlockingCloseMock(mock(BlockingTestBiDiStreamRpc.class), signal);
    startServerAndClose(new ServiceFactory.Builder().test(testRpc).testRequestStream(testRequestStreamRpc).testResponseStreamBlocking(testResponseStreamRpc).testBiDiStreamBlocking(testBiDiStreamRpc).build(), signal);
    verifyClosure(testRpc);
    verifyClosure(testRequestStreamRpc);
    verifyClosure(testResponseStreamRpc);
    verifyClosure(testBiDiStreamRpc);
    signal.verifyClose(closeGracefully);
}
Also used : TestRequestStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.TestRequestStreamRpc) BlockingTestRequestStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestRequestStreamRpc) BlockingTestResponseStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestResponseStreamRpc) BlockingTestBiDiStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestBiDiStreamRpc) BlockingTestRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestRpc) TestRpc(io.servicetalk.grpc.netty.TesterProto.Tester.TestRpc) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with BlockingTestResponseStreamRpc

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

the class ClosureTest method blockingRpcMethodsAreClosed.

@ParameterizedTest(name = "graceful? => {0}")
@ValueSource(booleans = { true, false })
void blockingRpcMethodsAreClosed(final boolean param) throws Exception {
    setUp(param);
    CloseSignal signal = new CloseSignal(4);
    BlockingTestRpc testRpc = setupBlockingCloseMock(mock(BlockingTestRpc.class), signal);
    BlockingTestRequestStreamRpc testRequestStreamRpc = setupBlockingCloseMock(mock(BlockingTestRequestStreamRpc.class), signal);
    BlockingTestResponseStreamRpc testResponseStreamRpc = setupBlockingCloseMock(mock(BlockingTestResponseStreamRpc.class), signal);
    BlockingTestBiDiStreamRpc testBiDiStreamRpc = setupBlockingCloseMock(mock(BlockingTestBiDiStreamRpc.class), signal);
    startServerAndClose(new ServiceFactory.Builder().testBlocking(testRpc).testRequestStreamBlocking(testRequestStreamRpc).testResponseStreamBlocking(testResponseStreamRpc).testBiDiStreamBlocking(testBiDiStreamRpc).build(), signal);
    verifyClosure(testRpc);
    verifyClosure(testRequestStreamRpc);
    verifyClosure(testResponseStreamRpc);
    verifyClosure(testBiDiStreamRpc);
    signal.verifyClose(closeGracefully);
}
Also used : BlockingTestRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestRpc) BlockingTestResponseStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestResponseStreamRpc) BlockingTestBiDiStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestBiDiStreamRpc) BlockingTestRequestStreamRpc(io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestRequestStreamRpc) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

BlockingTestBiDiStreamRpc (io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestBiDiStreamRpc)2 BlockingTestRequestStreamRpc (io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestRequestStreamRpc)2 BlockingTestResponseStreamRpc (io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestResponseStreamRpc)2 BlockingTestRpc (io.servicetalk.grpc.netty.TesterProto.Tester.BlockingTestRpc)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 ValueSource (org.junit.jupiter.params.provider.ValueSource)2 TestRequestStreamRpc (io.servicetalk.grpc.netty.TesterProto.Tester.TestRequestStreamRpc)1 TestRpc (io.servicetalk.grpc.netty.TesterProto.Tester.TestRpc)1