akka.testkit
Class JavaTestKit.ReceiveWhile<T>

java.lang.Object
  extended by akka.testkit.JavaTestKit.ReceiveWhile<T>
Enclosing class:
JavaTestKit

public abstract class JavaTestKit.ReceiveWhile<T>
extends java.lang.Object

Receive a series of messages until one does not match the given match function or the idle timeout is met (disabled by default) or the overall maximum duration is elapsed. Returns the sequence of messages.

Note that it is not an error to hit the max duration in this case.

One possible use of this method is for testing whether messages of certain characteristics are generated at a certain rate.


Constructor Summary
JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz)
           
JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz, scala.concurrent.duration.Duration max)
           
JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz, scala.concurrent.duration.Duration max, scala.concurrent.duration.Duration idle, int messages)
           
JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz, scala.concurrent.duration.Duration max, int messages)
           
 
Method Summary
 T[] get()
           
protected abstract  T match(java.lang.Object msg)
           
protected  java.lang.RuntimeException noMatch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTestKit.ReceiveWhile

public JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz)

JavaTestKit.ReceiveWhile

public JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz,
                                scala.concurrent.duration.Duration max)

JavaTestKit.ReceiveWhile

public JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz,
                                scala.concurrent.duration.Duration max,
                                int messages)

JavaTestKit.ReceiveWhile

public JavaTestKit.ReceiveWhile(java.lang.Class<T> clazz,
                                scala.concurrent.duration.Duration max,
                                scala.concurrent.duration.Duration idle,
                                int messages)
Method Detail

match

protected abstract T match(java.lang.Object msg)
                    throws java.lang.Exception
Throws:
java.lang.Exception

noMatch

protected java.lang.RuntimeException noMatch()

get

public T[] get()