ITEM 39: PREFER ANNOTATIONS TO NAMING PATTERNS
183
and prints an appropriate error message. Here is the output that is printed if
RunTests
is run on
Sample
:
public static void Sample.m3() failed: RuntimeException: Boom
Invalid @Test: public void Sample.m5()
public static void Sample.m7() failed: RuntimeException: Crash
Passed: 1, Failed: 3
Now let’s add support for tests that succeed only if they throw a particular
exception. We’ll need a new annotation type for this:
Do'stlaringiz bilan baham: