• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package foo.bar;
2
3import java.lang.annotation.*;
4import org.junit.*;
5
6@Target(ElementType.TYPE)
7@Retention(RetentionPolicy.RUNTIME)
8public @interface MyAnnotation {
9}
10
11public @interface MyAnnotation2 {
12}
13
14public @interface MyAnnotationWithSingleValue {
15    int value();
16}
17
18public @interface MyAnnotationWithElements {
19    int num();
20    String str();
21}
22
23@MyAnnotation
24class CA {
25    @Override
26    public boolean equals(Object o) { return true; }
27
28    @Before
29    public void setUp() {}
30}
31
32@MyAnnotation2
33class CB extends CA {
34
35}
36
37@MyAnnotationWithSingleValue(42)
38class CC {
39    public boolean foo(Object o) { @SuppressWarnings("unchecked") String s = (String) o; }
40
41    @Ignore("lalala") @Test public void testSomething() {}
42}
43
44@MyAnnotationWithElements(num = 42, str = "test")
45class CD {
46    @Test(expected = Throwable.class, timeout = 42L) public void testSomethingElse() {}
47}
48