Search in sources :

Example 6 with ProjectReactor

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

the class ProjectReactorValidatorTest method fail_with_backslash_in_key.

@Test
public void fail_with_backslash_in_key() {
    ProjectReactor reactor = createProjectReactor("foo\\bar");
    thrown.expect(MessageException.class);
    thrown.expectMessage("\"foo\\bar\" is not a valid project or module key");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Example 7 with ProjectReactor

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

the class ProjectReactorValidatorTest method fail_with_invalid_branch.

@Test
public void fail_with_invalid_branch() {
    ProjectReactor reactor = createProjectReactor("foo", "bran#ch");
    thrown.expect(MessageException.class);
    thrown.expectMessage("\"bran#ch\" is not a valid branch name");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Example 8 with ProjectReactor

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

the class ProjectReactorValidatorTest method fail_with_colon_in_branch.

@Test
public void fail_with_colon_in_branch() {
    ProjectReactor reactor = createProjectReactor("foo", "bran:ch");
    thrown.expect(MessageException.class);
    thrown.expectMessage("\"bran:ch\" is not a valid branch name");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Example 9 with ProjectReactor

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

the class ProjectReactorValidatorTest method fail_with_deprecated_sonar_phase.

@Test
public void fail_with_deprecated_sonar_phase() {
    ProjectReactor reactor = createProjectReactor("foo");
    settings.setProperty("sonar.phase", "phase");
    thrown.expect(MessageException.class);
    thrown.expectMessage("\"sonar.phase\" is deprecated");
    validator.validate(reactor);
}
Also used : ProjectReactor(org.sonar.api.batch.bootstrap.ProjectReactor) Test(org.junit.Test)

Example 10 with ProjectReactor

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

the class ProjectSettingsTest method should_not_fail_when_accessing_secured_properties.

@Test
public void should_not_fail_when_accessing_secured_properties() {
    Table<String, String, String> settings = HashBasedTable.create();
    settings.put("struts", "sonar.foo.secured", "bar");
    settings.put("struts", "sonar.foo.license.secured", "bar2");
    projectRef = new ProjectRepositories(settings, emptyFileData, null);
    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, projectRef, mode);
    assertThat(batchSettings.getString("sonar.foo.license.secured")).isEqualTo("bar2");
    assertThat(batchSettings.getString("sonar.foo.secured")).isEqualTo("bar");
}
Also used : ProjectRepositories(org.sonar.scanner.repository.ProjectRepositories) 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