-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample.java
More file actions
34 lines (26 loc) · 773 Bytes
/
Sample.java
File metadata and controls
34 lines (26 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package chapter6.annotations;
public class Sample {
@Test
public static void m1() {}
public static void m2() {}
@Test
@ExceptionTest(RuntimeException.class)
public static void m3() {
throw new RuntimeException("m3 exception");
}
@ExceptionTest(NullPointerException.class)
public static void m4() throws Exception {
throw new Exception("m4 exception");
}
@Test
@ExceptionTest(NullPointerException.class)
public void m5() {}
@ExceptionTest(NullPointerException.class)
public void m6() {
throw new NullPointerException("m5 io exception");
}
@ExceptionTest(RuntimeException.class)
public void m7() {
throw new ArithmeticException("m7 ArithmeticException");
}
}