Package io.grpc.testing
Class StreamRecorder<T>
- java.lang.Object
-
- io.grpc.testing.StreamRecorder<T>
-
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<T>
@Deprecated @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1791") public class StreamRecorder<T> extends java.lang.Object implements io.grpc.stub.StreamObserver<T>Deprecated.Not for public useUtility implementation ofStreamObserverused in testing. Records all the observed values produced by the stream as well as any errors.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidawaitCompletion()Deprecated.Waits for the stream to terminate.booleanawaitCompletion(int timeout, java.util.concurrent.TimeUnit unit)Deprecated.Waits a fixed timeout for the stream to terminate.static <T> StreamRecorder<T>create()Deprecated.Creates a new recorder.com.google.common.util.concurrent.ListenableFuture<T>firstValue()Deprecated.Returns aListenableFuturefor the first value received from the stream.java.lang.ThrowablegetError()Deprecated.Returns the stream terminating error.java.util.List<T>getValues()Deprecated.Returns the current set of received values.voidonCompleted()Deprecated.voidonError(java.lang.Throwable t)Deprecated.voidonNext(T value)Deprecated.
-
-
-
Method Detail
-
create
public static <T> StreamRecorder<T> create()
Deprecated.Creates a new recorder.
-
onNext
public void onNext(T value)
Deprecated.- Specified by:
onNextin interfaceio.grpc.stub.StreamObserver<T>
-
onError
public void onError(java.lang.Throwable t)
Deprecated.- Specified by:
onErrorin interfaceio.grpc.stub.StreamObserver<T>
-
onCompleted
public void onCompleted()
Deprecated.- Specified by:
onCompletedin interfaceio.grpc.stub.StreamObserver<T>
-
awaitCompletion
public void awaitCompletion() throws java.lang.ExceptionDeprecated.Waits for the stream to terminate.- Throws:
java.lang.Exception
-
awaitCompletion
public boolean awaitCompletion(int timeout, java.util.concurrent.TimeUnit unit) throws java.lang.ExceptionDeprecated.Waits a fixed timeout for the stream to terminate.- Throws:
java.lang.Exception
-
getValues
public java.util.List<T> getValues()
Deprecated.Returns the current set of received values.
-
getError
@Nullable public java.lang.Throwable getError()
Deprecated.Returns the stream terminating error.
-
firstValue
public com.google.common.util.concurrent.ListenableFuture<T> firstValue()
Deprecated.Returns aListenableFuturefor the first value received from the stream. Useful for testing unary call patterns.
-
-