TestTimedOutException (JUnit API)
Date: 2018-08-04

org.junit.runners.model

## Class TestTimedOutException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.junit.runners.model.TestTimedOutException

- All Implemented Interfaces:
    java.io.Serializable

      public class TestTimedOutException
      extends java.lang.Exception

  Exception thrown when a test fails on timeout.
  Since:
    4.12
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestTimedOutException(long timeout, java.util.concurrent.TimeUnit timeUnit)` Creates exception with a standard message "test timed out after [timeout] [timeUnit]"

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getTimeout()` Gets the time passed before the test was interrupted
    `java.util.concurrent.TimeUnit` | `getTimeUnit()` Gets the time unit for the timeout value

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TestTimedOutException

          public TestTimedOutException(long timeout,
                               java.util.concurrent.TimeUnit timeUnit)

      Creates exception with a standard message "test timed out after [timeout] [timeUnit]"
      Parameters:
        `timeout` - the amount of time passed before the test was interrupted
        `timeUnit` - the time unit for the timeout value

  - ### Method Detail

    - #### getTimeout

          public long getTimeout()

      Gets the time passed before the test was interrupted

    - #### getTimeUnit

          public java.util.concurrent.TimeUnit getTimeUnit()

      Gets the time unit for the timeout value