Timeout Test in JUnit
Submitted by harrydev on Sun, 03/02/2014 - 07:04Timeout Test
The “Timeout Test” means if a test method is taking longer time than the specified number of time (in milliseconds) to execute, then the test method will be terminated and marked as failed.
While running test methods there can be cases where certain test methods get struck or may take longer time than to complete the execution than the expected. We need to handle these type of cases by specifying Timeout and proceed to execute further test cases / methods
Example: