Search in sources :

Example 16 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor in project sonarqube by SonarSource.

the class ProjectLockTest method setUpTest.

private ProjectLock setUpTest(File file) {
    ProjectReactor projectReactor = mock(ProjectReactor.class);
    ProjectDefinition projectDefinition = mock(ProjectDefinition.class);
    when(projectReactor.getRoot()).thenReturn(projectDefinition);
    when(projectDefinition.getWorkDir()).thenReturn(file);
    return new ProjectLock(projectReactor);
}
Also used : ProjectLock(org.sonar.scanner.scan.ProjectLock) ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) ProjectDefinition(org.sonar.api.batch.bootstrap.ProjectDefinition)

Example 17 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor in project sonarqube by SonarSource.

the class ProjectReactorBuilderTest method loadProjectDefinition.

private ProjectDefinition loadProjectDefinition(String projectFolder) {
    Map<String, String> props = loadProps(projectFolder);
    AnalysisProperties bootstrapProps = new AnalysisProperties(props, null);
    ProjectReactor projectReactor = new ProjectReactorBuilder(bootstrapProps).execute();
    return projectReactor.getRoot();
}
Also used : AnalysisProperties(org.sonar.scanner.analysis.AnalysisProperties) ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor)

Example 18 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor in project sonarqube by SonarSource.

the class ProjectReactorValidatorTest method not_fail_with_dash_key.

@Test
public void not_fail_with_dash_key() {
    ProjectReactor reactor = createProjectReactor("foo-bar");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Example 19 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor 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)

Example 20 with ProjectReactor

use of org.sonar.api.batch.bootstrap.ProjectReactor in project sonarqube by SonarSource.

the class ProjectReactorValidatorTest method not_fail_with_underscore_key.

@Test
public void not_fail_with_underscore_key() {
    ProjectReactor reactor = createProjectReactor("foo_bar");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Aggregations

ProjectReactor (org.sonar.api.batch.bootstrap.ProjectReactor)22 Test (org.junit.Test)16 ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)5 ProjectRepositories (org.sonar.scanner.repository.ProjectRepositories)5 Before (org.junit.Before)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 File (java.io.File)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Profiler (org.sonar.api.utils.log.Profiler)1 AnalysisProperties (org.sonar.scanner.analysis.AnalysisProperties)1 AnalysisTempFolderProvider (org.sonar.scanner.analysis.AnalysisTempFolderProvider)1 DroppedPropertyChecker (org.sonar.scanner.bootstrap.DroppedPropertyChecker)1 ProjectLock (org.sonar.scanner.scan.ProjectLock)1 WorkDirectoryCleaner (org.sonar.scanner.scan.WorkDirectoryCleaner)1