File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 31
31
* @Test(<b>expected=IndexOutOfBoundsException.class</b>) public void outOfBounds() {
32
32
* new ArrayList<Object>().get(1);
33
33
* }
34
- * </pre></p>
34
+ * </pre>
35
+ * If the exception's message or one of its properties should be verified, the
36
+ * {@link org.junit.rules.ExpectedException ExpectedException} rule can be used. Further
37
+ * information about exception testing can be found at the
38
+ * <a href="https://github.com/junit-team/junit/wiki/Exception-testing">JUnit Wiki</a>.
35
39
* <p>
36
40
* The second optional parameter, <code>timeout</code>, causes a test to fail if it takes
37
41
* longer than a specified amount of clock time (measured in milliseconds). The following test fails:
@@ -73,7 +77,9 @@ private None() {
73
77
74
78
/**
75
79
* Optionally specify <code>expected</code>, a Throwable, to cause a test method to succeed if
76
- * and only if an exception of the specified class is thrown by the method.
80
+ * and only if an exception of the specified class is thrown by the method. If the Throwable's
81
+ * message or one of its properties should be verified, the
82
+ * {@link org.junit.rules.ExpectedException ExpectedException} rule can be used instead.
77
83
*/
78
84
Class <? extends Throwable > expected () default None .class ;
79
85
You can’t perform that action at this time.
0 commit comments