class ManualProbe[I] extends Subscriber[I]
Implementation of org.reactivestreams.Subscriber that allows various assertions.
All timeouts are dilated automatically, for more details about time dilation refer to akka.testkit.TestKit.
- Source
- StreamTestKit.scala
- Alphabetic
- By Inheritance
- ManualProbe
- Subscriber
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
- abstract type Self <: ManualProbe[I]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to any2stringadd[ManualProbe[I]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (ManualProbe[I], B)
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to ArrowAssoc[ManualProbe[I]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
ensuring(cond: (ManualProbe[I]) ⇒ Boolean, msg: ⇒ Any): ManualProbe[I]
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to Ensuring[ManualProbe[I]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (ManualProbe[I]) ⇒ Boolean): ManualProbe[I]
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to Ensuring[ManualProbe[I]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): ManualProbe[I]
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to Ensuring[ManualProbe[I]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): ManualProbe[I]
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to Ensuring[ManualProbe[I]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
expectComplete(): Self
Fluent DSL
Fluent DSL
Expect completion.
-
def
expectError(cause: Throwable): Self
Fluent DSL
Fluent DSL
Expect given Throwable.
-
def
expectError(): Throwable
Expect and return the signalled Throwable.
-
def
expectEvent(event: SubscriberEvent): Self
Fluent DSL
Fluent DSL
Expect SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
). -
def
expectEvent(max: FiniteDuration): SubscriberEvent
Expect and return SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
). -
def
expectEvent(): SubscriberEvent
Expect and return SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
). - def expectEventPF[T](f: PartialFunction[SubscriberEvent, T]): T
-
def
expectNext(e1: I, e2: I, es: I*): Self
Fluent DSL
Fluent DSL
Expect multiple stream elements.
- Annotations
- @varargs()
-
def
expectNext(d: FiniteDuration, element: I): Self
Fluent DSL
Fluent DSL
Expect a stream element during specified time or timeout.
-
def
expectNext(element: I): Self
Fluent DSL
Fluent DSL
Expect a stream element.
-
def
expectNext(d: FiniteDuration): I
Expect and return a stream element during specified time or timeout.
-
def
expectNext(): I
Expect and return a stream element.
-
def
expectNextChainingPF(f: PartialFunction[Any, Any]): Self
Expect next element and test it with partial function.
Expect next element and test it with partial function.
Allows chaining probe methods.
-
def
expectNextN(all: Seq[I]): Self
Fluent DSL Expect the given elements to be signalled in order.
-
def
expectNextN(n: Long): Seq[I]
Expect and return the next
n
stream elements. -
def
expectNextOrComplete(element: I): Self
Fluent DSL
Fluent DSL
Expect given next element or stream completion.
-
def
expectNextOrComplete(): Either[OnComplete.type, I]
Expect next element or stream completion - returning whichever was signalled.
-
def
expectNextOrError(element: I, cause: Throwable): Either[Throwable, I]
Fluent DSL Expect given next element or error signal.
-
def
expectNextOrError(): Either[Throwable, I]
Fluent DSL
Fluent DSL
Expect given next element or error signal, returning whichever was signalled.
- def expectNextPF[T](f: PartialFunction[Any, T]): T
-
def
expectNextUnordered(e1: I, e2: I, es: I*): Self
Fluent DSL
Fluent DSL
Expect multiple stream elements in arbitrary order.
- Annotations
- @varargs()
-
def
expectNextUnorderedN(all: Seq[I]): Self
Fluent DSL Expect the given elements to be signalled in any order.
-
def
expectNoMsg(remaining: FiniteDuration): Self
Fluent DSL
Fluent DSL
Assert that no message is received for the specified time.
-
def
expectNoMsg(): Self
Fluent DSL
Fluent DSL
Same as
expectNoMsg(remaining)
, but correctly treating the timeFactor. -
def
expectSubscription(): Subscription
Expect and return a org.reactivestreams.Subscription.
-
def
expectSubscriptionAndComplete(signalDemand: Boolean): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion.
Depending on the
signalDemand
parameter demand may be signalled immediatly after obtaining the subscription in order to wake up a possibly lazy upstream. You can disable this by setting thesignalDemand
parameter tofalse
.See also #expectSubscriptionAndComplete.
-
def
expectSubscriptionAndComplete(): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion. By default
1
demand will be signalled in order to wake up a possibly lazy upstreamSee also Boolean) if no demand should be signalled.
-
def
expectSubscriptionAndError(cause: Throwable, signalDemand: Boolean): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion. By default
1
demand will be signalled in order to wake up a possibly lazy upstreamSee also Throwable).
-
def
expectSubscriptionAndError(cause: Throwable): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion.
By default
1
demand will be signalled in order to wake up a possibly lazy upstream.See also Throwable, signalDemand: Boolean) if no demand should be signalled.
-
def
expectSubscriptionAndError(signalDemand: Boolean): Throwable
Expect subscription to be followed immediatly by an error signal.
Expect subscription to be followed immediatly by an error signal.
Depending on the
signalDemand
parameter demand may be signalled immediatly after obtaining the subscription in order to wake up a possibly lazy upstream. You can disable this by setting thesignalDemand
parameter tofalse
.See also #expectSubscriptionAndError().
-
def
expectSubscriptionAndError(): Throwable
Expect subscription to be followed immediatly by an error signal.
Expect subscription to be followed immediatly by an error signal.
By default
1
demand will be signalled in order to wake up a possibly lazy upstream.See also #expectSubscriptionAndError(Boolean) if no demand should be signalled.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to StringFormat[ManualProbe[I]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
onComplete(): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
onError(cause: Throwable): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
onNext(element: I): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
onSubscribe(subscription: Subscription): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
receiveWhile[T](max: Duration = Duration.Undefined, idle: Duration = Duration.Inf, messages: Int = Int.MaxValue)(f: PartialFunction[SubscriberEvent, T]): Seq[T]
Receive messages for a given duration or until one does not match a given partial function.
-
def
receiveWithin(max: FiniteDuration, messages: Int = Int.MaxValue): Seq[I]
Drains a given number of messages
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toStrict(atMost: FiniteDuration): Seq[I]
Attempt to drain the stream into a strict collection (by requesting
Long.MaxValue
elements).Attempt to drain the stream into a strict collection (by requesting
Long.MaxValue
elements).Use with caution: Be warned that this may not be a good idea if the stream is infinite or its elements are very large!
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
within[T](max: FiniteDuration)(f: ⇒ T): T
Same as calling
within(0 seconds, max)(f)
. -
def
within[T](min: FiniteDuration, max: FiniteDuration)(f: ⇒ T): T
Execute code block while bounding its execution time between
min
andmax
.Execute code block while bounding its execution time between
min
andmax
.within
blocks may be nested. All methods in this trait which take maximum wait times are available in a version which implicitly uses the remaining time governed by the innermost enclosingwithin
block.Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "akka.test.timefactor", while the min Duration is not.
val ret = within(50 millis) { test ! "ping" expectMsgClass(classOf[String]) }
-
def
→[B](y: B): (ManualProbe[I], B)
- Implicit
- This member is added by an implicit conversion from ManualProbe[I] to ArrowAssoc[ManualProbe[I]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc