33
33
import java .io .IOException ;
34
34
import java .nio .file .Files ;
35
35
import java .nio .file .Path ;
36
- import java .util .Arrays ;
37
36
import java .util .Collections ;
38
37
import java .util .HashMap ;
39
38
import java .util .HashSet ;
40
39
import java .util .List ;
41
40
import java .util .Map ;
42
41
import java .util .Set ;
43
42
import java .util .concurrent .TimeUnit ;
44
- import java .util .stream .Collectors ;
45
43
import org .junit .jupiter .api .AfterAll ;
46
44
import org .junit .jupiter .api .BeforeAll ;
47
45
import org .junit .jupiter .api .Test ;
48
- import org .junit .jupiter .api .condition .DisabledIfSystemProperty ;
49
- import org .junit .jupiter .api .condition .EnabledIfSystemProperty ;
50
46
import org .slf4j .Logger ;
51
47
import org .slf4j .LoggerFactory ;
52
48
import org .sonarsource .analyzer .commons .ProfileGenerator ;
@@ -106,62 +102,7 @@ private static void addLanguagePlugins(OrchestratorBuilder builder) {
106
102
}
107
103
108
104
@ Test
109
- public void test_kotlin_ktor () throws IOException {
110
- List <String > ktorDirs = Arrays .asList (
111
- "" ,
112
- "ktor-client/ktor-client-winhttp/" ,
113
- "ktor-client/ktor-client-tests/" ,
114
- "ktor-client/ktor-client-plugins/ktor-client-websockets/" ,
115
- "ktor-client/ktor-client-plugins/ktor-client-tracing/" ,
116
- "ktor-client/ktor-client-plugins/ktor-client-resources/" ,
117
- "ktor-client/ktor-client-plugins/ktor-client-logging/" ,
118
- "ktor-client/ktor-client-plugins/ktor-client-json/" ,
119
- "ktor-client/ktor-client-plugins/ktor-client-encoding/" ,
120
- "ktor-client/ktor-client-plugins/ktor-client-content-negotiation/" ,
121
- "ktor-client/ktor-client-plugins/ktor-client-auth/" ,
122
- "ktor-client/ktor-client-plugins/" ,
123
- "ktor-client/ktor-client-okhttp/" ,
124
- "ktor-client/ktor-client-mock/" ,
125
- "ktor-client/ktor-client-js/" ,
126
- "ktor-client/ktor-client-jetty-jakarta/" ,
127
- "ktor-client/ktor-client-jetty/" ,
128
- "ktor-client/ktor-client-java/" ,
129
- "ktor-client/ktor-client-ios/" ,
130
- "ktor-client/ktor-client-darwin-legacy/" ,
131
- "ktor-client/ktor-client-darwin/" ,
132
- "ktor-client/ktor-client-curl/" ,
133
- "ktor-client/ktor-client-core/" ,
134
- "ktor-client/ktor-client-cio/" ,
135
- "ktor-client/ktor-client-apache5/" ,
136
- "ktor-client/ktor-client-apache/" ,
137
- "ktor-client/ktor-client-android/" ,
138
- "ktor-client/" ,
139
- "ktor-http/" ,
140
- "ktor-io/" ,
141
- "ktor-java-modules-test/" ,
142
- "ktor-network/" ,
143
- "ktor-server/" ,
144
- "ktor-shared/" ,
145
- "ktor-test-dispatcher/" ,
146
- "ktor-utils/" );
147
-
148
- String binaries = ktorDirs .stream ().map (dir -> FileLocation .of ("../sources/kotlin/ktor/" + dir + "build/classes" ))
149
- .map (SlangRulingTest ::getFileLocationAbsolutePath )
150
- .collect (Collectors .joining ("," ));
151
-
152
- String libraries = ktorDirs .stream ().map (dir -> FileLocation .of ("../sources/kotlin/ktor/" + dir + "build/libs" ))
153
- .map (SlangRulingTest ::getFileLocationAbsolutePath )
154
- .collect (Collectors .joining ("," ));
155
-
156
- executeSonarScannerAndAssertDifferences ("kotlin/ktor" , Map .of (
157
- "sonar.inclusions" , "sources/kotlin/ktor/**/*.kt" ,
158
- "sonar.exclusions" , "**/testData/**/*,**/Win*.kt,**/PrimitiveArraysTest.kt,**/ContentTestSuite.kt" ,
159
- "sonar.java.binaries" , binaries ,
160
- "sonar.java.libraries" , libraries ));
161
- }
162
-
163
- @ Test
164
- public void test_kotlin_compiler () throws IOException {
105
+ void test_kotlin_compiler () throws IOException {
165
106
List <String > exclusions = List .of (
166
107
"**/testData/**/*" ,
167
108
"sources/kotlin/kotlin/compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt" ,
@@ -174,46 +115,46 @@ public void test_kotlin_compiler() throws IOException {
174
115
}
175
116
176
117
@ Test
177
- public void test_resources_sources () throws IOException {
118
+ void test_resources_sources () throws IOException {
178
119
executeSonarScannerAndAssertDifferences ("kotlin/test-resources-sources" , Map .of (
179
120
"sonar.inclusions" , "ruling/src/test/resources/sources/kotlin/**/*.kt" ,
180
121
"sonar.java.libraries" , System .getProperty ("gradle.main.compile.classpath" ).replace (File .pathSeparatorChar , ',' )
181
122
));
182
123
}
183
124
184
125
@ Test
185
- public void test_kotlin_android () throws IOException {
126
+ void test_kotlin_android () throws IOException {
186
127
executeSonarScannerAndAssertDifferences ("kotlin/android-architecture-components" , Map .of (
187
128
"sonar.inclusions" , "sources/kotlin/android-architecture-components/**/*.kt" ,
188
129
"sonar.exclusions" , "**/testData/**/*"
189
130
));
190
131
}
191
132
192
133
@ Test
193
- public void test_kotlin_corda () throws IOException {
134
+ void test_kotlin_corda () throws IOException {
194
135
executeSonarScannerAndAssertDifferences ("kotlin/corda" , Map .of (
195
136
"sonar.inclusions" , "sources/kotlin/corda/**/*.kt" ,
196
137
"sonar.exclusions" , "**/testData/**/*"
197
138
));
198
139
}
199
140
200
141
@ Test
201
- public void test_kotlin_intellij_rust () throws IOException {
142
+ void test_kotlin_intellij_rust () throws IOException {
202
143
executeSonarScannerAndAssertDifferences ("kotlin/intellij-rust" , Map .of (
203
144
"sonar.inclusions" , "sources/kotlin/intellij-rust/**/*.kt" ,
204
145
"sonar.exclusions" , "**/testData/**/*"
205
146
));
206
147
}
207
148
208
149
@ Test
209
- public void test_kotlin_okio () throws IOException {
150
+ void test_kotlin_okio () throws IOException {
210
151
executeSonarScannerAndAssertDifferences ("kotlin/okio" , Map .of (
211
152
"sonar.inclusions" , "sources/kotlin/okio/**/*.kt" ,
212
153
"sonar.exclusions" , "**/testData/**/*" ));
213
154
}
214
155
215
156
@ Test
216
- public void test_kotlin_language_server () throws IOException {
157
+ void test_kotlin_language_server () throws IOException {
217
158
executeGradleBuildAndAssertDifferences ("kotlin/kotlin-language-server" , Map .of ());
218
159
}
219
160
0 commit comments