InterviewSolution
| 1. |
What Happens If A Test Method Throws An Exception? |
|
Answer» If you write a TEST method that throws an exception by itself or by the method being tested, the JUnit RUNNER will DECLARE that test as FAIL. The example test below is designed to let the test fail by throwing the uncaught IndexOutOfBoundsException exception: import org.junit.*; If you write a test method that throws an exception by itself or by the method being tested, the JUnit runner will declare that test as fail. The example test below is designed to let the test fail by throwing the uncaught IndexOutOfBoundsException exception: import org.junit.*; |
|