Class Timeout

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class Timeout
    extends Object
    implements org.junit.rules.TestRule
    A rule for configuring the tests timeout.
    Author:
    Julien Viet
    • Constructor Detail

      • Timeout

        public Timeout​(long value,
                       TimeUnit unit)
    • Method Detail

      • millis

        public static Timeout millis​(long millis)
        Parameters:
        millis - the timeout value in milli seconds
        Returns:
        a new timeout rule
      • seconds

        public static Timeout seconds​(long seconds)
        Parameters:
        seconds - the timeout value in seconds
        Returns:
        a new timeout rule
      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule