Package akka.testkit

Class JavaTestKit.Within

  • Enclosing class:
    JavaTestKit

    public abstract class JavaTestKit.Within
    extends java.lang.Object
    Execute code block while bounding its execution time between min and max . 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 enclosing Within block.

    Note that the timeout is scaled using dilated, which uses the configuration entry "akka.test.timefactor", while the min Duration is not.

     
     // the run() method needs to finish within 3 seconds
     new Within(duration("3 seconds")) {
       protected void run() {
         // ...
       }
     }
     
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Within​(scala.concurrent.duration.FiniteDuration max)  
      Within​(scala.concurrent.duration.FiniteDuration min, scala.concurrent.duration.FiniteDuration max)  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      protected abstract void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Within

        public Within​(scala.concurrent.duration.FiniteDuration max)
      • Within

        public Within​(scala.concurrent.duration.FiniteDuration min,
                      scala.concurrent.duration.FiniteDuration max)
    • Method Detail

      • run

        protected abstract void run()