Search in sources :

Example 11 with ProjectRepositories

use of org.sonar.scanner.repository.ProjectRepositories in project sonarqube by SonarSource.

the class StatusDetectionTest method detect_status.

@Test
public void detect_status() {
    Table<String, String, String> t = ImmutableTable.of();
    ProjectRepositories ref = new ProjectRepositories(t, createTable(), null);
    StatusDetection statusDetection = new StatusDetection(ref);
    assertThat(statusDetection.status("foo", "src/Foo.java", "ABCDE")).isEqualTo(InputFile.Status.SAME);
    assertThat(statusDetection.status("foo", "src/Foo.java", "XXXXX")).isEqualTo(InputFile.Status.CHANGED);
    assertThat(statusDetection.status("foo", "src/Other.java", "QWERT")).isEqualTo(InputFile.Status.ADDED);
}
Also used : StatusDetection(org.sonar.scanner.scan.filesystem.StatusDetection) ProjectRepositories(org.sonar.scanner.repository.ProjectRepositories) Test(org.junit.Test)

Example 12 with ProjectRepositories

use of org.sonar.scanner.repository.ProjectRepositories in project sonarqube by SonarSource.

the class ProjectSettingsTest method should_load_project_root_settings.

@Test
public void should_load_project_root_settings() {
    Table<String, String, String> settings = HashBasedTable.create();
    settings.put("struts", "sonar.cpd.cross", "true");
    settings.put("struts", "sonar.java.coveragePlugin", "jacoco");
    projectRef = new ProjectRepositories(settings, emptyFileData, null);
    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, projectRef, mode);
    assertThat(batchSettings.getString("sonar.java.coveragePlugin")).isEqualTo("jacoco");
}
Also used : ProjectRepositories(org.sonar.scanner.repository.ProjectRepositories) ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Aggregations

ProjectRepositories (org.sonar.scanner.repository.ProjectRepositories)12 Test (org.junit.Test)11 ProjectReactor (org.sonar.api.batch.bootstrap.ProjectReactor)5 ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)4 GlobalSettings (org.sonar.scanner.bootstrap.GlobalSettings)4 AnalysisContextReportPublisher (org.sonar.scanner.report.AnalysisContextReportPublisher)4 Date (java.util.Date)1 Before (org.junit.Before)1 FileData (org.sonar.scanner.repository.FileData)1 ProjectRepositoriesProvider (org.sonar.scanner.repository.ProjectRepositoriesProvider)1 StatusDetection (org.sonar.scanner.scan.filesystem.StatusDetection)1