akka.remote.transport.TestTransport

SwitchableLoggedBehavior

class SwitchableLoggedBehavior[A, B] extends (A) ⇒ Future[B]

Test utility to make behavior of functions that return some Future[B] controllable from tests. This tool is able to overwrite default behavior with any generic behavior, including failure, and exposes control to the timing of the completition of the returned future.

The utility is implemented as a stack of behaviors, where the behavior on the top of the stack represents the currently active behavior. The bottom of the stack always contains the defaultBehavior which can not be popped out.

A

Parameter type of the wrapped function. If it takes multiple parameters it must be wrapped in a tuple.

B

Type parameter of the future that the original function returns.

Linear Supertypes
(A) ⇒ Future[B], AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SwitchableLoggedBehavior
  2. Function1
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SwitchableLoggedBehavior(defaultBehavior: (A) ⇒ Future[B], logCallback: (A) ⇒ Unit)

    defaultBehavior

    The original behavior that might be overwritten. It is always possible to restore this behavior

    logCallback

    Function that will be called independently of the current active behavior

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (SwitchableLoggedBehavior[A, B], B)

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to ArrowAssoc[SwitchableLoggedBehavior[A, B]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. def andThen[A](g: (Future[B]) ⇒ A): (A) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. def apply(params: A): Future[B]

    Applies the current behavior, and invokes the callback.

    Applies the current behavior, and invokes the callback.

    params

    The parameters of this behavior.

    returns

    The result of this behavior wrapped in a future.

    Definition Classes
    SwitchableLoggedBehavior → Function1
  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compose[A](g: (A) ⇒ A): (A) ⇒ Future[B]

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  13. def ensuring(cond: (SwitchableLoggedBehavior[A, B]) ⇒ Boolean, msg: ⇒ Any): SwitchableLoggedBehavior[A, B]

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to Ensuring[SwitchableLoggedBehavior[A, B]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (SwitchableLoggedBehavior[A, B]) ⇒ Boolean): SwitchableLoggedBehavior[A, B]

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to Ensuring[SwitchableLoggedBehavior[A, B]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): SwitchableLoggedBehavior[A, B]

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to Ensuring[SwitchableLoggedBehavior[A, B]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): SwitchableLoggedBehavior[A, B]

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to Ensuring[SwitchableLoggedBehavior[A, B]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def pop(): Unit

    Restores the previous behavior.

  28. def push(behavior: (A) ⇒ Future[B]): Unit

    Changes the current behavior to the provided one.

    Changes the current behavior to the provided one.

    behavior

    Function that takes a parameter type A and returns a Future[B].

  29. def pushConstant(c: B): Unit

    Changes the behavior to return a completed future with the given constant value.

    Changes the behavior to return a completed future with the given constant value.

    c

    The constant the future will be completed with.

  30. def pushDelayed: Promise[Unit]

    Enables control of the completion of the previously active behavior.

    Enables control of the completion of the previously active behavior. Wraps the previous behavior in a new one, returns a control promise that starts the original behavior after the control promise is completed.

    returns

    A promise, which delays the completion of the original future until after this promise is completed.

  31. def pushError(e: Throwable): Unit

    Changes the current behavior to return a failed future containing the given Throwable.

    Changes the current behavior to return a failed future containing the given Throwable.

    e

    The throwable the failed future will contain.

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  34. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. def [B](y: B): (SwitchableLoggedBehavior[A, B], B)

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to ArrowAssoc[SwitchableLoggedBehavior[A, B]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (switchableLoggedBehavior: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (switchableLoggedBehavior: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: SwitchableLoggedBehavior[A, B]

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to ArrowAssoc[SwitchableLoggedBehavior[A, B]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (switchableLoggedBehavior: ArrowAssoc[SwitchableLoggedBehavior[A, B]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: SwitchableLoggedBehavior[A, B]

    Implicit information
    This member is added by an implicit conversion from SwitchableLoggedBehavior[A, B] to Ensuring[SwitchableLoggedBehavior[A, B]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (switchableLoggedBehavior: Ensuring[SwitchableLoggedBehavior[A, B]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from (A) ⇒ Future[B]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from SwitchableLoggedBehavior[A, B] to StringAdd

Inherited by implicit conversion any2stringfmt from SwitchableLoggedBehavior[A, B] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from SwitchableLoggedBehavior[A, B] to ArrowAssoc[SwitchableLoggedBehavior[A, B]]

Inherited by implicit conversion any2Ensuring from SwitchableLoggedBehavior[A, B] to Ensuring[SwitchableLoggedBehavior[A, B]]

Ungrouped