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 ofStreamObserver
used in testing. Records all the observed values produced by the stream as well as any errors.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
StreamRecorder()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
awaitCompletion()
Deprecated.Waits for the stream to terminate.boolean
awaitCompletion(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 aListenableFuture
for the first value received from the stream.java.lang.Throwable
getError()
Deprecated.Returns the stream terminating error.java.util.List<T>
getValues()
Deprecated.Returns the current set of received values.void
onCompleted()
Deprecated.void
onError(java.lang.Throwable t)
Deprecated.void
onNext(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:
onNext
in interfaceio.grpc.stub.StreamObserver<T>
-
onError
public void onError(java.lang.Throwable t)
Deprecated.- Specified by:
onError
in interfaceio.grpc.stub.StreamObserver<T>
-
onCompleted
public void onCompleted()
Deprecated.- Specified by:
onCompleted
in interfaceio.grpc.stub.StreamObserver<T>
-
awaitCompletion
public void awaitCompletion() throws java.lang.Exception
Deprecated.Waits for the stream to terminate.- Throws:
java.lang.Exception
-
awaitCompletion
public boolean awaitCompletion(int timeout, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
Deprecated.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 aListenableFuture
for the first value received from the stream. Useful for testing unary call patterns.
-
-