39. 注解优于命名模式

This commit is contained in:
sjsdfg 2018-12-16 21:44:47 +08:00
parent 5cc7536c7e
commit 2718522449

View File

@ -98,11 +98,8 @@ public class RunTests {
```Java ```Java
public static void Sample.m3() failed: RuntimeException: Boom public static void Sample.m3() failed: RuntimeException: Boom
Invalid @Test: public void Sample.m5() Invalid @Test: public void Sample.m5()
public static void Sample.m7() failed: RuntimeException: Crash public static void Sample.m7() failed: RuntimeException: Crash
Passed: 1, Failed: 3 Passed: 1, Failed: 3
``` ```
@ -245,11 +242,8 @@ public @interface ExceptionTestContainer {
```Java ```Java
// Code containing a repeated annotation // Code containing a repeated annotation
@ExceptionTest(IndexOutOfBoundsException.class) @ExceptionTest(IndexOutOfBoundsException.class)
@ExceptionTest(NullPointerException.class) @ExceptionTest(NullPointerException.class)
public static void doublyBad() { ... } public static void doublyBad() { ... }
``` ```