@@ -77,40 +77,40 @@ public String getRemoteName() {
77
77
}
78
78
}
79
79
80
- private static class PassingCheck extends GuidelineCheck < TestScanReport > {
80
+ private static class PassingCheck extends GuidelineCheck {
81
81
public PassingCheck (String name ) {
82
82
super (name , RequirementLevel .MUST );
83
83
}
84
84
85
85
@ Override
86
- public GuidelineCheckResult evaluate (TestScanReport report ) {
86
+ public < ReportT extends ScanReport > GuidelineCheckResult evaluate (ReportT report ) {
87
87
return new FailedCheckGuidelineResult (getName (), GuidelineAdherence .ADHERED );
88
88
}
89
89
}
90
90
91
- private static class FailingCheck extends GuidelineCheck < TestScanReport > {
91
+ private static class FailingCheck extends GuidelineCheck {
92
92
public FailingCheck (String name ) {
93
93
super (name , RequirementLevel .MUST );
94
94
}
95
95
96
96
@ Override
97
- public GuidelineCheckResult evaluate (TestScanReport report ) {
97
+ public < ReportT extends ScanReport > GuidelineCheckResult evaluate (ReportT report ) {
98
98
return new FailedCheckGuidelineResult (getName (), GuidelineAdherence .VIOLATED );
99
99
}
100
100
}
101
101
102
- private static class ConditionalCheck extends GuidelineCheck < TestScanReport > {
102
+ private static class ConditionalCheck extends GuidelineCheck {
103
103
public ConditionalCheck (String name , GuidelineCheckCondition condition ) {
104
104
super (name , RequirementLevel .SHOULD , condition );
105
105
}
106
106
107
107
@ Override
108
- public GuidelineCheckResult evaluate (TestScanReport report ) {
108
+ public < ReportT extends ScanReport > GuidelineCheckResult evaluate (ReportT report ) {
109
109
return new FailedCheckGuidelineResult (getName (), GuidelineAdherence .ADHERED );
110
110
}
111
111
}
112
112
113
- private static class ExceptionThrowingCheck extends GuidelineCheck < TestScanReport > {
113
+ private static class ExceptionThrowingCheck extends GuidelineCheck {
114
114
private final RuntimeException exception ;
115
115
116
116
public ExceptionThrowingCheck (String name , RuntimeException exception ) {
@@ -119,12 +119,12 @@ public ExceptionThrowingCheck(String name, RuntimeException exception) {
119
119
}
120
120
121
121
@ Override
122
- public GuidelineCheckResult evaluate (TestScanReport report ) {
122
+ public < ReportT extends ScanReport > GuidelineCheckResult evaluate (ReportT report ) {
123
123
throw exception ;
124
124
}
125
125
}
126
126
127
- private Guideline < TestScanReport > guideline ;
127
+ private Guideline guideline ;
128
128
private TestScanReport report ;
129
129
130
130
@ BeforeEach
@@ -134,9 +134,9 @@ void setUp() {
134
134
135
135
@ Test
136
136
void testFillReportWithPassingChecks () {
137
- List <GuidelineCheck < TestScanReport > > checks =
137
+ List <GuidelineCheck > checks =
138
138
Arrays .asList (new PassingCheck ("Check1" ), new PassingCheck ("Check2" ));
139
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , checks );
139
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , checks );
140
140
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
141
141
142
142
checker .fillReport (report );
@@ -152,12 +152,12 @@ void testFillReportWithPassingChecks() {
152
152
153
153
@ Test
154
154
void testFillReportWithFailingChecks () {
155
- List <GuidelineCheck < TestScanReport > > checks =
155
+ List <GuidelineCheck > checks =
156
156
Arrays .asList (
157
157
new PassingCheck ("Check1" ),
158
158
new FailingCheck ("Check2" ),
159
159
new FailingCheck ("Check3" ));
160
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , checks );
160
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , checks );
161
161
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
162
162
163
163
checker .fillReport (report );
@@ -174,11 +174,11 @@ void testFillReportWithUnmetConditions() {
174
174
TestAnalyzedProperty property = new TestAnalyzedProperty ("TestProp" );
175
175
GuidelineCheckCondition condition = new GuidelineCheckCondition (property , TestResults .TRUE );
176
176
177
- List <GuidelineCheck < TestScanReport > > checks =
177
+ List <GuidelineCheck > checks =
178
178
Arrays .asList (
179
179
new PassingCheck ("Check1" ),
180
180
new ConditionalCheck ("ConditionalCheck" , condition ));
181
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , checks );
181
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , checks );
182
182
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
183
183
184
184
// Set condition to false
@@ -202,9 +202,9 @@ void testFillReportWithMetConditions() {
202
202
TestAnalyzedProperty property = new TestAnalyzedProperty ("TestProp" );
203
203
GuidelineCheckCondition condition = new GuidelineCheckCondition (property , TestResults .TRUE );
204
204
205
- List <GuidelineCheck < TestScanReport > > checks =
205
+ List <GuidelineCheck > checks =
206
206
Arrays .asList (new ConditionalCheck ("ConditionalCheck" , condition ));
207
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , checks );
207
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , checks );
208
208
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
209
209
210
210
// Set condition to true
@@ -222,12 +222,12 @@ void testFillReportWithMetConditions() {
222
222
@ Test
223
223
void testFillReportWithExceptionThrowingCheck () {
224
224
RuntimeException exception = new RuntimeException ("Test exception" );
225
- List <GuidelineCheck < TestScanReport > > checks =
225
+ List <GuidelineCheck > checks =
226
226
Arrays .asList (
227
227
new PassingCheck ("Check1" ),
228
228
new ExceptionThrowingCheck ("ExceptionCheck" , exception ),
229
229
new PassingCheck ("Check3" ));
230
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , checks );
230
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , checks );
231
231
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
232
232
233
233
checker .fillReport (report );
@@ -247,10 +247,10 @@ void testFillReportWithExceptionThrowingCheck() {
247
247
@ Test
248
248
void testFillReportWithError () {
249
249
Error error = new OutOfMemoryError ("Test error" );
250
- List <GuidelineCheck < TestScanReport > > checks =
250
+ List <GuidelineCheck > checks =
251
251
Arrays .asList (
252
252
new ExceptionThrowingCheck ("ErrorCheck" , new RuntimeException (error )));
253
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , checks );
253
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , checks );
254
254
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
255
255
256
256
checker .fillReport (report );
@@ -265,7 +265,7 @@ void testFillReportWithError() {
265
265
266
266
@ Test
267
267
void testFillReportWithEmptyChecks () {
268
- guideline = new Guideline <> ("Test Guideline" , "https://test.com" , new ArrayList <>());
268
+ guideline = new Guideline ("Test Guideline" , "https://test.com" , new ArrayList <>());
269
269
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
270
270
271
271
checker .fillReport (report );
@@ -280,13 +280,13 @@ void testFillReportWithMixedResults() {
280
280
TestAnalyzedProperty property = new TestAnalyzedProperty ("TestProp" );
281
281
GuidelineCheckCondition condition = new GuidelineCheckCondition (property , TestResults .TRUE );
282
282
283
- List <GuidelineCheck < TestScanReport > > checks =
283
+ List <GuidelineCheck > checks =
284
284
Arrays .asList (
285
285
new PassingCheck ("PassCheck" ),
286
286
new FailingCheck ("FailCheck" ),
287
287
new ConditionalCheck ("UnmetConditionCheck" , condition ),
288
288
new ExceptionThrowingCheck ("ExceptionCheck" , new RuntimeException ("Test" )));
289
- guideline = new Guideline <> ("Mixed Guideline" , "https://mixed.com" , checks );
289
+ guideline = new Guideline ("Mixed Guideline" , "https://mixed.com" , checks );
290
290
GuidelineChecker <TestScanReport > checker = new GuidelineChecker <>(guideline );
291
291
292
292
// Set condition to false
0 commit comments