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 Object
implements io.grpc.stub.StreamObserver<T>
Deprecated.
Not for public use
Utility implementation of
StreamObserver
used in testing. Records all the observed
values produced by the stream as well as any errors.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Throwable
Deprecated.private final com.google.common.util.concurrent.SettableFuture
<T> Deprecated.private final CountDownLatch
Deprecated.Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Waits for the stream to terminate.boolean
awaitCompletion
(int timeout, 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> Deprecated.Returns aListenableFuture
for the first value received from the stream.getError()
Deprecated.Returns the stream terminating error.Deprecated.Returns the current set of received values.void
Deprecated.void
Deprecated.void
Deprecated.
-
Field Details
-
latch
Deprecated. -
results
Deprecated. -
error
Deprecated. -
firstValue
Deprecated.
-
-
Constructor Details
-
StreamRecorder
private StreamRecorder()Deprecated.
-
-
Method Details
-
create
Deprecated.Creates a new recorder. -
onNext
Deprecated.- Specified by:
onNext
in interfaceio.grpc.stub.StreamObserver<T>
-
onError
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
Deprecated.Waits for the stream to terminate.- Throws:
Exception
-
awaitCompletion
Deprecated.Waits a fixed timeout for the stream to terminate.- Throws:
Exception
-
getValues
Deprecated.Returns the current set of received values. -
getError
Deprecated.Returns the stream terminating error. -
firstValue
Deprecated.Returns aListenableFuture
for the first value received from the stream. Useful for testing unary call patterns.
-