File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 23
23
* }
24
24
* </pre>
25
25
* <p>
26
- * The <code>Test</code> annotation supports two optional parameters.
27
- * The first, <code>expected</code>, declares that a test method should throw
26
+ * The <code>Test</code> annotation supports two optional parameters for
27
+ * exception testing and for limiting test execution time.
28
+ *
29
+ * <h3>Exception Testing</h3>
30
+ * <p>
31
+ * The parameter <code>expected</code> declares that a test method should throw
28
32
* an exception. If it doesn't throw an exception or if it throws a different exception
29
33
* than the one declared, the test fails. For example, the following test succeeds:
30
34
* <pre>
36
40
* {@link org.junit.rules.ExpectedException ExpectedException} rule can be used. Further
37
41
* information about exception testing can be found at the
38
42
* <a href="https://github.com/junit-team/junit4/wiki/Exception-testing">JUnit Wiki</a>.
43
+ *
44
+ * <h3>Timeout</h3>
39
45
* <p>
40
- * The second optional parameter, <code>timeout</code>, causes a test to fail if it takes
46
+ * The parameter <code>timeout</code> causes a test to fail if it takes
41
47
* longer than a specified amount of clock time (measured in milliseconds). The following test fails:
42
48
* <pre>
43
49
* @Test(<b>timeout=100</b>) public void infinity() {
You can’t perform that action at this time.
0 commit comments