38
38
39
39
import static org .assertj .core .api .Assertions .assertThat ;
40
40
41
- public class MavenTest extends AbstractMavenTest {
41
+ class MavenTest extends AbstractMavenTest {
42
42
43
43
private static final String MODULE_START_7_6 = "------------- Run sensors on module " ;
44
44
private static final String MODULE_START = "------------- Scan " ;
@@ -55,7 +55,7 @@ public void cleanup() {
55
55
* See MSONAR-129
56
56
*/
57
57
@ Test
58
- public void useUserPropertiesGlobalConfig () throws Exception {
58
+ void useUserPropertiesGlobalConfig () throws Exception {
59
59
BuildRunner runner = new BuildRunner (ORCHESTRATOR .getConfiguration ());
60
60
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-only-test-dir" ))
61
61
.setGoals (cleanSonarGoal ());
@@ -79,7 +79,7 @@ public void useUserPropertiesGlobalConfig() throws Exception {
79
79
* See MSONAR-129
80
80
*/
81
81
@ Test
82
- public void supportSonarHostURLParam () {
82
+ void supportSonarHostURLParam () {
83
83
BuildRunner runner = new BuildRunner (ORCHESTRATOR .getConfiguration ());
84
84
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-global-properties" ))
85
85
// global property should take precedence
@@ -96,7 +96,7 @@ public void supportSonarHostURLParam() {
96
96
* See MSONAR-172
97
97
*/
98
98
@ Test
99
- public void supportSonarHostURLParamFromEnvironmentVariable () {
99
+ void supportSonarHostURLParamFromEnvironmentVariable () {
100
100
BuildRunner runner = new BuildRunner (ORCHESTRATOR .getConfiguration ());
101
101
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-only-test-dir" ))
102
102
.setEnvironmentVariable ("SONAR_HOST_URL" , "http://from-env.org:9000" )
@@ -112,7 +112,7 @@ public void supportSonarHostURLParamFromEnvironmentVariable() {
112
112
* See MSONAR-130
113
113
*/
114
114
@ Test
115
- public void structureWithRelativePaths () {
115
+ void structureWithRelativePaths () {
116
116
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-structure-relative-paths" ))
117
117
.setGoals (cleanSonarGoal ());
118
118
ORCHESTRATOR .executeBuild (build );
@@ -122,22 +122,22 @@ public void structureWithRelativePaths() {
122
122
* See MSONAR-164
123
123
*/
124
124
@ Test
125
- public void flatStructure () {
125
+ void flatStructure () {
126
126
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-flat-layout/parent" ))
127
127
.setGoals (cleanSonarGoal ());
128
128
ORCHESTRATOR .executeBuild (build );
129
129
}
130
130
131
131
@ Test
132
- public void aggregatorInheritParent () {
132
+ void aggregatorInheritParent () {
133
133
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/aggregator-inherit-parent" ))
134
134
.setGoals (cleanSonarGoal ());
135
135
ORCHESTRATOR .executeBuild (build );
136
136
assertThat (getMeasureAsInteger ("org.sonarsource.maven.its:aggregator" , "files" )).isEqualTo (4 ); // 4 x pom.xml
137
137
}
138
138
139
139
@ Test
140
- public void aggregatorInheritParentAndSonarAttachedToPhase () {
140
+ void aggregatorInheritParentAndSonarAttachedToPhase () {
141
141
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/aggregator-inherit-parent-and-bind-to-verify" ))
142
142
.setGoals ("clean verify" )
143
143
.setProperty ("sonar.maven.it.mojoVersion" , mojoVersion ().toString ());
@@ -146,7 +146,7 @@ public void aggregatorInheritParentAndSonarAttachedToPhase() {
146
146
}
147
147
148
148
@ Test
149
- public void shouldSupportJarWithoutSources () {
149
+ void shouldSupportJarWithoutSources () {
150
150
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/project-with-module-without-sources" ))
151
151
.setGoals (cleanSonarGoal ());
152
152
ORCHESTRATOR .executeBuild (build );
@@ -163,7 +163,7 @@ public void shouldSupportJarWithoutSources() {
163
163
* See SONAR-594
164
164
*/
165
165
@ Test
166
- public void shouldSupportJeeProjects () {
166
+ void shouldSupportJeeProjects () {
167
167
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/jee" ))
168
168
.setGoals (cleanInstallSonarGoal ());
169
169
ORCHESTRATOR .executeBuild (build );
@@ -182,7 +182,7 @@ public void shouldSupportJeeProjects() {
182
182
* See SONAR-222
183
183
*/
184
184
@ Test
185
- public void shouldSupportMavenExtensions () {
185
+ void shouldSupportMavenExtensions () {
186
186
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-extensions" ))
187
187
.setGoals (cleanSonarGoal ());
188
188
ORCHESTRATOR .executeBuild (build );
@@ -194,7 +194,7 @@ public void shouldSupportMavenExtensions() {
194
194
* This test should be splitted. It checks multiple use-cases at the same time : SONAR-518, SONAR-519 and SONAR-593
195
195
*/
196
196
@ Test
197
- public void testBadMavenParameters () {
197
+ void testBadMavenParameters () {
198
198
// should not fail
199
199
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-bad-parameters" ))
200
200
.setGoals (cleanSonarGoal ());
@@ -204,7 +204,7 @@ public void testBadMavenParameters() {
204
204
}
205
205
206
206
@ Test
207
- public void shouldAnalyzeMultiModules () {
207
+ void shouldAnalyzeMultiModules () {
208
208
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/modules-order" ))
209
209
.setGoals (cleanSonarGoal ());
210
210
ORCHESTRATOR .executeBuild (build );
@@ -232,7 +232,7 @@ public void shouldAnalyzeMultiModules() {
232
232
}
233
233
234
234
@ Test
235
- public void shouldEvaluateSourceVersionOnEachModule () {
235
+ void shouldEvaluateSourceVersionOnEachModule () {
236
236
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/modules-source-versions" ))
237
237
.setGoals (cleanSonarGoal ());
238
238
BuildResult buildResult = ORCHESTRATOR .executeBuild (build );
@@ -254,7 +254,7 @@ private String findScanSectionOfModule(String logs, String moduleName) {
254
254
255
255
// MSONAR-158
256
256
@ Test
257
- public void shouldAnalyzeMultiModulesAttachedToPhase () {
257
+ void shouldAnalyzeMultiModulesAttachedToPhase () {
258
258
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/attach-sonar-to-verify" ))
259
259
.setGoals ("clean verify" )
260
260
.setProperty ("sonar.maven.it.mojoVersion" , mojoVersion ().toString ());
@@ -273,7 +273,7 @@ public void shouldAnalyzeMultiModulesAttachedToPhase() {
273
273
* See SONAR-2735
274
274
*/
275
275
@ Test
276
- public void shouldSupportDifferentDeclarationsForModules () {
276
+ void shouldSupportDifferentDeclarationsForModules () {
277
277
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/modules-declaration" ))
278
278
.setGoals (cleanSonarGoal ());
279
279
ORCHESTRATOR .executeBuild (build );
@@ -312,7 +312,7 @@ public void shouldSupportDifferentDeclarationsForModules() {
312
312
* See SONAR-3843
313
313
*/
314
314
@ Test
315
- public void should_support_shade_with_dependency_reduced_pom_with_clean_install_sonar_goals () {
315
+ void should_support_shade_with_dependency_reduced_pom_with_clean_install_sonar_goals () {
316
316
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/shade-with-dependency-reduced-pom" ))
317
317
.setGoals (cleanInstallSonarGoal ());
318
318
BuildResult result = ORCHESTRATOR .executeBuildQuietly (build );
@@ -325,7 +325,7 @@ public void should_support_shade_with_dependency_reduced_pom_with_clean_install_
325
325
* src/main/java is missing
326
326
*/
327
327
@ Test
328
- public void maven_project_with_only_test_dir () {
328
+ void maven_project_with_only_test_dir () {
329
329
// Need package to have test execution
330
330
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-only-test-dir" )).setGoals (cleanPackageSonarGoal ());
331
331
ORCHESTRATOR .executeBuild (build );
@@ -338,7 +338,7 @@ public void maven_project_with_only_test_dir() {
338
338
* The property sonar.sources overrides the source dirs as declared in Maven
339
339
*/
340
340
@ Test
341
- public void override_sources () {
341
+ void override_sources () {
342
342
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-override-sources" )).setGoals (sonarGoal ());
343
343
ORCHESTRATOR .executeBuild (build );
344
344
@@ -350,7 +350,7 @@ public void override_sources() {
350
350
* The property sonar.sources overrides the source dirs as declared in Maven
351
351
*/
352
352
@ Test
353
- public void override_sources_in_multi_module () {
353
+ void override_sources_in_multi_module () {
354
354
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/multi-modules-override-sources" )).setGoals (sonarGoal ());
355
355
ORCHESTRATOR .executeBuild (build );
356
356
@@ -365,7 +365,7 @@ public void override_sources_in_multi_module() {
365
365
* The property sonar.sources overrides the source dirs as declared in Maven
366
366
*/
367
367
@ Test
368
- public void override_sources_in_multi_module_aggregator () {
368
+ void override_sources_in_multi_module_aggregator () {
369
369
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/multi-module-aggregator" ))
370
370
.setGoals (sonarGoal ());
371
371
ORCHESTRATOR .executeBuild (build );
@@ -381,7 +381,7 @@ public void override_sources_in_multi_module_aggregator() {
381
381
* The property sonar.inclusions overrides the property sonar.sources
382
382
*/
383
383
@ Test
384
- public void inclusions_apply_to_source_dirs () {
384
+ void inclusions_apply_to_source_dirs () {
385
385
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/inclusions_apply_to_source_dirs" )).setGoals (sonarGoal ());
386
386
ORCHESTRATOR .executeBuild (build );
387
387
@@ -393,7 +393,7 @@ public void inclusions_apply_to_source_dirs() {
393
393
* The property sonar.sources has a typo -> fail, like in sonar-runner
394
394
*/
395
395
@ Test
396
- public void fail_if_bad_value_of_sonar_sources_property () {
396
+ void fail_if_bad_value_of_sonar_sources_property () {
397
397
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-bad-sources-property" )).setGoals (sonarGoal ());
398
398
BuildResult result = ORCHESTRATOR .executeBuildQuietly (build );
399
399
assertThat (result .getLastStatus ()).isNotEqualTo (0 );
@@ -405,7 +405,7 @@ public void fail_if_bad_value_of_sonar_sources_property() {
405
405
* The property sonar.sources has a typo -> fail, like in sonar-runner
406
406
*/
407
407
@ Test
408
- public void fail_if_bad_value_of_sonar_tests_property () {
408
+ void fail_if_bad_value_of_sonar_tests_property () {
409
409
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-bad-tests-property" )).setGoals (sonarGoal ());
410
410
BuildResult result = ORCHESTRATOR .executeBuildQuietly (build );
411
411
assertThat (result .getLastStatus ()).isNotEqualTo (0 );
@@ -415,7 +415,7 @@ public void fail_if_bad_value_of_sonar_tests_property() {
415
415
416
416
// MSONAR-91
417
417
@ Test
418
- public void shouldSkipModules () {
418
+ void shouldSkipModules () {
419
419
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("exclusions/skip-one-module" ))
420
420
.setGoals (cleanSonarGoal ());
421
421
ORCHESTRATOR .executeBuild (build );
@@ -433,7 +433,7 @@ public void shouldSkipModules() {
433
433
434
434
// MSONAR-150
435
435
@ Test
436
- public void shouldSkipWithEnvVar () {
436
+ void shouldSkipWithEnvVar () {
437
437
MavenBuild build = MavenBuild .create (ItUtils .locateProjectPom ("maven/maven-only-test-dir" ))
438
438
.setGoals (cleanSonarGoal ())
439
439
.setProperties ("sonar.host.url" , "invalid" )
@@ -446,7 +446,7 @@ public void shouldSkipWithEnvVar() {
446
446
* MSONAR-141
447
447
*/
448
448
@ Test
449
- public void supportMavenEncryption () throws Exception {
449
+ void supportMavenEncryption () throws Exception {
450
450
wsClient .settings ().set (new SetRequest ().setKey ("sonar.forceAuthentication" ).setValue ("true" ));
451
451
wsClient .users ().create (new CreateRequest ().setLogin ("julien" ).setName ("Julien" ).setPassword ("123abc" ));
452
452
0 commit comments