Search in sources :

Example 1 with StreamingInputCallRequest

use of io.grpc.android.integrationtest.nano.Messages.StreamingInputCallRequest in project grpc-java by grpc.

the class InteropTester method cancelAfterBegin.

public void cancelAfterBegin() throws Exception {
    StreamRecorder<StreamingInputCallResponse> responseObserver = StreamRecorder.create();
    StreamObserver<StreamingInputCallRequest> requestObserver = asyncStub.streamingInputCall(responseObserver);
    requestObserver.onError(new RuntimeException());
    assertTrue(responseObserver.awaitCompletion(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS));
    assertEquals(Arrays.<StreamingInputCallResponse>asList(), responseObserver.getValues());
    assertCodeEquals(io.grpc.Status.CANCELLED, io.grpc.Status.fromThrowable(responseObserver.getError()));
}
Also used : StreamingInputCallRequest(io.grpc.android.integrationtest.nano.Messages.StreamingInputCallRequest) StatusRuntimeException(io.grpc.StatusRuntimeException) StreamingInputCallResponse(io.grpc.android.integrationtest.nano.Messages.StreamingInputCallResponse)

Aggregations

StatusRuntimeException (io.grpc.StatusRuntimeException)1 StreamingInputCallRequest (io.grpc.android.integrationtest.nano.Messages.StreamingInputCallRequest)1 StreamingInputCallResponse (io.grpc.android.integrationtest.nano.Messages.StreamingInputCallResponse)1