Search in sources :

Example 86 with AnalysisResult

use of org.sonar.scanner.mediumtest.AnalysisResult in project sonarqube by SonarSource.

the class FileSystemMediumTest method global_sensor_should_see_project_relative_paths.

@Test
public void global_sensor_should_see_project_relative_paths() {
    File projectDir = new File("test-resources/mediumtest/xoo/multi-modules-sample");
    AnalysisResult result = tester.newAnalysis(new File(projectDir, "sonar-project.properties")).property(GlobalProjectSensor.ENABLE_PROP, "true").execute();
    assertThat(result.inputFiles()).hasSize(4);
    assertThat(logTester.logs(LoggerLevel.INFO)).contains("Global Sensor: module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo", "Global Sensor: module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo", "Global Sensor: module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo", "Global Sensor: module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo");
}
Also used : InputFile(org.sonar.api.batch.fs.InputFile) DefaultInputFile(org.sonar.api.batch.fs.internal.DefaultInputFile) File(java.io.File) AnalysisResult(org.sonar.scanner.mediumtest.AnalysisResult) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)86 AnalysisResult (org.sonar.scanner.mediumtest.AnalysisResult)86 File (java.io.File)80 InputFile (org.sonar.api.batch.fs.InputFile)54 DefaultInputFile (org.sonar.api.batch.fs.internal.DefaultInputFile)33 ExternalIssue (org.sonar.scanner.protocol.output.ScannerReport.ExternalIssue)15 Issue (org.sonar.scanner.protocol.output.ScannerReport.Issue)15 List (java.util.List)6 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)6 Rule (org.junit.Rule)6 ScannerMediumTester (org.sonar.scanner.mediumtest.ScannerMediumTester)6 ScannerReport (org.sonar.scanner.protocol.output.ScannerReport)6 XooPlugin (org.sonar.xoo.XooPlugin)6 ImmutableMap (com.google.common.collect.ImmutableMap)4 ArrayList (java.util.ArrayList)4 Assertions.tuple (org.assertj.core.api.Assertions.tuple)3 AnalysisBuilder (org.sonar.scanner.mediumtest.ScannerMediumTester.AnalysisBuilder)3 XooRulesDefinition (org.sonar.xoo.rule.XooRulesDefinition)3 IOException (java.io.IOException)2 StandardCharsets (java.nio.charset.StandardCharsets)2