1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.puppycrawl.tools.checkstyle.grammar.java8;
21
22 import org.junit.jupiter.api.Test;
23
24 import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport;
25 import com.puppycrawl.tools.checkstyle.utils.CommonUtil;
26
27 public class AnnotationTest extends AbstractModuleTestSupport {
28
29 @Override
30 protected String getPackageLocation() {
31 return "com/puppycrawl/tools/checkstyle/grammar/java8";
32 }
33
34 @Test
35 public void testSimpleTypeAnnotation()
36 throws Exception {
37 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
38 verifyWithInlineConfigParser(getPath("InputAnnotations1.java"), expected);
39 }
40
41 @Test
42 public void testAnnotationOnClass()
43 throws Exception {
44 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
45 verifyWithInlineConfigParser(getPath("InputAnnotations2.java"), expected);
46 }
47
48 @Test
49 public void testClassCastTypeAnnotation()
50 throws Exception {
51 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
52 verifyWithInlineConfigParser(getPath("InputAnnotations3.java"), expected);
53 }
54
55 @Test
56 public void testMethodParametersTypeAnnotation()
57 throws Exception {
58 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
59 verifyWithInlineConfigParser(getPath("InputAnnotations4.java"), expected);
60 }
61
62 @Test
63 public void testAnnotationInThrows()
64 throws Exception {
65 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
66 verifyWithInlineConfigParser(getPath("InputAnnotations5.java"), expected);
67 }
68
69 @Test
70 public void testAnnotationInGeneric()
71 throws Exception {
72 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
73 verifyWithInlineConfigParser(getPath("InputAnnotations6.java"), expected);
74 }
75
76 @Test
77 public void testAnnotationOnConstructorCall()
78 throws Exception {
79 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
80 verifyWithInlineConfigParser(getPath("InputAnnotations7.java"), expected);
81 }
82
83 @Test
84 public void testAnnotationNestedCall()
85 throws Exception {
86 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
87 verifyWithInlineConfigParser(getPath("InputAnnotations8.java"), expected);
88 }
89
90 @Test
91 public void testAnnotationOnWildcards()
92 throws Exception {
93 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
94 verifyWithInlineConfigParser(getPath("InputAnnotations9.java"), expected);
95 }
96
97 @Test
98 public void testAnnotationInCatchParameters()
99 throws Exception {
100 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
101 verifyWithInlineConfigParser(getPath("InputAnnotations10.java"), expected);
102 }
103
104 @Test
105 public void testAnnotationInTypeParameters()
106 throws Exception {
107 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
108 verifyWithInlineConfigParser(getPath("InputAnnotations11.java"), expected);
109 }
110
111 @Test
112 public void testAnnotationOnVarargs()
113 throws Exception {
114 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
115 verifyWithInlineConfigParser(getPath("InputAnnotations12.java"), expected);
116 }
117
118 }